Command Palette

Search for a command to run...

Назад к скиллам
скилл № 34369

sglang-xpu-run

Serve a Hugging Face safetensors model on an Intel GPU using SGLang's XPU backend with the OpenAI-compatible API. Pins the validated…

БесплатноЗапускает вложенные скрипты
intelот intel★ 54 звезды на GitHub

Установить sglang-xpu-run в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

sglang-xpu-run

SGLang's XPU backend is functional and ships as an official per-release image (Step 1 pins the validated tag). Verify GPU detection before serving: a container that sees no XPU dies at startup with a misleading No module named 'tvm_ffi' (Common errors).

Choose SGLang for RadixAttention prefix caching or grammar-constrained output — both verified here (#cached-token reuse observed; json_schema returns schema-valid JSON). For anything else prefer vllm-xpu-run, whose Intel model coverage is broader today.

Step 0 — discover GPUs and host RAM before anything else

Run xpu-discover first, or at minimum:

# GPU inventory
xpu-smi discovery

# Count cards and host RAM — used to size ZE_AFFINITY_MASK and --tp
GPU_COUNT=$(xpu-smi discovery 2>/dev/null | grep -cE "^\| +[0-9]|Device [0-9]+:")
[ "${GPU_COUNT:-0}" -gt 0 ] || GPU_COUNT=1
RAM_GB=$(awk '/MemTotal/{print int($2/1024/1024)}' /proc/meminfo)
RENDER_GID=$(getent group render 2>/dev/null | cut -d: -f3)
RENDER_GID=${RENDER_GID:-$(stat -c '%g' /dev/dri/renderD128 2>/dev/null)}
echo "GPUs: $GPU_COUNT  RAM: ${RAM_GB} GB  render GID: $RENDER_GID"

Use GPU_COUNT to set ZE_AFFINITY_MASK and --tp; use RENDER_GID in every docker run command below.

CUDA → XPU cheat sheet

CUDA Intel
lmsysorg/sglang:latest lmsysorg/sglang:v<version>-xpu — no latest-xpu exists; use the validated $PIN (Step 1)
--gpus all --device /dev/dri -v /dev/dri/by-path:/dev/dri/by-path --group-add <render-gid>
--device cuda (implicit) --device xpu + --attention-backend intel_xpu
--tp 2 --tp 2 + ZE_AFFINITY_MASK=0,1 + FI_TCP_IFACE=lo
--quantization awq / fp8 both work with caveats — see the quantization table
conda env + setvars.sh nothing to activate — see below

Step 1 — resolve the image tag, then pull

There is no latest-xpu tag — sgl-project ships one v<version>-xpu image per release. Serve $PIN, the tag this pack validated. The lookup below only reports a newer release; it does not switch to it automatically.

PIN=v0.5.23-xpu                 # the only tag validated end-to-end by this pack
IMG=lmsysorg/sglang:$PIN        # always serve the validated tag
docker image inspect "$IMG" >/dev/null 2>&1 || docker pull "$IMG"   # ~36 GB
echo "serving with $IMG"

# Informational only — report a newer release, never auto-adopt it.
NEW=$( { curl -fsS --max-time 10 \
    "https://hub.docker.com/v2/repositories/lmsysorg/sglang/tags?page_size=100&name=xpu" \
    | grep -oE '"name":space:*::space:*"v[0-9]+\.[0-9]+\.[0-9]+-xpu"' | cut -d'"' -f4; echo "$PIN"; } \
    | sort -V | tail -1 )
[ "$NEW" = "$PIN" ] || echo "NOTE: $NEW is newer and UNVALIDATED here — see below."

An unreachable registry prints no note. Everything below is validated at v0.5.23-xpu (on Arc Pro B70 cards). If the note fires, do not silently switch. To evaluate a newer tag: set IMG, check the UMD/kernel pairing first (xpu count: 0 under Common errors), then serve flags and the quant table, then re-run the verify block. Report the tag you served.

Nothing to wrap around the launch: /opt/venv is already on PATH (no conda env), oneAPI vars are baked in (do not source setvars.sh), the container is root with no entrypoint, and the Level Zero UMD is pinned and held (compute-runtime 26.27.39122.11, torch 2.14.0+xpu at this tag; a release can bump them). Details: references/image-and-troubleshooting.md.

Why each container flag

--device /dev/dri + /by-path mount (Intel has no --gpus; without the mount --tp 2 fails onecclCommInitRank … code 11). --group-add: needed once you add --user; --privileged is not. --network host: simplest (-p 30000:30000 also works). --shm-size/--ipc=host: used by every validated run, though text serving also worked without. Full rationale and the XPU pre-flight: references/image-and-troubleshooting.md.

Quickstart — serve one text-gen model

The container downloads weights itself into the mounted cache — do not install hf or hunt for a CLI, just launch.

Swap the model, keep the flags — except: Qwen3.5/hybrid dies at startup (use the model-recipes.md command), MLA/DeepSeek needs --page-size 128, gpt-oss --reasoning-parser gpt-oss, Qwen3/Qwen3.5 --reasoning-parser qwen3 (else thinking lands in content). Recipes there omit --disable-overlap-schedule; both work.

Launch (single GPU — for multi-GPU see below):

: "${RENDER_GID:?run Step 0 first}" "${IMG:?resolve the image first — see Step 1}"

# Keep the name literal (cleanup tooling matches it). If taken, stop here —
# never force-remove it (Common errors).
docker ps -a --format '{{.Names}}' | grep -qx sglang-xpu && {
    echo "sglang-xpu exists — reuse it, stop it if it is yours, or pick another literal name"; exit 1; }
# SGLang answers ANY model name, so a stranger's server on this port would pass
# the veri
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/image-and-troubleshooting.md
  • references/model-recipes.md
  • references/multi-gpu-tp.md
  • references/spec-decode-and-multimodal.md
  • scripts/tp_collective_probe.py

FAQ

Что делает скилл sglang-xpu-run?

Serve a Hugging Face safetensors model on an Intel GPU using SGLang's XPU backend with the OpenAI-compatible API. Pins the validated `lmsysorg/sglang:v<version>-xpu` release image and flags newer unvalidated releases, then covers the container flag set for Intel DRM devices, the UMD/kernel pairing the image pins, the `--device xpu --attention-backend intel_xpu` flag set, page-size and quantization constraints, multimodal serving, and how to validate output content (not just HTTP 200). Use when the user needs SGLang's RadixAttention prefix caching or grammar-constrained output; for broad-coverage serving on Intel today prefer vllm-xpu-run, and for benchmarking a running server use sglang-xpu-bench.

Как установить скилл sglang-xpu-run?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл sglang-xpu-run запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить sglang-xpu-run с