llm-inference-xpu 24.12
本文介绍llm-inference-xpu 24.12版本发布记录。
Main Features and Bug Fix Lists
Main Features
基础镜像升级PPU SDK至1.4.0 hotfix2。
升级vLLM至v0.6.3.post1版本。
Bug Fix
无
镜像Asset
通过公网拉取ACS AI容器镜像需要先获取鉴权密钥。建议您使用VPC方式加速拉取AI容器镜像,减少镜像拉取的时间。
公网镜像
egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/llm-inference-xpu:1.4.0-hotfix2-vllm0.6.3.post1-torch2.4-cuda12.3-ubuntu22.04-202412
VPC镜像
acs-registry-vpc.{region-id}.cr.aliyuncs.com/egslingjun/{image:tag}
{region-id}为您使用的ACS产品所在的开服地域,比如:cn-beijing、cn-wulanchabu等。{image:tag}为实际镜像的名称和Tag。
镜像组件列表
24.12版本 | llm-inference-xpu |
应用场景 | 大模型推理 |
框架 | pytorch |
Requirements | PPU SDK v1.4.0 |
系统组件 |
|
Quick Start
示例内容以qwen2.5 7b模型为例。
拉取容器
docker pull egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/llm-inference-xpu:[tag]下载模型
下载modelscope格式的开源模型。
pip install modelscope cd /mnt modelscope download --model Qwen/Qwen2.5-7B-Instruct --local_dir ./Qwen2.5-7B-Instruct启动并进入容器
docker run --rm -it --gpus all --privileged --ipc=host \ --ulimit memlock=-1 --ulimit stack=67108864 \ -v /mnt/:/mnt/ \ egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/llm-inference-xpu:[tag]执行推理测试
测试vLLM推理对话功能。
启动Sever服务
python3 -m vllm.entrypoints.openai.api_server \ --model /mnt/Qwen2.5-7B-Instruct \ --trust-remote-code \ --tensor-parallel-size 1Client端测试
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。
在ACS环境下使用xpu大模型推理镜像的使用指导请参见ACS集群形态的LLM大模型推理镜像使用指导。
Known Issues
MOE Autotune提升性能, 对于MOE类大模型,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量化Marlin Kernel实现和硬件强相关且为A100设计,PPU上移植后性能尚未超过GPU版本,下个版本优化。
VLLM使用vllm-flash-attn/xformers/flashinfer作为attention的后端,默认使用vllm-flash-attn 性能尚未超过GPU版本,下个版本优化。
VLLM量化A8W8对接acext库实现,性能需要持续优化。
目前FP8量化下速度非常慢,还没有进行PPU适配与优化,支持计划待定。
稳定性问题
VLLM 多卡推理结束后会随机出现进程退出错误的社区已知问题,详见开源社区的https://github.com/vllm-project/vllm/issues/6145。