inference-xpu-pytorch 25.03
本文介绍inference-xpu-pytorch 25.03版本发布记录。
Main Features and Bug Fix Lists
Main Features
基础镜像升级PPU SDK至v1.4.3-hotfix。
vLLM版本升级至v0.7.3,提升DeepSeek-V3/R1推理性能。
SGLang版本升级至v0.4.3。
ACCL-P升级至v1.4.3-8、EIC升级至1.3.7.1-v2503,合入对应版本功能和Bug fix。
Bug Fix
(暂无)
Contents
inference-xpu-pytorch | inference-xpu-pytorch | |
镜像Tag | 25.03-v1.4.3-hotfix-vllm0.7.3-torch2.5-cu123-20250331 | 25.03-v1.4.3-hotfix-sglang0.4.3-torch2.5-cu123-20250331 |
应用场景 | 大模型推理 | 大模型推理 |
框架 | pytorch | pytorch |
Requirements | PPU SDK V1.4.3-hotfix | PPU SDK V1.4.3-hotfix |
系统组件 |
|
|
镜像Asset
通过公网拉取ACS AI容器镜像需要先获取鉴权密钥。建议您使用VPC方式加速拉取AI容器镜像,减少镜像拉取的时间。
公网镜像
egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/inference-xpu-pytorch:25.03-v1.4.3-hotfix-vllm0.7.3-torch2.5-cu123-20250331
egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/inference-xpu-pytorch:25.03-v1.4.3-hotfix-sglang0.4.3-torch2.5-cu123-20250331
VPC镜像
acs-registry-vpc.{region-id}.cr.aliyuncs.com/egslingjun/{image:tag}
{region-id}为您使用的ACS产品所在的开服地域,比如:cn-beijing、cn-wulanchabu等。{image:tag}为实际镜像的名称和Tag。
Quick Start
以下示例内容仅通过Docker方式拉取inference-xpu-pytorch镜像,并使用Qwen2.5-7B-Instruct模型测试推理服务。
在ACS中使用inference-xpu-pytorch镜像需要通过控制台创建工作负载界面的制品中心页面选取,或者通过YAML文件指定镜像引用。
在ACS环境下使用xpu大模型推理镜像的使用指导,请参见ACS集群形态的LLM大模型推理镜像使用指导。
在ACS环境下部署DeepSeek推理服务的使用指导,请参见使用ACS快速部署运行在PG1上的DeepSeek V3/R1推理服务。
拉取推理容器镜像。
说明通过公网拉取ACS AI容器镜像需要先获取鉴权密钥。建议您使用VPC方式加速拉取AI容器镜像,减少镜像拉取的时间。
docker pull egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/inference-xpu-pytorch:[tag]下载modelscope格式的开源模型。
pip install modelscope cd /mnt modelscope download --model Qwen/Qwen2.5-7B-Instruct --local_dir ./Qwen2.5-7B-Instruct启动以下命令进入容器。
docker run -d -t --network=host --privileged --init --ipc=host \ --ulimit memlock=-1 --ulimit stack=67108864 \ -v /mnt/:/mnt/ \ egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/inference-xpu-pytorch:[tag]执行推理测试,测试vLLM推理对话功能。
启动Sever服务。
python3 -m vllm.entrypoints.openai.api_server \ --model /mnt/Qwen2.5-7B-Instruct \ --trust-remote-code --disable-custom-all-reduce \ --tensor-parallel-size 1在Client端进行测试。
curl http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "/mnt/Qwen2.5-7B-Instruct", "messages": [ {"role": "system", "content": "你是个友善的AI助手。"}, {"role": "user", "content": "介绍一下深度学习。"} ]}'输出如下所示:

更多关于vLLM的使用方法请参见vLLM。
Known Issues
DeepSeek问题
测试DeepSeek模型
--max-model-len设置需要 < 80k,否则可能会在运行中出现OOM。SGLang不支持跑INT8量化模型。
vllm 0.7.3需要设置
--max-num-batched-tokens参数,避免被框架默认2048参数限制,参考开源社区[Usage]:Input prompt (2501 tokens) is too long and exceeds limit of 2048 #13370。
性能问题
MOE类大模型使用Autotune工具可以提升性能 ,vLLM支持通过硬件相关的fused_moe kernel配置文件启动kernel以提升性能的优化功能。
量化问题
vLLM默认使用Marlin Kernel对GPTQ/AWQ/W8A8/WOQ进行量化推理加速,可以通过显式指定quantization的方法来使用vllm原本的Marlin/W8A8/awq/gptq等量化推理kernel,例如可以指定使用gptq_acext/awq_acext来做量化推理,但是acext目前不支持
act_order=True的量化,以及GPTQ-Int8量化权重,下个版本优化。vLLM使用vllm-flash-attn/xformers/flashinfer作为attention的后端,默认使用vllm-flash-attn性能尚未超过GPU版本,下个版本优化。
vLLM量化A8W8对接acext库实现,性能需要持续优化。
目前FP8量化下速度非常慢,还没有进行PPU适配与优化,支持计划待定。
稳定性问题
vLLM多卡推理时,可能会出现使用mp_distributed_executor错误的情况,需使用
VLLM_WORKER_MULTIPROC_METHOD=spawn避免该问题,参考开源社区[Bug]: When tensor_parallel_size>1, RuntimeError: Cannot re-initialize CUDA in forked subprocess. #6152。vLLM多卡推理结束后会随机出现进程退出错误的社区已知问题,参考开源社区[Bug]: When using tp for inference, an error occurs: Worker VllmWorkerProcess pid 3283517 died, exit code: -15. #6145。