[hardware, fsdp, vllm] feat: add Intel GPU (XPU) support - #4
Draft
kahlun wants to merge 1 commit into
Draft
Conversation
kahlun
force-pushed
the
xpu/clean-pr2-trimmed
branch
4 times, most recently
from
August 12, 2026 10:37
738971f to
69ace1d
Compare
- Dockerfile: DLE 2026.1.0-ubuntu24.04, compute-runtime 26.18, vLLM v0.27.0, torch 2.13.0+xpu - Test scripts for GRPO/PPO/SFT on 1- and 2-GPU Intel Arc workstation - Remove deprecated docker entrypoint / env scripts - Update Intel GPU tutorials to match current software stack docs: Update Intel GPU Docker instructions to include VIDEO_GID and IPC settings for oneCCL docs: remove known workarounds for multi-GPU setup in README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds Intel GPU (PyTorch XPU) as a hardware backend for verl, enabling end-to-end GRPO, PPO, and SFT training with FSDP/FSDP2 actors and vLLM colocated rollout. Intel GPU is integrated through the existing platform-abstraction layer (the same path used by CUDA / Ascend NPU), so no algorithm or trainer code is forked — device dispatch is resolved generically via the platform registry and
get_device_name().Validated end-to-end on Intel Arc Pro B-series (Battlemage) hardware, single-GPU through multi-GPU.
Checklist Before Starting
torch.xpusupport.[{modules}] {type}: {description}:[hardware, fsdp, vllm] feat: add Intel GPU (XPU) support.Test
CI cannot cover this change: Intel GPU hardware is not available in GitHub Actions. Validated manually with Qwen2.5-0.5B-Instruct on GSM8K. Repro scripts are added under
tests/special_intel_gpu/.NUM_GPUS=2; script default is 4)NUM_GPUS=2; script default is 4)Commands:
API and Usage Example
No public API or CLI changes. Intel GPU is selected automatically when
torch.xpuis available; existing recipes run unmodified withtrainer.device=xpu.Design & Code Changes
Intel GPU plugs into the platform abstraction rather than adding device branches across the codebase.
Platform backend (new)
verl/plugin/platform/platform_xpu.py—PlatformXPU:torch.xpudevice management,xccl(oneCCL) collective backend viacommunication_backend_name(),ZE_AFFINITY_MASKdevice masking, Ray"GPU"resource mapping, and IPC disabled (falls back to shared memory pending SYCL IPC-handle support).verl/plugin/platform/platform_manager.py— register theintelplatform.ReduceOp.AVG workaround
verl/workers/engine_workers.pyandverl/trainer/sft_trainer.py—ReduceOp.AVGis not supported by oneCCL on the OFI scheduler path; replaced with explicitReduceOp.SUMfollowed by manual division for XPU devices. Tracked; expected to be resolved in an end-of-year PyTorch release.Engine registration
verl/workers/engine/fsdp/transformer_impl.py— add"xpu"to thedevice=list for bothFSDPEngineWithLMHeadandFSDPEngineWithValueHeadregistry decorators.Device-agnostic dispatch
verl/utils/attention_utils.py— XPU is routed through the existing NPU flash-attention shim (pure-PyTorch impl) viaget_platform().device_name == "xpu", removing the prior cuda/npu-only branch.verl/utils/torch_functional.py—log_probs_from_logits_response_rmpadandlog_probs_from_logits_all_rmpadnow import padding helpers fromverl.utils.attention_utilsunconditionally, replacing the hardcoded per-device import chain.tests/models/test_transformer.py,tests/models/test_transformers_ulysses.py— same fix: import fromverl.utils.attention_utilsunconditionally instead of branching oncuda/npu.tests/special_standalone/test_memory_buffers.py— replaced hardcodedtorch.cuda/.cuda()calls withget_device_name()/get_torch_device()so the test runs on any device.Test coverage
tests/plugin/test_platform_abstraction.py— extend auto-detection assertion to include"intel".Infra, docs, tests (new)
docker/intel_gpu/Dockerfile.intel_gpu+README.md,requirements-intel-gpu.txt.docs/intel_gpu_tutorial/intel_gpu_quick_start.rst,intel_gpu_build_dockerfile_page.rst+docs/index.rst.tests/special_intel_gpu/run_grpo_intel_gpu.sh,run_ppo_intel_gpu.sh,run_sft_intel_gpu.sh,run_grpo_colocate_rm_intel_gpu.sh,run_standalone_gen_intel_gpu.sh.Scope / limitations
Checklist Before Submitting
pre-commit install && pre-commit run --all-files --show-diff-on-failure --color=always.docs/intel_gpu_tutorial/).tests/special_intel_gpu/.