perf(ci): bootstrap Ninja and ROCm lld on lucebox3, prune affine FA units, and cache build deps

Merged
DU
3d ago
+169-33

Based on main (d552394eb). Reduces lucebox3 CI build overhead without changing test coverage, GitHub check names, or overlapping #1066.

What

  1. Bootstrap Ninja and expose ROCm ld.lld on lucebox3 (.github/workflows/ci.yml):

    • Cause: lucebox3 does not have ninja installed on its runner PATH, so ci.yml's command -v ninja check falls back to GNU Make (build-r9700, build-strix, serve-smoke-amd). Likewise, /opt/rocm/lib/llvm/bin/ld.lld is present on ROCm runners but outside the default runner PATH, so command -v ld.lld misses it and GCC's -fuse-ld=lld cannot resolve it.
    • Fix: Download SHA256-verified static ninja v1.12.1 into $HOME/.local/bin/ninja (cached across runs on the self-hosted runner), symlink /opt/rocm/lib/llvm/bin/ld.lld to $HOME/.local/bin/ld.lld when present, and prepend $HOME/.local/bin to $GITHUB_PATH.
  2. Skip unused FlashAttention units and image codecs in rocmfp-affine-build (.github/workflows/ci.yml, server/deps/llama.cpp/ggml/src/ggml-hip/CMakeLists.txt, server/deps/llama.cpp/ggml/src/ggml-cuda/fattn.cu):

    • Cause: rocmfp-affine-build only compiles and runs the 3 test_rocmfp2_{matmul,mmid,affine} tests, yet ggml-hip/CMakeLists.txt unconditionally globs fattn-tile*.cu, fattn-mma*.cu, and fattn-vec*.cu (97 HIP FlashAttention .cu units) even when -DGGML_CUDA_FA=OFF is passed.
    • Fix: Gate those fattn-*.cu globs (plus fattn-tile.cu and fattn-wmma-f16.cu) on if (GGML_CUDA_FA) in ggml-hip/CMakeLists.txt, guard the corresponding extern declarations and dispatch cases in ggml-cuda/fattn.cu with #ifndef GGML_CUDA_NO_FA, and pass -DGGML_CUDA_FA=OFF -DLUCE_IMAGE_CODECS=OFF to rocmfp-affine-build.
  3. Persistent build dependency cache on self-hosted runners (server/cmake/ImageCodecs.cmake, .github/workflows/ci.yml):

    • Add an optional LUCE_IMAGE_CODECS_CACHE_DIR cache variable (empty by default, preserving existing behavior for local builds) so ImageCodecs.cmake reuses the downloaded libjpeg-turbo tarball (DOWNLOAD_DIR) and hash-verified lodepng.{cpp,h} across clean build directories, and forward CMAKE_C_COMPILER_LAUNCHER into libjpeg_turbo_external.
    • Export LUCE_CI_DEPS_CACHE=$HOME/.cache/lucebox-ci-deps and pass -DFETCHCONTENT_BASE_DIR / -DLUCE_IMAGE_CODECS_CACHE_DIR in the lucebox3 and dgx-gb10 CMake configures.
  4. Drop dead -DCMAKE_HIP_FLAGS=-DLUCE_WAVE_SIZE=32 (.github/workflows/ci.yml):

    • LUCE_WAVE_SIZE has zero references anywhere in server/.

Tests

  • Validated .github/workflows/ci.yml with yaml.safe_load and bash -n on all modified shell steps.
  • Ran pytest .github/ci/ locally (105 passed) and .github/ci/check_commit_messages.py.
  • Live lucebox3 and dgx-gb10 CI runs will verify the full ROCm/CUDA builds and test suites end-to-end.

Known limits, not addressed here

  • -DLUCE_FA_ALL_QUANTS=OFF, -fuse-ld=lld linker flags, and single-process CppUnit execution are intentionally omitted from this PR because they were already authored in #1066 (currently on ci/optimize-ci-pipeline); exposing ld.lld in $HOME/.local/bin here lets #1066's command -v ld.lld check pick it up automatically once #1066 lands on main.
  • box_step.sh exited/zombie KFD PID self-preemption is tracked separately in #1068.