Open
Conversation
Signed-off-by: mdzurick <mdzurick@nvidia.com>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: mdzurick <mdzurick@nvidia.com>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix source build cache invalidation in CI
Problem
The "Load source build cache" job (
source_build/ prereqs stage) was rebuilding almost every run because the prereqs layers were invalidated on nearly every commit.The cause was
ADD .git/modules/tpls/llvm/HEADandADD .git/modules/tpls/pybind11/HEADinassets.Dockerfile. These files depend on the current checkout, so they change whenever:When that
ADDlayer changes, BuildKit invalidates all later layers (git init, LLVM build, GCClddcheck), so the expensive prereqs stage was rarely cached.Solution
Use build args
llvm_commitandpybind11_commitinstead of adding.git/modules/HEAD files from the build context. The prereqs layer cache is now driven by submodule commit hashes instead of the current checkout.llvm_commit/pybind11_commit→ cache hit (e.g. PRs based on main that don’t change submodules)Changes
docker/build/assets.Dockerfile: AddARG llvm_commitandARG pybind11_commit; replaceADDof submodule HEAD files with aRUNthat creates them from these args.ci.yml: Passllvm_commitandpybind11_commitinto thesource_buildjob.create_cache_command.yml: Pass submodule commits into thesource_build_cachesjob.deployments.yml: Pass submodule commits into thesource_buildjob.prebuilt_binaries.yml: Compute and passllvm_commitandpybind11_commitfor builds where the cache may be cold.