[CUDA 12] Autograd engine follow up#94929
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/94929
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 7ae5ba6: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| ) | ||
| set_source_files_properties(${TORCH_SRC_DIR}/csrc/jit/passes/frozen_conv_add_relu_fusion.cpp PROPERTIES COMPILE_FLAGS "-DUSE_CUDA=1") | ||
| set_source_files_properties(${TORCH_SRC_DIR}/csrc/jit/codegen/cuda/interface.cpp PROPERTIES COMPILE_FLAGS "-DUSE_CUDA=1") | ||
| set_source_files_properties(${TORCH_SRC_DIR}/csrc/autograd/engine.cpp PROPERTIES COMPILE_FLAGS "-DUSE_CUDA=1") |
There was a problem hiding this comment.
Why isn't this set for all files already. That sounds like a bug if it is not?
There was a problem hiding this comment.
Apparently USE_CUDA was not set. Or could it be that defined function in #if defined(USE_CUDA) is misbehaving? All I see that the code never checks the existence of primary context.
There was a problem hiding this comment.
Confirmed, USE_CUDA is just not being defined.
There was a problem hiding this comment.
@ngimel do you know how this is setup by any chance?
There was a problem hiding this comment.
No, I don't, sorry. There was this dream that we can have device-agnostic pieces of code, and thus not have any ifdefs in them, like engine.cpp, but apparently this doesn't work.
This would also need corresponding changes in the internal builds, cc @dagitses
|
Should we just wait until we have cuda 12 CI until fixing this? |
|
But until we have CI all of these will be pretty flaky as we can't actually test they do anything? |
This PR is follow up to #91191.
In my latest local builds
USE_CUDAnot being defined by default, therefore the following piece of code never enters the guards:pytorch/torch/csrc/autograd/engine.cpp
Lines 351 to 357 in fa1ea9f
In this PR
USE_CUDAis redefined by applying the compile flag.