LM/SGLang: Difference between revisions

From Fundamental Ramen
< LM
Jump to navigation Jump to search
Tag: Manual revert
 
(25 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Engine works fine, but most models cannot loaded in xpu mode.'''
= Rebuild docker image from source =
= Rebuild docker image from source =


Line 27: Line 29:
</syntaxhighlight>
</syntaxhighlight>


In container ...
<ref>
 
{{ref web
<syntaxhighlight lang="bash">
  |url=https://hub.docker.com/r/lmsysorg/sglang/tags?name=xpu
sglang serve --help
  |title=Official SGLang docker image
 
  |site=hub.docker.com
sglang serve                        \
}}
    --hf unsloth/gemma-4-E4B-it-qat-GGUF  \
</ref>
    --trust-remote-code              \
<ref>
    --disable-overlap-schedule      \
{{ref web
    --device xpu                    \
  |url=https://hub.docker.com/r/intel/sglang-dev
    --host 0.0.0.0                  \
  |title=Intel patched SGLang docker image
    --tp 1                          \   # using multi GPUs
  |site=hub.docker.com
    --attention-backend intel_xpu    \   # using intel optimized XPU attention backend
}}
    --page-size                      \   # intel_xpu attention backend supports [32, 64, 128]
</ref>
</syntaxhighlight>
<ref>
{{ref web
  |url=https://docs.sglang.io/docs/hardware-platforms/xpu#xpu
  |title=Hardware Platforms XPU
  |site=docs.sglang.io
}}
</ref>
<ref>
{{ref web
  |url=https://docs.sglang.io/docs/advanced_features/server_arguments#server-arguments
  |title=SGLang server arguments
  |site=docs.sglang.io
}}
</ref>
<ref>
{{ref web
   |url=https://docs.sglang.io/cookbook/autoregressive/Qwen/Qwen3#3-1-basic-configuration
   |title=SGLang cookbook for Qwen3 + BMG
   |site=docs.sglang.io
}}
</ref>


= Structure =
= Structure =
Line 105: Line 127:
</quickmmd>
</quickmmd>


= TODO =
== References ==


* https://docs.sglang.io/docs/hardware-platforms/xpu#xpu
<div style="column-count: 2; column-gap: 2em;">
* https://hub.docker.com/r/intel/sglang-dev
<references/>
* https://docs.pytorch.org/docs/2.13/notes/get_start_xpu.html#
</div>

Latest revision as of 01:56, 11 November 2026

Engine works fine, but most models cannot loaded in xpu mode.

Rebuild docker image from source

cd sglang
git pull
cd docker
docker build -t sglang-xpu:latest -f xpu.Dockerfile .

Run

docker run \
    -it \
    --privileged \
    --ipc=host \
    --network=host \
    --user root \
    --group-add $(getent group video | cut -d: -f3) \
    --device /dev/dri \
    -v /dev/dri/by-path:/dev/dri/by-path \
    -v /dev/shm:/dev/shm \
    -v ~/.cache/huggingface:/root/.cache/huggingface \
    -p 30000:30000 \
    -e "HF_TOKEN=$HF_TOKEN" \
    sglang-xpu:latest /bin/bash

[1] [2] [3] [4] [5]

Structure

References