[XPU][NIXL] Add GPUDirect RDMA support for XPU#2
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for GPUDirect RDMA on XPU devices by integrating NIXL and UCX. Key changes include updating the UCX build process to enable Intel's oneAPI Level Zero (ZE) API, extending NIXL connector support for XPU KV buffer types, and implementing a critical environment variable setting to prevent potential UCX memory misdetection issues on XPU. These changes are essential for enabling efficient KV cache transfers on XPU platforms.
| # In some cases, the internal memory type cache can misdetect GPU | ||
| # memory as host memory, also leading to invalid memory access. | ||
| # This cache can be disabled by setting UCX_MEMTYPE_CACHE=n. | ||
| # ref. https://openucx.readthedocs.io/en/master/faq.html | ||
| os.environ["UCX_MEMTYPE_CACHE"] = "n" |
There was a problem hiding this comment.
Setting UCX_MEMTYPE_CACHE=n is a critical change to prevent potential memory misdetection issues with UCX on XPU. This directly addresses a potential cause of invalid memory access, which could lead to crashes or data corruption. It's good that this is explicitly documented with a reference to the UCX FAQ.
There was a problem hiding this comment.
Pull request overview
This pull request adds GPUDirect RDMA support for Intel XPU devices in the NIXL KV transfer connector. The changes enable direct memory access between XPU devices for more efficient KV cache transfers during distributed inference.
Changes:
- Enable XPU device memory for NIXL KV transfers (previously only CPU memory was supported)
- Configure UCX to disable memory type caching to avoid GPU memory misdetection
- Update UCX build configuration to enable Intel Level Zero (ZE) support for XPU devices
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| vllm/platforms/xpu.py | Adds UCX_MEMTYPE_CACHE environment variable configuration to prevent memory type misdetection |
| vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py | Adds "xpu" to supported KV buffer devices for XPU platform and simplifies memory type selection logic |
| tools/install_nixl_from_source_ubuntu.py | Updates UCX build to use specific commit and enable ZE support for XPU compatibility |
Comments suppressed due to low confidence (1)
vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py:956
- There is a logic error in this code. After line 951, nixl_memory_type will always have a value (either from current_platform.get_nixl_memory_type() or from the ternary expression), so the condition on line 952 checking if nixl_memory_type is None will never be true. This makes the error handling at lines 952-956 unreachable code.
The check on line 952 appears to be a leftover from the previous code structure and should be removed.
if nixl_memory_type is None:
raise RuntimeError(
f"{self.device_type} with {self.kv_buffer_device} kv_buffer "
"is not supported."
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # In some cases, the internal memory type cache can misdetect GPU | ||
| # memory as host memory, also leading to invalid memory access. | ||
| # This cache can be disabled by setting UCX_MEMTYPE_CACHE=n. | ||
| # ref. https://openucx.readthedocs.io/en/master/faq.html | ||
| os.environ["UCX_MEMTYPE_CACHE"] = "n" |
There was a problem hiding this comment.
The UCX_MEMTYPE_CACHE environment variable is being set unconditionally for all XPU configurations, but this setting is specifically for GPUDirect RDMA support which is only relevant when KV transfer is enabled. This could have unintended side effects on configurations that don't use KV transfer.
Consider making this setting conditional on kv_transfer_config being enabled, similar to how other KV transfer related configurations are handled in this method (see line 184).
| @@ -139,7 +139,7 @@ def build_and_install_prerequisites(args): | |||
| if not os.path.exists(UCX_DIR): | |||
| run_command(["git", "clone", UCX_REPO_URL, UCX_DIR]) | |||
| ucx_source_path = os.path.abspath(UCX_DIR) | |||
There was a problem hiding this comment.
The change from checking out a branch (v1.19.x) to a specific commit hash (e5d9887) lacks documentation explaining why this specific commit is needed. This makes it difficult for maintainers to understand:
- What version or features this commit corresponds to
- Why this specific commit was chosen over the v1.19.x branch
- Whether this commit includes important fixes or features for GPUDirect RDMA support
Consider adding a comment explaining what this commit represents and why it was chosen, or document this in the PR description.
| ucx_source_path = os.path.abspath(UCX_DIR) | |
| ucx_source_path = os.path.abspath(UCX_DIR) | |
| # NOTE: We pin UCX to a specific, known-good commit instead of tracking | |
| # a moving branch (e.g., v1.19.x). Commit e5d9887 corresponds to a UCX | |
| # revision that has been validated with nixl for our GPUDirect RDMA | |
| # use case. If you update this hash, please ensure the new commit has | |
| # been tested with nixl and GPUDirect RDMA and update this comment. |
| # In some cases, the internal memory type cache can misdetect GPU | ||
| # memory as host memory, also leading to invalid memory access. | ||
| # This cache can be disabled by setting UCX_MEMTYPE_CACHE=n. | ||
| # ref. https://openucx.readthedocs.io/en/master/faq.html | ||
| os.environ["UCX_MEMTYPE_CACHE"] = "n" |
There was a problem hiding this comment.
The PR description is empty except for the template. This makes it difficult to understand:
- What problem this PR is solving
- How GPUDirect RDMA support was tested
- What the expected performance or functional improvements are
- What the changes to UCX configuration (ZE support, specific commit) are intended to accomplish
Please complete the PR description with the purpose, test plan, and test results as indicated by the template checklist.
b361c4c to
ee1bcfb
Compare
|
@copilot help review again |
|
@zhenwei-intel I've opened a new pull request, #3, to work on those changes. Once the pull request is ready, I'll request review from you. |
…35338) Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
…consumer NVIDIA GPUs (vllm-project#33992) Signed-off-by: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Signed-off-by: Andrew Mello <19512127+88plug@users.noreply.github.com> Co-authored-by: 88plug <19512127+88plug@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
Signed-off-by: LopezCastroRoberto <rocastro@redhat.com>
Signed-off-by: hujiaxin <524446785@qq.com> Signed-off-by: Emilie1001 <79921183+Emilie1001@users.noreply.github.com> Co-authored-by: Emilie1001 <79921183+Emilie1001@users.noreply.github.com> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn>
…t#34109) Signed-off-by: hjjq <50634613+hjjq@users.noreply.github.com> Signed-off-by: wzhao18 <wzhao18.sz@gmail.com> Co-authored-by: wzhao18 <wzhao18.sz@gmail.com> Co-authored-by: Wei Zhao <51183510+wzhao18@users.noreply.github.com>
Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
…ect#34890) Signed-off-by: Fadi Arafeh <fadi.arafeh@arm.com> Co-authored-by: Tyler Michael Smith <tlrmchlsmth@gmail.com>
…roject#28672) Signed-off-by: jasonlizhengjian <jasonlizhengjian@gmail.com> Signed-off-by: Jason Li <jasonlizhengjian@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
vllm-project#34887) Signed-off-by: Daniele Trifirò <dtrifiro@redhat.com> Co-authored-by: Nicolò Lucchesi <nlucches@redhat.com>
…rmony.py (vllm-project#35339) Signed-off-by: sfeng33 <4florafeng@gmail.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
…IGC_ForceOCLSIMDWidth=16` (vllm-project#35298) Signed-off-by: Ofir Zafrir <ofir.zafrir@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
Signed-off-by: chzhang <chaojun.zhang@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
… before compilation config init (vllm-project#34848) Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
vllm-project#35250) Signed-off-by: c0de128 <kevin.mckay@outlook.com>
…t#35283) Signed-off-by: KrxGu <krishom70@gmail.com>
Signed-off-by: zjy0516 <riverclouds.zhu@qq.com>
…oject#35220) Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com> Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
…4le (vllm-project#35081) Signed-off-by: Akash kaothalkar <akash.kaothalkar@ibm.com> Co-authored-by: Akash kaothalkar <akash.kaothalkar@ibm.com>
… loading (vllm-project#35289) Signed-off-by: daowu.hzy <daowu.hzy@alibaba-inc.com> Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Signed-off-by: emricksini-h <emrick.birivoutin@hcompany.ai> Co-authored-by: Roger Wang <hey@rogerw.io>
Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
…vllm-project#35557) Signed-off-by: Martin Vit <martin@voipmonitor.org>
Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
Signed-off-by: zhenwei-intel <zhenwei.liu@intel.com>
Signed-off-by: gnovack <gnovack@amazon.com> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
…t#34931) Signed-off-by: Ryan Rock <ryan.rock@amd.com>
…5628) Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
…ect#34798) Signed-off-by: Josephasafg <ajgard7@gmail.com>
…XCLUDE (vllm-project#35630) Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
…n backend (vllm-project#35382) Signed-off-by: Seungho Yoon <yoonsnowdev@gmail.com>
…ct#35671) Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
…orch.compile (vllm-project#35256) Signed-off-by: haosdent <haosdent@gmail.com>
…m-project#35475) Signed-off-by: Richard Zou <zou3519@gmail.com>
…llm-project#33192)" (vllm-project#34832) Signed-off-by: Zhanqiu Hu <zh338@cornell.edu>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Signed-off-by: Matthew Bonanni <mbonanni@redhat.com> Signed-off-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com> Co-authored-by: Matthew Bonanni <mbonanni@redhat.com> Co-authored-by: Tyler Michael Smith <tyler@neuralmagic.com>
Signed-off-by: Jesse Cai <jessecai@fb.com>
Signed-off-by: Kunshang Ji <kunshang.ji@intel.com>
…d models (vllm-project#35658) Signed-off-by: Hongxia Yang <hongxiay.yang@amd.com> Co-authored-by: Hongxia Yang <hongxiay.yang@amd.com>
…ix non-determinism (vllm-project#35152) Signed-off-by: Andreas Karatzas <akaratza@amd.com>
…ls (vllm-project#34448) Signed-off-by: EdalatiAli <aliedalati@cohere.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
…4750) Signed-off-by: charlifu <charlifu@amd.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: NickLucche <nlucches@redhat.com>
Purpose
Add GPUDirect RDMA support for XPU in NIXL connector.
Requirements:
Limitations:
Test Plan
Performance data of Llama3.3-70B int4 model with fp8 kvcache on 8xB60, ISL=1500, OSL=150
2P1D vs Non-PD under SLO TTFT<5s, ITL<100ms
PD commands
prefill
prefill2
decode
proxy
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.