-
Notifications
You must be signed in to change notification settings - Fork 283
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
Add support for including PTX code in PyTorch #2328
Conversation
This adds PTX code to PyTorch by default for any newer architecture than the last selected one. This can be changed by the new EC option "ptx"
Had to add a bugfix as TORCH_CUDA_ARCH_LIST needs to be set for tests too or the build (even current one) will fail if the GPUs found during build are newer than what the used nvcc supports. See https://gist.github.com/3ce737772ff805683c226e500b525c67 |
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 0 out of 1 (1 easyconfigs in total) |
easybuild/easyblocks/p/pytorch.py
Outdated
@@ -51,7 +51,9 @@ def extra_options(): | |||
extra_vars.update({ | |||
'excluded_tests': [{}, 'Mapping of architecture strings to list of tests to be excluded', CUSTOM], | |||
'custom_opts': [[], 'List of options for the build/install command. Can be used to change the defaults ' + | |||
'set by the PyTorch EasyBlock, for example ["USE_MKLDNN=0"].', CUSTOM] | |||
'set by the PyTorch EasyBlock, for example ["USE_MKLDNN=0"].', CUSTOM], | |||
'ptx': ['latest', 'For which compute architectures PTX code should be generated. Can be ' |
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.
The CUDA arches are not guaranteed to be in order, so one of the following changes is required:
latest
to becomelast
- The code below changes to add
+PTX
to the latest CUDA arch - We order the CUDA arches
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.
Good catch! Using "last" which matches "first" and is easiest.
I had to add an option for setting up the cuda cache as using There also seems to be a failure which I'm not sure about. Might be because I started the test to early. Will rerun |
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 1 (1 easyconfigs in total) |
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 0 out of 1 (1 easyconfigs in total) |
While this does work the amount of JIT compiling that would happen when running the so-compiled PyTorch make this unfeasible. So I'd recommend against using this and am closing it. |
This adds PTX code to PyTorch by default for any newer architecture than the last selected one.
This can be changed by the new EC option "ptx"
QUESTION: What about
cuda_cache_size
? It might be better to make this an easybuild option (similar to--cuda-compute-capabilities
) instead. E.g. for PyTorch the cache seems to be quite large. Running the testtest_cpp_extensions_aot_no_ninja
alone fills up 1GBFramework PR: easybuilders/easybuild-framework#3569 If that is merged I can remove the option in this EC