CI: speed up wheel build with ccache #793
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 415 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.361
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #793"
general
weight: 0.35
VeeraRajasekhar
Description
Reduce the time of the
buildjob in ROCm CI by caching compiler output across runs with ccache.Wheel build step, gfx942 + gfx950 + gfx1250:
| | Time |
|---|---|
| Before (no cache) | 36.4 min |
| ccache, empty cache | 28.1 min |
| ccache, warm cache (116/116 hits) | 11.3 min |
With a warm cache, the C++/HIP compile takes under 2 min. Most of the remaining time is CMake configure, mostly the CK JIT step, which re-runs AITER codegen on every build and isn't covered by ccache. That step has taken 4–25 min on identical input, depending on the build node.
Type of change
Changes
build_tools/build_ext.py:NVTE_USE_CCACHE=1now also setsCMAKE_HIP_COMPILER_LAUNCHER. On ROCm the hipified.hipsources compile as the HIP language, so before this only.cppfiles went through ccache. This also applies to local builds.rocm-wheels-build.yml:rocm_archinput replaces the hardcodedNVTE_ROCM_ARCH. When empty, it falls back togfx942,gfx950,gfx1250.use_ccacheandsave_ccacheinputs, available on bothworkflow_callandworkflow_dispatch. CI always turns ccache on (seerocm-ci.ymlbelow). Both inputs default to off, so a manually started wheel build (e.g. for a release) builds from scratch unless ccache is selected. When enabled:- ccache 4.14.2 (static musl build, sha256-pinned) is downloaded and mounted into the build container. The build image is unchanged.
- The build sets
NVTE_USE_CCACHE=1and pinsNVTE_CMAKE_BUILD_DIRto/TransformerEngine/build/cmake. The default build dir has a random name per run, which would make every lookup miss.-
CCACHE_BASEDIRis set so absolute paths don't affect the hash, andCCACHE_COMPILERCHECK=contentso a changed ROCm compiler invalidates the cache.- The cache is restored from and saved to the Actions cache. The key is the arch list plus a hash of the build Dockerfile.
- Before saving, entries not used by the current build are evicted (
ccache --evict-older-than <build duration>), so a saved cache only holds the current objects: 232 files, ~111 MB compressed for three archs.CCACHE_MAXSIZEis 1G as a safety cap.- ccache statistics are printed after the build.
rocm-ci.yml:devwithout adding ~0.1 GB entries of their own to the repo's 10 GB cache.Checklist: