-
Notifications
You must be signed in to change notification settings - Fork 212
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
[feature request] Add support for '.' characters in TORCH_EXTENSION_NAME #13
Comments
I actually found a workaround for now. If you want to name your module "foo.bar" you can use the top-level module name foo as the extension name and put the submodule names in the module def(), as shown here:
|
cc: @goldsborough |
Hi @nkolot, this is a known issue with |
@nkolot are you sure you installed PyTorch from source? The fix @goldsborough mentioned is not present in pytorch 0.4 (which is what we have for the binaries) |
Yes, PyTorch is compiled from source.
and in bar_cuda.cpp
It even works with deeper nesting, i.e. foo.bar.foobar, as long as I put the last part in PYBIND. |
Great, thanks for confirming. Think we can close this then. |
@nkolot I still didn't quite understand... is pytorch/pytorch#6986 present in your installation? That patch is supposed to be doing what @goldsborough mentioned. |
It seems that I compiled PyTorch before the fix.
|
I was trying to build a CUDAExtension, where the extension name was containing dots. The reason for that is that I wanted to install it as a submodule of the module I am building. For example, I have a top-level module foo and I want my CUDA Extension to be foo.bar.
There is a related discussion also here.
This is currently not possible using CUDAExtension and I can't think of a workaround right now. The obvious reason here is that the macros don't allow for '.' characters. I am attaching the output of the build process. A fast way to replicate this is to change the module name from lltm_cuda to foo.cuda in your CUDA lltm example.
The text was updated successfully, but these errors were encountered: