Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/169043
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Cancelled Job, 1 Unrelated FailureAs of commit 3a38261 with merge base c6ae757 ( CANCELLED JOB - The following job was cancelled. Please retry:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
I am working on it. |
| }); | ||
| } | ||
|
|
||
| static void registerXpuPluggableAllocator(PyObject* module) { |
There was a problem hiding this comment.
cc @albanD on advice if this is the right device extension api for allocator. seems reasonable to me
There was a problem hiding this comment.
@albanD This is the same as CUDA.
pytorch/torch/csrc/cuda/Module.cpp
Lines 1210 to 1211 in 85a3159
|
|
||
| include_dirs = kwargs.get("include_dirs", []) | ||
| include_dirs += include_paths() | ||
| include_dirs += include_paths(device_type="xpu") |
There was a problem hiding this comment.
Hi @albanD @malfet , please refer to
pytorch/torch/utils/cpp_extension.py
Lines 1561 to 1598 in 85a3159
include_paths defaults to using cpu as the device type. However, in SyclExtension, we need to include the SYCL headers. To ensure the SYCL include path is added, I explicitly set device_type to xpu, which triggers inclusion of the SYCL-specific include directories.
|
Let's land this PR first. If there are any additional concerns, we can address them in a follow-up PR. |
|
Thanks @eellison |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: xpu / linux-noble-xpu-n-py3.10 / test (default, 6, 12, linux.idc.xpu) Details for Dev Infra teamRaised by workflow job |
|
"log upload timeout" |
Merge startedYour change will be merged while ignoring the following 2 checks: trunk / linux-jammy-rocm-py3.10 / test (default, 1, 6, linux.rocm.gpu.gfx942.1, unstable), xpu / linux-noble-xpu-n-py3.10 / test (default, 6, 12, linux.idc.xpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…#169043) # Motivation This PR aims to introduce `torch.xpu.memory.XPUPluggableAllocator` and focus on the frontend part. Meanwhile, we introduce an API `torch.xpu.memory.change_current_allocator` that used to change the current `XPUAllocator`. Both APIs has the CUDA counterpart. # Additional Context This API would be used in popular repos such as https://github.com/search?q=repo%3Avllm-project%2Fvllm%20cudapluggableallocator&type=code Pull Request resolved: #169043 Approved by: https://github.com/EikanWang, https://github.com/gujinghui, https://github.com/eellison ghstack dependencies: #168966
Stack from ghstack (oldest at bottom):
Motivation
This PR aims to introduce
torch.xpu.memory.XPUPluggableAllocatorand focus on the frontend part. Meanwhile, we introduce an APItorch.xpu.memory.change_current_allocatorthat used to change the currentXPUAllocator. Both APIs has the CUDA counterpart.Additional Context
This API would be used in popular repos such as https://github.com/search?q=repo%3Avllm-project%2Fvllm%20cudapluggableallocator&type=code