-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Move thnvrtc and DynamicLibrary to ATen #22362
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
Conversation
e4af4de
to
2b41e59
Compare
The test error is from #22052 , not from this PR. |
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.
Code changes look fine to me. I didn't review the build changes because I do not have the context for how they work anymore.
Does this open a way to custom fast user-provided CUDA-snippets? (like element-wise fused ops) |
@vadimkantorov could you elaborate a bit on what you mean exactly? |
I mean providing a wrapper that, given a user-provided CUDA expresion like In principle it's JIT's job, but meanwhile it's evolving, having a CUPY-like functionality: https://docs-cupy.chainer.org/en/stable/reference/kernel.html would be cool. |
@vadimkantorov I see. Let me explain a bit. This PR adds nothing new (unless you are using ATen and only ATen). The NVRTC stub currently lives in |
I think it would be great if this is also reviewed by a build person :) |
I'm not sure if this is relevant, but I think you can call libtorch code from ATen. |
@zou3519 fascinating! Are there examples on how to do that? |
You can include a torch header from any ATen file: pytorch/aten/src/ATen/NamedTensor.cpp Line 4 in b768777
This is possible because @kostmo did some build work on merging libcaffe2 and libtorch so that they are the same library. This will definitely break the ATen standalone library build though, if it still exists and if it hasn't been broken already. I don't know what our plan regarding the standalone is. |
@zou3519 Oh that's cool. Good to know that. Thanks! :) |
Hey @kostmo , can you review this? Thank you :) |
@pytorchbot merge this please :) |
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.
@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
It looks like this diff need some internal build updates. |
@ezyang Let me know if there is any thing I can help. I am more than happy to! |
The internal CI error is
I'm waiting for my internal source copy to check out and I'll look some more. |
I got a simple fix. Testing. |
Summary: Having the NVRTC stub in ATen is necessary to call driver APIs in ATen. This is currently blocking pytorch/pytorch#22229. `DynamicLibrary` is also moved as it is used in the stub code, and seems general enough. Pull Request resolved: pytorch/pytorch#22362 Differential Revision: D16131787 Pulled By: ezyang fbshipit-source-id: add2ee8a8865229578aa00001a00d5a6671e0e73
Internally, users are reporting this error:
|
@ezyang hmmm I know that internal builds are not using CMake. Maybe some internal build changes are needed for it to build the |
So, what I'm kind of thinking right now, is that all I need to do is turn |
Having the NVRTC stub in ATen is necessary to call driver APIs in ATen. This is currently blocking #22229.
DynamicLibrary
is also moved as it is used in the stub code, and seems general enough.