feat(xpu): Add Intel GPU support for veRL training - #2
Open
kahlun wants to merge 26 commits into
Open
Conversation
Add comprehensive Intel GPU (Arc/Arc Pro B-series) support for veRL: - Docker image with Intel compute-runtime 26.09, IGC 2.30.1, oneCCL 2021.15 - FSDP + vLLM rollout support for GRPO, PPO, and SFT algorithms - Runtime patches for vLLM XPU platform and Intel GPU device detection - Intel GPU-specific test scripts and environment configuration - Documentation for Docker build and getting started guide Validated on 2× Intel Arc Pro B60 (Battlemage): - GRPO: 41.6 tok/s (2-GPU), 172 tok/s (1-GPU) - PPO: 27.6 tok/s (2-GPU GAE with critic) - SFT: Multi-GPU FSDP training with checkpointing Co-authored-by: Claude <claude@anthropic.com> Signed-off-by: Kah Lun Teoh <kah.lun.teoh@intel.com>
…gnostic empty_cache
…nc_sglang_server, and vllm_async_server
….0 and bump torch version to 2.12.0+xpu
…located GRPO and standalone generation
…ne environment setup, and remove deprecated oneCCL workarounds
…ated environment scripts, and streamline memory reporting
…tel GPU Docker setup
…nd FSDP utilities
# Conflicts: # verl/workers/rollout/replica.py # verl/workers/rollout/sglang_rollout/async_sglang_server.py # verl/workers/rollout/vllm_rollout/bucketed_weight_transfer.py
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 direct Intel GPU (Pytorch xpu variant) support to verl core for end-to-end GRPO, PPO, and SFT training using FSDP/FSDP2 + vLLM rollout (colocated mode).
Validated on: Intel Arc Pro B70 (Battlemage, 2×24 GB):
Validation (2× Arc Pro B70)
*2-GPU throughput with same 16-prompt batch (not scaled up); full throughput benefit requires larger batch size.
Model: Qwen2.5-0.5B-Instruct, dataset: GSM8K, 16 prompts/batch.
Changes
Distributed (
verl/utils/distributed.py):"cpu:gloo,xpu:xccl"for Intel GPU process group initall_reduce_avg(): SUM + divide workaround (oneCCL doesn't supportReduceOp.AVG)FSDP (
verl/utils/fsdp_utils.py):set_force_sum_reduction_for_comms(True)for FSDP2 on Intel GPURay resource mapping (
verl/single_controller/ray/base.py):"xpu"→ Ray resource"GPU"(Ray'sIntelGPUAcceleratorregisters XPU under the"GPU"key, same as CUDA)Engine registry (
verl/workers/engine/fsdp/transformer_impl.py):"xpu"to@EngineRegistry.register(device=[...])for language and value model enginesvLLM rollout (
verl/workers/rollout/vllm_rollout/vllm_async_server.py):uniexecutor for TP=1 on Intel GPU(avoids Level Zero multi-context OOM)ONEAPI_DEVICE_SELECTORbefore vLLM'sEngineCoresubprocess spawns (prevents oneDNN OpenCL init crash)vLLM patches (
verl/utils/vllm/intel_gpu_patches.py, new file):vllm.v1.worker.utils.request_memory)GPUWorker.determine_num_available_blocksRuntime env (
verl/trainer/constants_ppo.py):ZE_AFFINITY_MASKto Ray workers; explicitly dropONEAPI_DEVICE_SELECTORWorker (
verl/single_controller/base/worker.py):get_device_name()routingReplica (
verl/workers/rollout/replica.py):get_device_name()ininit_colocated/init_standalone(covers Intel GPU, CUDA, NPU generically)Docker + tests (new files):
docker/intel_gpu/Dockerfile.intel_gpu— reproducible build (oneAPI 2025.3, compute-runtime 26.09, torch 2.11.0+xpu, vLLM 0.17.1)docker/intel_gpu/README.md— setup guiderequirements-intel-gpu.txt— intel GPU-specific pip depstests/special_intel_gpu/run_grpo_intel_gpu.sh— e2e GRPO (1-GPU and 2-GPU validated)tests/special_intel_gpu/run_ppo_intel_gpu.sh— e2e PPO smoke testtests/special_intel_gpu/run_sft__intel_gpu.sh— e2e SFT smoke testDocumentation (new files):
docs/intel_gpu_tutorial/intel_gpu_build_dockerfile_page.rst— Docker build guide, software stack table, host hardware check, full env var referencedocs/intel_gpu_tutorial/intel_gpu_quick_start.rst— environment check, feature support matrix with perf numbers, known limitations, GRPO/PPO/SFT examplesAll tests passing with Qwen2.5-0.5B-Instruct on GSM8K.
CI: Intel GPU hardware not available in GitHub Actions. Tests are in
tests/special_intel_gpu/for manual validation.Checklist Before Submitting
docs/intel_gpu_tutorial/with build guide and quick-start.tests/special_intel_gpu/covering GRPO (1-GPU, 2-GPU), PPO, SFT.