-
Notifications
You must be signed in to change notification settings - Fork 48
[Reland] Install xpu codegen header to torch/include #1743
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
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.
Pull Request Overview
This PR fixes the header installation for the torch-xpu-ops codegen by updating include paths for XPU op headers and adjusting CMake scripts.
- Updated include directives in multiple XPU source files to reference the proper directory (ATen/ops).
- Modified CMakeLists.txt and Codegen.cmake to copy generated XPU op headers into stock PyTorch’s include directory.
Reviewed Changes
Copilot reviewed 50 out of 50 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/ATen/native/xpu/*.cpp | Updated include paths from "xpu/ATen/ops" to "ATen/ops". |
src/ATen/CMakeLists.txt | Added installation of generated XPU header files into ATen/ops. |
cmake/Codegen.cmake | Introduced variable BUILD_TORCH_ATEN_GENERATED and header install commands to support header installation. |
655b4fa
to
b04c7b7
Compare
b04c7b7
to
56f8ef5
Compare
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.
Big one, difficult to review. But it's better with this change than without as it blocks certain types of pytorch xpu usage. Better to land and face consequences, if any. I hope it won't be reverted again. If something will go wrong - please, let's discuss before doing harsh reverts!
@chunhuanMeng May I know if the Windows build issue has been resolved. |
Yes, I have tested it on Windows. |
Let’s try landing it and see what happens. |
Motivation
This PR addresses a code generation issue related to XPU. Currently, there are two separate codegen paths for XPU:
The corresponding build directories are:
build/aten/src/ATen
(for stock PyTorch)build/xpu/ATen
(for torch-xpu-ops)However, in the torch-xpu-ops codegen, we mistakenly omitted installing XPU op headers from
build/xpu/ATen/ops
tobuild/aten/src/ATen/ops
. This PR fixes the issue and also removes some unnecessary code for better maintainability.Solution
We copy the codegen from torch-xpu-ops to stock PyTorch
Additional Context
The original PR is #1405
Fix pytorch/pytorch#145902