-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Use TORCH_CUDA_ARCH_LIST to specify which CUDA architectures to build for #3399
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3399 +/- ##
==========================================
- Coverage 78.75% 74.83% -3.93%
==========================================
Files 105 105
Lines 9750 9722 -28
Branches 1566 1563 -3
==========================================
- Hits 7679 7275 -404
- Misses 1581 1960 +379
+ Partials 490 487 -3
Continue to review full report at Codecov.
|
@ezyang it seems that removing the |
Try setting |
@seemethere I'm trying to replace I'm not sure whether this is an issue with pytorch or if I'm doing something wrong. Would you mind taking a look? Thanks! |
Here's the code that's failing:
This suggests that the environment variable isn't being passed through. Add this env var to the conda meta.yaml here vision/packaging/torchvision/meta.yaml Line 41 in 978ba61
|
packaging/torchvision/meta.yaml
Outdated
@@ -39,6 +39,7 @@ build: | |||
- FORCE_CUDA | |||
- NVCC_FLAGS |
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.
Maybe we can remove this flag now?
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'm not sure we can remove it, as NVCC_FLAGS
is still being used in the windows files:
vision/packaging/windows/cuda101.bat
Lines 35 to 40 in 978ba61
IF "%BUILD_VISION%" == "" ( | |
set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;6.1;7.0;7.5 | |
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all | |
) ELSE ( | |
set NVCC_FLAGS=-D__CUDA_NO_HALF_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50 | |
) |
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 wonder if we still need this given that PyTorch already set those in cpp_extensions.
Maybe @peterjc123 could chime in?
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 removed it in 5055fa8 and it looks like the CI is still happy
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.
Yeah but that codepath might not be exercised on the PR CI, but only on the release CIs.
I'd love to get @peterjc123 to double-check this part before we merge this
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.
BTW, it seems the script (vision/packaging/windows/cuda101.bat) is not used anymore.
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.
Great, thanks for the confirmation @peterjc123 !
I've opened #3617 to track removing this file
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.
Thanks @NicolasHug
… to build for (#3399) Summary: * trying stuff * Put flags back? * remove second one just to see * It worked but it's because it's not built by CI. Trying another one * Try using TORCH_CUDA_ARCH_LIST instead * oops * Add new env variable to build/script_env * set TORCH_CUDA_ARCH_LIST for the rest of the CUDA versions * don't pass NVCC_FLAGS venv to conda, let's see if it works Reviewed By: fmassa Differential Revision: D27433927 fbshipit-source-id: e207f7fe6a1bab322e41d6dcabe7eb2b8e70b246 Co-authored-by: Francisco Massa <fvsmassa@gmail.com>
I wonder if we should have TORCH_CUDA_ARCH_LIST exported from pytorch to cmake configs, so that torch vision can build consistently with the pytorch it's relying on? |
@xksteven yes, I think this is a good idea and something I would love to see implemented in PyTorch. Can you create an issue in PyTorch to track this down? |
This PR uses the
TORCH_CUDA_ARCH_LIST
env variable to specify which virtual and real architectures to build for, instead of using the more verboseNVCC_FLAGS
specification.Closes #2377
Closes #2026