You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When submitting a bug report, please include the following information (where relevant):
OS: Arch Linux
PyTorch version: 2.3.0
How you installed PyTorch (conda, pip, source): conda
Python version: 3.12
CUDA/cuDNN version: 12.1 (runtime) / 8.9.2
GPU models and configuration: 1070 Ti
GCC version (if compiling from source): /
When using torch.utils.cpp_extension.load to JIT compile the extension, the returned module does not provide access to the exported functions.
Code to reproduce (in interactive Python session with working directory extension-cpp):
I.e., load does seem to have the side-effect of loading the PyTorch op (similar to setting is_python_module=False), but does not provide the functions in the Python module.
I would expect to be able to use extension_cpp in the same way as torch.ops.extension_cpp.
I suspect that this issue is due to the empty PYBIND11_MODULE block.
This seems to be confirmed by the fact that the following modification in muladd.cpp makes extension_cpp.mymuladd available:
When submitting a bug report, please include the following information (where relevant):
When using
torch.utils.cpp_extension.load
to JIT compile the extension, the returned module does not provide access to the exported functions.Code to reproduce (in interactive Python session with working directory
extension-cpp
):Note that after the loading, the following does work:
I.e.,
load
does seem to have the side-effect of loading the PyTorch op (similar to settingis_python_module=False
), but does not provide the functions in the Python module.I would expect to be able to use
extension_cpp
in the same way astorch.ops.extension_cpp
.I suspect that this issue is due to the empty
PYBIND11_MODULE
block.This seems to be confirmed by the fact that the following modification in
muladd.cpp
makesextension_cpp.mymuladd
available:However, I am not sure if this is just a workaround or the actual bug-fix.
The text was updated successfully, but these errors were encountered: