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) |
| '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.
The CUDA arches are not guaranteed to be in order, so one of the following changes is required:
latestto becomelast- The code below changes to add
+PTXto the latest CUDA arch - We order the CUDA arches
There was a problem hiding this comment.
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_ninjaalone fills up 1GBFramework PR: easybuilders/easybuild-framework#3569 If that is merged I can remove the option in this EC