-
Notifications
You must be signed in to change notification settings - Fork 576
Use consistent names for internal nvcc
files
#2383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Use consistent names for internal nvcc
files
#2383
Conversation
Looks like integration tests are failing due to https://github.blog/changelog/2025-03-20-notification-of-upcoming-breaking-changes-in-github-actions/#decommissioned-cache-service-brownouts |
cc: @robertmaynard for review |
fc85929
to
051fec9
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2383 +/- ##
==========================================
+ Coverage 71.58% 71.69% +0.11%
==========================================
Files 65 65
Lines 36214 36430 +216
==========================================
+ Hits 25923 26120 +197
- Misses 10291 10310 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ffe68b9
to
3c08b18
Compare
Output(PathBuf), | ||
PassThrough(OsString), | ||
UnhashedFlag, | ||
ExtraOutput(PathBuf), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed this from UnhashedOutput -> ExtraOutput
to reflect that these argument types are now hashed.
i wish this kind of changes would be done in a separate PR
Maybe split this PR into several Note: it is why it takes time to merge your PR, split them into smaller PR would make our life much easier |
@sylvestre I am fine with either squashing or merging. If you'd prefer to squash, are there files you'd like me to revert? If merge, I can rebase out the follow-up commits. |
would be my personal preference. |
same, smaller PR would be ideal :) |
caf8955
to
e599942
Compare
I rebased on I can make a separate PR with the test changes after this one. How does that sound? |
// up in the preprocessed output, so using random tmpdir paths leads to | ||
// erroneous cache misses. | ||
let out_dir = env::temp_dir().join("sccache_nvcc").join({ | ||
// Combine `hash_key` with the output path in case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename hash_key
to something less ambiguous? It's temp dir subdir stabilizer, hash_key
is not encoding that, it also needs docs in the trait
definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I called it hash_key
because it's the key produced by the call to generate_hash_key()
for this nvcc
compilation. I am fine calling it something else, it just seemed the most descriptive and consistent name.
I do plan to update the |
e599942
to
4d47627
Compare
I updated the tests in The rust v1.75.0 jobs are failing to |
CC @sylvestre re grcov |
it is change in the dep tree of grcov |
4d47627
to
4aa034e
Compare
These changes ensure cache hits for compilations which are subsets of previously cached compilations * Normalize cudafe++, ptx, and cubin names regardless of whether the compilation flag is `-c`, `-ptx`, `-cubin`, or whether there are one or many `-gencode` flags * Include the compiler `hash_key` in the output dir for internal nvcc files to guarantee stability and uniqueness * Fix cache error due to hash collision from not hashing all the PTX and cubin flags
4aa034e
to
f736d4c
Compare
This PR extracts the fixes from #2356 per @drahnr's request.
This PR branched from/is a follow-up to #2382. See the diff of the two branches here.
The names for the internal files depend on the compilation flag and device architectures.
nvcc
generates a different name for the.cpp1.ii
,.cudafe1.c
,.cudafe1.stub.c
,.cudafe1.gpu
,.ptx
, and.cubin
files when the compile flag is-ptx
,-cubin
, or-c
, and also on whether there's one vs. many-gencode
arguments. Additionally, it will either include or omit the--gen_module_id_file
flag from thecicc
invocation based on whether the compile flag is-ptx
,-cubin
, or-c
.Some examples:
From the above, we observe that:
.cpp1.ii
,.cudafe1.c
,.cudafe1.stub.c
,.cudafe1.gpu
, and.ptx
files are either:x.<suffix>
x.compute_XX.<suffix>
.cubin
files are either:x.cubin
x.compute_XX.cubin
x.compute_XX.sm_XX.cubin
-c
, thecicc
command includes--gen_module_id_file
-c
, thecicc
command omits--gen_module_id_file
This PR hashes all the
cudafe++
,cicc
, andptxas
arguments to avoid collisions, but nvcc's inconsistent file naming leads to cache misses when there should be hits. So for simplicity I updated the renaming logic to rename to the longest form of each (i.e.x.compute_XX.ptx
,x.compute_XX.sm_XX.cubin
), and always add the--gen_module_id_file
flag tocicc
invocations.