From b2dd104aded683381aa81021b9059b2b2043f26f Mon Sep 17 00:00:00 2001 From: Polisetty V R K Jyothendra Varma Date: Wed, 11 Mar 2026 07:17:25 +0530 Subject: [PATCH] [Intel GPU] Upgrade pytorch xpu version to 2.10 (#20254) Signed-off-by: P V R K Jyothendra Varma --- docker/xpu.Dockerfile | 4 ++-- docs/platforms/xpu.md | 4 ++-- python/pyproject_xpu.toml | 21 +++++++++++++++------ 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/docker/xpu.Dockerfile b/docker/xpu.Dockerfile index 0fa726632..3f707c282 100644 --- a/docker/xpu.Dockerfile +++ b/docker/xpu.Dockerfile @@ -3,7 +3,7 @@ # Usage: docker build --build-arg UBUNTU_VERSION=24.04 --build-arg PYTHON_VERSION=3.10 -t sglang:xpu_kernel -f xpu.Dockerfile --no-cache . # Use Intel deep learning essentials base image with Ubuntu 24.04 -FROM intel/deep-learning-essentials:2025.2.2-0-devel-ubuntu24.04 +FROM intel/deep-learning-essentials:2025.3.2-0-devel-ubuntu24.04 # Avoid interactive prompts during package install ENV DEBIAN_FRONTEND=noninteractive @@ -48,7 +48,7 @@ RUN --mount=type=secret,id=github_token \ cd /home/sdp && \ . /home/sdp/miniforge3/bin/activate && \ conda activate py${PYTHON_VERSION} && \ - pip3 install torch==2.9.0+xpu torchao torchvision torchaudio pytorch-triton-xpu==3.5.0 --index-url https://download.pytorch.org/whl/xpu + pip3 install torch==2.10.0+xpu torchao torchvision torchaudio triton-xpu==3.6.0 --index-url https://download.pytorch.org/whl/xpu RUN --mount=type=secret,id=github_token \ cd /home/sdp && \ diff --git a/docs/platforms/xpu.md b/docs/platforms/xpu.md index 88fa1552c..259f3081c 100644 --- a/docs/platforms/xpu.md +++ b/docs/platforms/xpu.md @@ -30,7 +30,7 @@ conda create -n sgl-xpu python=3.12 -y conda activate sgl-xpu # Set PyTorch XPU as primary pip install channel to avoid installing the larger CUDA-enabled version and prevent potential runtime issues. -pip3 install torch==2.9.0+xpu torchao torchvision torchaudio pytorch-triton-xpu==3.5.0 --index-url https://download.pytorch.org/whl/xpu +pip3 install torch==2.10.0+xpu torchao torchvision torchaudio triton-xpu==3.6.0 --index-url https://download.pytorch.org/whl/xpu pip3 install xgrammar --no-deps # xgrammar will introduce CUDA-enabled triton which might conflict with XPU # Clone the SGLang code @@ -43,7 +43,7 @@ cd python cp pyproject_xpu.toml pyproject.toml # Install SGLang dependent libs, and build SGLang main package pip install --upgrade pip setuptools -pip install -v . +pip install -v . --extra-index-url https://download.pytorch.org/whl/xpu ``` ### Install Using Docker diff --git a/python/pyproject_xpu.toml b/python/pyproject_xpu.toml index 6c843b57d..e43514f79 100644 --- a/python/pyproject_xpu.toml +++ b/python/pyproject_xpu.toml @@ -15,10 +15,10 @@ classifiers = [ ] dependencies = [ - "torch==2.9.0", - "torchcodec==0.9.1 ; sys_platform != 'linux' or (sys_platform == 'linux' and platform_machine != 'aarch64' and platform_machine != 'arm64' and platform_machine != 'armv7l')", # torchcodec does not exist in those systems. torch==2.9.0 on XPU uses 0.9.1 + "torch==2.10.0+xpu", + "torchcodec==0.10.0 ; sys_platform != 'linux' or (sys_platform == 'linux' and platform_machine != 'aarch64' and platform_machine != 'arm64' and platform_machine != 'armv7l')", # torchcodec does not exist in those systems. torch==2.10.0 on XPU uses 0.10.0 "av ; sys_platform == 'linux' and (platform_machine == 'aarch64' or platform_machine == 'arm64' or platform_machine == 'armv7l')", - "torchaudio==2.9.0", + "torchaudio==2.10.0+xpu", "torchvision", "sgl-kernel @ git+https://github.com/sgl-project/sgl-kernel-xpu.git", "IPython", @@ -73,25 +73,32 @@ dependencies = [ [project.optional-dependencies] tracing = [ - "opentelemetry-sdk", "opentelemetry-api", "opentelemetry-exporter-otlp", "opentelemetry-exporter-otlp-proto-grpc", + "opentelemetry-sdk", ] test = [ "accelerate", + "bitsandbytes", "expecttest", "jsonlines", + "lm-eval[api]>=0.4.9.2", "matplotlib", "pandas", + "parameterized", "peft", "pytest", "sentence_transformers", "tabulate", ] -all = [] + dev = ["sglang[test]"] +all = [ + "sglang[tracing]", +] + [project.urls] "Homepage" = "https://github.com/sgl-project/sglang" "Bug Tracker" = "https://github.com/sgl-project/sglang/issues" @@ -130,4 +137,6 @@ exclude = [ [tool.setuptools_scm] root = ".." version_file = "sglang/_version.py" -git_describe_command = ["git", "describe", "--tags", "--long", "--match", "v*"] +git_describe_command = ["bash", "-c", "git tag --list --sort=-version:refname 'v*.*.*' | head -1 | xargs git describe --tags --long"] +# Allow editable installs even when .git metadata is not available. +fallback_version = "0.0.0.dev0"