-
Notifications
You must be signed in to change notification settings - Fork 25
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
Expose TORCH_XPU_API to Pytorch #279
Conversation
This PR is relied upon stock Pytorch PR: pytorch/pytorch#126678 |
@etaf , is it critical to catch up PT 2.4? |
No, it's a performance optimization. |
Since this Pytorch 2.4 release branch has been cut, I think we can start land this PR and the pytorch/pytorch#126678 that depend on it. |
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.
LGTM.
src/aten/EmptyTensor.cpp
Outdated
@@ -1,6 +1,7 @@ | |||
#define TORCH_ASSERT_NO_OPERATORS | |||
#include <ATen/Context.h> | |||
#include <ATen/EmptyTensor.h> | |||
#include <ATen/xpu/EmptyTensor.h> |
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.
Since we have included the xpu/EmptyTensor, is ATen/EmptyTensor still required?
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.
ATen/xpu/EmptyTensor.h
is the exported interface of EmptyTensor.cpp
and ATen/EmptyTensor.h
is for at::detail::empty_generic
which is used in this EmptyTensor.cpp
file.
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.
Then my question will be why ATen/xpu/EmptyTensor.h
includes ATen/EmptyTensor.h
?
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.
Sorry, but ATen/xpu/EmptyTensor.h
does not include ATen/EmptyTensor.h
. ATen/xpu/EmptyTensor.h
is a copy of torch-xpu-ops/src/aten/EmptyTensor.h
.
da79f4c
to
e24770c
Compare
@fengyuan14 can you help review this PR? |
5296f1b
to
0b2393a
Compare
0b2393a
to
292fadc
Compare
You can expose the var to PyTorch cmake, torch-xpu-ops/src/CMakeLists.txt Line 7 in a7c3bd2
And append it into cmake var of Caffe2 or ATen include dirs. |
Wouldn't that make the two PRs dependent on each other? |
ATen_XPU_INCLUDE_DIR is the committed formal and stable API of torch-xpu-ops CMAKE. It is not implementation dependent. |
The original design is to align the include path with CPU/CUDA, eg. |
292fadc
to
085062d
Compare
085062d
to
b150b98
Compare
Expose TORCH_XPU_API to Pytorch