Skip to content

Fix sccache summary to count CUDA sub-tool cache hits - #878

Merged
leofang merged 1 commit into
NVIDIA:mainfrom
leofang:fix/sccache-summary-cuda-subcounts
May 16, 2026
Merged

leofang merged 1 commit into
NVIDIA:mainfrom
leofang:fix/sccache-summary-cuda-subcounts

Conversation

@leofang

@leofang leofang commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

The sccache step summary reported 0% cache hit rate even when sccache's own --show-adv-stats showed ~34%.

The rapidsai/sccache fork tracks CUDA compilation sub-phases under separate language keys in the JSON stats:

  • "CUDA" — nvcc driver pass
  • "CUDA (Device code)" — cudafe++ pass
  • "PTX" — cicc pass
  • "CUBIN" — ptxas pass

The summary script only counted {"C/C++", "CUDA"}, which captures the nvcc driver pass only. That pass typically has 0 cache hits — the actual hits all land in the sub-tool categories. This PR adds the missing keys so the reported rate matches sccache's own output.

Before (from this job):

test artifacts (CUDA 12.9.1): 0% hit rate (0/91)

while sccache reported Cache hits rate 33.74%.

After: would report 33% hit rate (111/329).

Test plan

  • Reproduced the bug locally with a mock JSON matching the CI run's stats — old logic gives 0% (0/91), new logic gives 33.74% (111/329), matching sccache's own report.
  • The fix will be validated on the next CI run that produces sccache stats.

The rapidsai/sccache fork tracks CUDA compilation sub-phases under
separate language keys in the JSON stats: "CUDA" (nvcc driver),
"CUDA (Device code)" (cudafe++), "PTX" (cicc), and "CUBIN" (ptxas).

The summary script only counted the "CUDA" key, which represents just
the top-level nvcc pass and typically shows 0 cache hits.  All the
actual cache hits land in the sub-tool categories.  This caused the
step summary to report 0% hit rate even when sccache's own stats
showed ~34%.

Include all CUDA-related language keys so the reported rate matches
sccache's own "Cache hits rate" output.
@copy-pr-bot

copy-pr-bot Bot commented May 7, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@leofang

leofang commented May 11, 2026

Copy link
Copy Markdown
Member Author

/ok to test 140b45b

@leofang leofang added the 3 - Ready for Review Ready for review by team label May 12, 2026
@leofang

leofang commented May 16, 2026

Copy link
Copy Markdown
Member Author

Admin-merge since this is CI infra-only and does not affect building/testing.

@leofang
leofang merged commit 5013eaf into NVIDIA:main May 16, 2026
214 of 216 checks passed
@leofang
leofang deleted the fix/sccache-summary-cuda-subcounts branch May 16, 2026 00:28
@kkraus14 kkraus14 mentioned this pull request Jun 25, 2026
kkraus14 added a commit that referenced this pull request Jun 25, 2026
## Summary

- Bump the package version to 0.30.3 for the next patch release.

## Changes since v0.30.2

- Add CUDA 13 maintenance notice and pixi build fix (#899)
- Fix sccache summary to count CUDA sub-tool cache hits (#878)

## Validation

- `python -c "from pathlib import Path; assert
Path('numba_cuda/VERSION').read_text().strip() == '0.30.3'; assert
'version = \"0.30.3\"' in Path('pixi.toml').read_text(); print('version
files OK')"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant