Environment:Deepspeedai DeepSpeed XPU Environment
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Deep_Learning, XPU_Computing |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
Intel XPU (GPU) compute environment for DeepSpeed's SYCL-based optimizer kernels and XPU-specific operations.
Description
This environment provides the Intel XPU compute context required by DeepSpeed's XPU-specific implementations, including SYCL-based optimizer kernels (Adam, Adagrad), multi-tensor apply operations, and XPU bit-packing utilities. The XPU environment requires Intel GPU hardware with the Intel oneAPI toolkit and either Intel Extension for PyTorch (IPEX) or PyTorch >= 2.8 with native XPU support. The SYCL compiler (`icpx`) is used for compiling XPU kernels.
DeepSpeed auto-detects XPU devices through IPEX or native PyTorch XPU support. The detection can be forced via `DS_ACCELERATOR=xpu`.
Usage
Use this environment when training or running inference on Intel GPU hardware (Data Center GPU Max series, Arc series). Required for any DeepSpeed operations that utilize SYCL kernels or XPU-specific optimizer implementations.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux | Primary platform for XPU support |
| Hardware | Intel GPU (Data Center GPU Max, Arc) | Xe architecture or newer |
| Toolkit | Intel oneAPI Base Toolkit | Includes SYCL compiler (icpx/dpcpp) and oneMKL |
| Driver | Intel GPU driver | Kernel-mode driver for Intel discrete GPUs |
| Compiler | icpx (Intel C++ Compiler) | SYCL compiler for XPU kernel compilation |
Dependencies
System Packages
- Intel oneAPI Base Toolkit (includes icpx, oneMKL, Level Zero)
- Intel GPU driver
Python Packages
- `torch` (with XPU support, >= 2.8 for native support)
- `intel_extension_for_pytorch` (IPEX) - for PyTorch < 2.8
- `deepspeed`
Optional Packages
- `intel_extension_for_deepspeed` - for external XPU path
- `oneccl_bind_pt` - for distributed XPU training
Credentials
The following environment variables affect XPU operations:
- `DS_ACCELERATOR=xpu`: Force XPU accelerator backend
- `ZE_AFFINITY_MASK`: Control which Intel GPU devices are visible
- `ONEAPI_ROOT`: Intel oneAPI installation path
Quick Install
# Source Intel oneAPI environment
source /opt/intel/oneapi/setvars.sh
# Install PyTorch with XPU support
pip install torch --index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
# Install IPEX (for PyTorch < 2.8)
pip install intel_extension_for_pytorch
# Install DeepSpeed
pip install deepspeed
# Verify XPU support
ds_report
Code Evidence
XPU accelerator detection from `accelerator/real_accelerator.py`:
# IPEX XPU detection
try:
import intel_extension_for_pytorch as ipex
if hasattr(ipex, 'xpu') and ipex.xpu.device_count() > 0:
accelerator_name = "xpu"
except ImportError:
pass
# Native PyTorch XPU detection (>= 2.8)
if hasattr(torch, 'xpu') and torch.xpu.device_count() > 0:
accelerator_name = "xpu"
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `No XPU devices found` | Intel GPU not detected | Install Intel GPU driver; check `xpu-smi` |
| `IPEX not found` | intel_extension_for_pytorch not installed | `pip install intel_extension_for_pytorch` |
| `icpx compiler not found` | oneAPI toolkit not sourced | Run `source /opt/intel/oneapi/setvars.sh` |
| `SYCL kernel compilation failed` | Incompatible compiler version | Ensure oneAPI toolkit version matches IPEX version |