Repository navigation
Key the C++ test JIT cache per test shard - #2777
Merged
Merged
Conversation
The C++ tests run in 4 shards, and each shard links a different set of JIT-LTO kernels, but all shards used one CUDA JIT cache key. Only the first shard to finish could save its archive under that key, so the other shards restored kernels they don't use and linked theirs again on every run. Include the shard in the cache key, and log how many cache files exist before and after the tests, so the hit rate is visible in the CI logs.
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
Author
|
/ok to test 87d358c |
Removed redundant comment about cache per test shard in CI workflow.
Removed redundant comment about cache sharing for test shards.
vyasr
approved these changes
Oct 12, 2026
jameslamb
approved these changes
Oct 12, 2026
Contributor
Author
|
/merge |
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.
#2665 keeps the CUDA JIT cache (
CUDA_CACHE_PATH) of the C++ tests between CI runs. libcuvs links its JIT-LTO kernels at run time with nvJitLink, and nvJitLink caches the linked kernels there. A CAGRA single-CTA search kernel takes about 5 s to link, and a cached one takes 20–40 ms.The C++ tests now run in 4 shards (#2720), and each shard links a different set of kernels. All four use the same cache key, though. Caches are immutable, so only one shard can save its archive under that key. The other three restore kernels they don't use and link their own again on every run.
Evidence from CI
Nightly test run https://github.com/rapidsai/cuvs/actions/runs/37894118256 (main at f751cad):
conda-cpp-testsshards restore the same archive (prefixlibcuvs-cudajit-v1, about 9 MB).Example jobs, 13.3.0 amd64 rtxpro6000: shard 1, 2, 3, 4.
This PR
cache-key-prefixinpr.yamlandtest.yaml(libcuvs-cudajit-v1-shard${{ matrix.shard }}of${{ matrix.num_shards }}). Each shard then saves and restores its own archive.ci/test_cpp.sh, so it's visible which shards hit the cache. A shard whose count grows by hundreds of files linked its kernels again.Measurements
RTX 6000 Ada (48 GB), 36-thread host, otherwise idle. Each shard's exact test list from the run above, with
ctest -j8: first with an emptyCUDA_CACHE_PATH, then again with the cache it had just filled.Shard 2 already gets its own cache today. For shards 1, 3 and 4 this is about 820 s less GPU-runner time per configuration, and about 300 s off the longest shard. The real gain may be somewhat smaller, because the restored shard-2 archive can cover a few kernels of the other shards.
For reviewers