HUB
Sign inSign up

ocpub/oc9-sglang

By ocpub

•Updated 6 months ago

Image
0

272

ocpub/oc9-sglang repository overview

⁠SGLang on OpenCloudOS 9

⁠一、镜像信息

  • 镜像名:oc9-sglang:0.5.9
  • 基础镜像:opencloudos/opencloudos9-cuda-devel:12.8
  • Python 版本:3.11(基础镜像默认)
  • CUDA 版本:12.8
  • 核心组件:SGLang 0.5.9(含 [all] 扩展,包含 vLLM、flashinfer 等推理依赖)
  • 工作目录:/workspace
  • 上游项目:sgl-project/sglang⁠

⁠二、构建镜像

docker build -t oc9-sglang:0.5.9 .

⁠三、使用示例

⁠1. 验证 SGLang 安装
docker run --rm --gpus all oc9-sglang:0.5.9 \
    python3 -c "import sglang as sgl; print(sgl.__version__)"
⁠2. 启动推理服务

下载模型权重(以 Qwen2.5-7B-Instruct 为例):

sudo dnf install -y git-lfs
sudo git lfs install
sudo mkdir -p /models
sudo git clone https://www.modelscope.cn/Qwen/Qwen2.5-7B-Instruct.git \
    /models/Qwen2.5-7B-Instruct

启动 OpenAI 兼容服务:

docker run -itd --name sglang_serving --rm \
    --gpus all \
    --shm-size 16g \
    -p 30000:30000 \
    -v /models/Qwen2.5-7B-Instruct:/models/Qwen2.5-7B-Instruct \
    oc9-sglang:0.5.9 \
    python3 -m sglang.launch_server \
        --model-path /models/Qwen2.5-7B-Instruct \
        --host 0.0.0.0 \
        --port 30000
⁠3. 访问服务
curl http://localhost:30000/v1/chat/completions \
    -H 'Content-Type: application/json' \
    -d '{
        "model": "Qwen2.5-7B-Instruct",
        "messages": [{"role": "user", "content": "你好"}],
        "max_tokens": 128
    }'

⁠四、功能验证

bash ../test.sh oc9-sglang:0.5.9

⁠五、已知问题

  • SGLang 对 GPU 计算能力有要求(推荐 SM 8.0+,如 A100/H100/L40/RTX 30 系及以上)。低计算能力的 GPU 可能在加载 flashinfer/triton 内核时报错。
  • 首次启动模型时,flashinfer 会即时编译 CUDA 内核,启动时间较长,属正常现象。

Tag summary

Content type

Image

Digest

sha256:b39327b80…

Size

12.8 GB

Last updated

6 months ago

docker pull ocpub/oc9-sglang:0.5.9