本目录提供的是本次 patch 交付物:
其中:
Ling-2.6-flash-sglang-v4.0.patch 本补丁面向灵镜昇腾统一容器镜像 V4.0 + SGLang 0.5.11,将 Ling-2.6-flash适配到 Ascend,覆盖三类修复:解码正确性、基线启动适配、MTP/NextN 投机解码使能。
Ling-2.6-flash-sglang-v0.5.13.patch 本补丁面向 SGLang v0.5.13.post1-cann9.0.0 镜像,将 Ling-2.6-flash适配到 Ascend,修复 MLA 解码 w_vc非连续导致 npu.batch_matmul_transpose 静默出错、长链解码退化的问题。
基础镜像:
docker pull swr.cn-north-4.myhuaweicloud.com/ascend-sact/ascend-a3-ubuntu:v4.0docker pull swr.cn-north-4.myhuaweicloud.com/ascend-sact/ascend-a2-ubuntu:v4.0准备变量
PATCH_DIR=/path/to/patches
MODEL_ROOT=/models
#下载权重参考:https://www.modelscope.cn/models/inclusionAI/Ling-2.6-flash应用补丁:
conda activate ascend-infer
cd /opt/mamba/envs/ascend-infer/lib/python3.13/site-packages
git apply --check "$PATCH_DIR"/Ling-2.6-flash-sglang-v4.0.patch
git apply "$PATCH_DIR"/Ling-2.6-flash-sglang-v4.0.patch基础镜像
docker pull quay.io/ascend/sglang:v0.5.13.post1-cann9.0.0-a3docker pull quay.io/ascend/sglang:v0.5.13.post1-cann9.0.0-910b准备变量
PATCH_DIR=/path/to/patches
MODEL_ROOT=/models
#下载权重参考:https://www.modelscope.cn/models/inclusionAI/Ling-2.6-flash应用补丁:
cd /sgl-workspace/sglang
git apply --check "$PATCH_DIR"/Ling-2.6-flash-sglang-v0.5.13.patch
git apply "$PATCH_DIR"/Ling-2.6-flash-sglang-v0.5.13.patch
cd /workspace
export ASCEND_RT_VISIBLE_DEVICES=0,1,2,3
export HCCL_OP_EXPANSION_MODE=AIV
exec python3 -m sglang.launch_server \
--model-path "$MODEL_ROOT"/Ling-2.6-flash \
--served-model-name Ling-2.6-flash \
--tp-size 4 \
--model-impl sglang --trust-remote-code \
--disable-radix-cache \
--device npu --attention-backend ascend --sampling-backend ascend \
--tool-call-parser qwen \
--mem-fraction-static 0.9 \
--context-length 32768 \
--max-running-requests 8 \
--port 8000cd /workspace
export ASCEND_RT_VISIBLE_DEVICES=0,1,2,3
export HCCL_OP_EXPANSION_MODE=AIV
exec python -m sglang.launch_server \
--model-path "$MODEL_ROOT"/Ling-2.6-flash \
--served-model-name Ling-2.6-flash \
--tp-size 4 \
--model-impl sglang --trust-remote-code \
--device npu --attention-backend ascend --sampling-backend ascend \
--disable-radix-cache \
--tool-call-parser qwen \
--mem-fraction-static 0.85 \
--context-length 32768 \
--max-running-requests 8 \
--speculative-algorithm NEXTN \
--speculative-num-steps 1 \
--speculative-eagle-topk 1 \
--speculative-num-draft-tokens 2 \
--port 8000备注:针对补丁版本二中的镜像,启动服务时需要额外添加 export PATH="/usr/local/python3.11.15/bin:$PATH" 或者用 /usr/local/python3.11.15/bin/python3 -m sglang.launch_server来启动。
curl -s http://127.0.0.1:8000/v1/models -o /dev/null -w "HTTP %{http_code}\n" # 期望 200curl -s http://127.0.0.1:8000/v1/chat/completions -H 'Content-Type: application/json' \
-d '{"model":"Ling-2.6-flash","messages":[{"role":"user","content":"What is the capital of France?"}],"max_tokens":32,"temperature":0}'期望:HTTP 200,内容非空且连贯(返回 "Paris")。
# 40 位周期-10 复制:应原样复现 3 0 7 4 1 8 5 2 9 6 ×4,不得退化为循环/乱码
curl -s http://127.0.0.1:8000/v1/chat/completions -H 'Content-Type: application/json' \
-d '{"model":"Ling-2.6-flash","messages":[{"role":"user","content":"Repeat the following sequence of digits exactly, separated by single spaces, and output nothing else:\n3 0 7 4 1 8 5 2 9 6 3 0 7 4 1 8 5 2 9 6 3 0 7 4 1 8 5 2 9 6 3 0 7 4 1 8 5 2 9 6"}],"temperature":0,"max_tokens":200}'curl -s http://127.0.0.1:8000/v1/chat/completions -H 'Content-Type: application/json' \
-d '{"model":"Ling-2.6-flash","messages":[{"role":"user","content":"What is the weather in Beijing?"}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get weather","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}],"temperature":0}'期望:返回结构化 tool_calls,JSON 参数合法,finish_reason=tool_calls;无工具请求不误触发。
swr.cn-north-4.myhuaweicloud.com/ascend-sact/ascend-a2-ubuntu:v4.0镜像时需要先通过conda activate ascend-infer进入sglang环境下。--tool-call-parser qwen。