Skip to content
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

CUDAARCHS should be NATIVE when building locally #254

Open
etseidl opened this issue Mar 22, 2024 · 8 comments
Open

CUDAARCHS should be NATIVE when building locally #254

etseidl opened this issue Mar 22, 2024 · 8 comments

Comments

@etseidl
Copy link

etseidl commented Mar 22, 2024

I'm doing a devcontainer build without GitHub auth. In ~coder/.bashrc SCCACHE_BUCKET and SCCACE_REGION are unset, but CUDAARCHS is left set as "RAPIDS" causing my build to target all architectures. I think CUDAARCHS should either be unset or set to "NATIVE" in this case.

@vyasr
Copy link
Contributor

vyasr commented Mar 26, 2024

I'd be in favor of this. There's no need to build all architectures by default IMO.

@trxcllnt
Copy link
Collaborator

trxcllnt commented Mar 26, 2024

Yes there is. When you change the list of archs, the sccache key changes. Since most devs have different GPUs than CI/other devs, the likelihood the build cache is populated for your flavor of compile flags/git commit/gpu versions etc. becomes less likely.

This issue is about setting CUDAARCHS to native when the SCCACHE_BUCKET is unset. This should be fine, if a little dirty since it means setting an envvar in one feature to benefit a different feature.

@trxcllnt
Copy link
Collaborator

trxcllnt commented Mar 26, 2024

@etseidl you could also set the envvar to native here. Don't unset it, because the default is all-major if unset.

@etseidl
Copy link
Author

etseidl commented Mar 26, 2024

@etseidl you could also set the envvar to native here. Don't unset it, because the default is all-major if unset.

@trxcllnt Yes, I figured that out after I filed this. But it's still a little dicey since I'd have to remember to not commit that change 😄.

Yes there is. When you change the list of archs, the sccache key changes. Since most devs have different GPUs than CI/other devs, the likelihood the build cache is populated for your flavor of compile flags/git commit/gpu versions etc. becomes less likely.

This is true for NVIDIA devs, but not for plebes like me. I was thinking that since there's already special handling for the sccache envvars, wherever that logic sits it could also modify CUDAARCHS. Right now I just change my bashrc to set CUDAARCHS, so I've got a fix that works for me. My main concern now is just that it took me a pretty long time to figure out that CUDAARCHS even existed 😅

@vyasr
Copy link
Contributor

vyasr commented Mar 27, 2024

Yes there is. When you change the list of archs, the sccache key changes. Since most devs have different GPUs than CI/other devs, the likelihood the build cache is populated for your flavor of compile flags/git commit/gpu versions etc. becomes less likely.

That's true, there are certainly some tradeoffs there. It probably varies on a case-by-case basis whether or not your sccache hit rate is going to be good enough to be worth the extra compilation you do locally once you start changing things if you're only compiling for the native architecture.

@trxcllnt
Copy link
Collaborator

It probably varies on a case-by-case basis whether or not your sccache hit rate is going to be good enough to be worth the extra compilation you do locally once you start changing things if you're only compiling for the native architecture.

It's not just about your hit rate, you're also populating the cache for CI/other devs :-)

@jrhemstad
Copy link
Collaborator

Yes there is. When you change the list of archs, the sccache key changes. Since most devs have different GPUs than CI/other devs, the likelihood the build cache is populated for your flavor of compile flags/git commit/gpu versions etc. becomes less likely.

100% agreed. If a user is using sccache, then they should be building for all archs by default.

I agree with @etseidl that if you're not using sccache than using native makes sense.

@vyasr
Copy link
Contributor

vyasr commented Apr 4, 2024

I wasn't thinking about the fact that sccache doesn't cache granularly enough to share artifacts between users who compile for all archs and those who compiles for a specific subset of them. Agreed, compiling for all archs makes sense if you have access to the shared cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants