[BugFix][xlite] Performance improvement in xlite full mode by avoiding redundant memory allocation during profiling runs (#11380)
What this PR does / why we need it?
xlitebackend inxlite/xlite_model_runner:XliteModelRunnerkeep a copy ofNPUModelRunner‘s model for compatibility. Inxlitefull mode,xlitehandles both the prefill stage and the decode stage. Before this PR,NPUModelRunner/aclgraphreserves peak memory during profile runs, which reduced available memory for KV caches and affected xlite perrformance.With this PR,
aclgraphmodel reserves less peak runtime memory in xlite full mode. More memory can be allocated to KV caches and the concurrency level is increased with some performance improvement. For example, using TP2DP1EP2 to serve Qwen3-30B-A3B with xlite full mode (max seq 64, max length 40960, batch tokens 8192):Before this PR:
(Worker_TP0_EP0 pid=18480) INFO 07-03 15:23:17 [xlite.py:592] xlite runtime pool size: 519 MB (Worker_TP0_EP0 pid=18480) INFO 07-03 15:23:35 [worker.py:564] Available KV cache memory: 25.53 GiB (EngineCore pid=18453) INFO 07-03 15:23:35 [kv_cache_utils.py:1744] GPU KV cache size: 557,696 tokens (EngineCore pid=18453) INFO 07-03 15:23:35 [kv_cache_utils.py:1745] Maximum concurrency for 40,960 tokens per request: 13.62x (Worker_TP0_EP0 pid=18480) INFO 07-03 15:23:37 [worker.py:790] Free memory on device (60.89/61.27 GiB) on startup. Desired GPU memory utilization is (0.95, 58.21 GiB). Actual usage: 28.48 GiB for weights, 0.64 GiB for peak activation, 3.56 GiB for non-torch memory, 0.0 GiB for NPU graph memory. Replace gpu_memory_utilization with
--kv-cache-memory=27260496384(25.39 GiB) to fit into requested memory, or--kv-cache-memory=30142716416(28.07 GiB) to fully utilize NPU free memory. Current KV cache memory: 25.53 GiB.With this PR:
(Worker_TP0_EP0 pid=19702) INFO 07-03 15:28:30 [xlite.py:603] xlite runtime pool size: 519 MB (Worker_TP0_EP0 pid=19702) INFO 07-03 15:28:34 [worker.py:564] Available KV cache memory: 28.67 GiB (EngineCore pid=19675) INFO 07-03 15:28:35 [kv_cache_utils.py:1744] GPU KV cache size: 626,176 tokens (EngineCore pid=19675) INFO 07-03 15:28:35 [kv_cache_utils.py:1745] Maximum concurrency for 40,960 tokens per request: 15.29x (Worker_TP0_EP0 pid=19702) INFO 07-03 15:28:37 [worker.py:790] Free memory on device (60.89/61.27 GiB) on startup. Desired GPU memory utilization is (0.95, 58.21 GiB). Actual usage: 28.48 GiB for weights, 0.05 GiB for peak activation, 1.02 GiB for non-torch memory, 0.0 GiB for NPU graph memory. Replace gpu_memory_utilization with
--kv-cache-memory=30625051136(28.52 GiB) to fit into requested memory, or--kv-cache-memory=33509896704(31.21 GiB) to fully utilize NPU free memory. Current KV cache memory: 28.67 GiB.
- vLLM version: v0.23.0
- vLLM main: https://github.com/vllm-project/vllm/commit/ee0da84ab9e04ac7610e28580af62c365e898389
Signed-off-by: Sijie Fu fusijie@huawei.com Co-authored-by: LuLina lina.lulina@huawei.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
vLLM Ascend Plugin
| 关于昇腾 | 官方文档 | #sig-ascend | 用户论坛 | 社区例会 |
English | 中文
最新消息 🔥
更多内容
总览
vLLM 昇腾插件 (
vllm-ascend) 是一个由社区维护的让vLLM在Ascend NPU无缝运行的后端插件。此插件是 vLLM 社区中支持昇腾后端的推荐方式。它遵循[RFC]: Hardware pluggable所述原则:通过解耦的方式提供了vLLM对Ascend NPU的支持。
使用 vLLM 昇腾插件,可以让类Transformer、混合专家(MOE)、嵌入、多模态等流行的大语言模型在 Ascend NPU 上无缝运行。
支持的模型详细信息,请参考模型支持列表。
准备
开始使用
推荐您使用以下版本快速开始使用:
分支策略
vllm-ascend有主干分支和开发分支。
releases/v0.13.0是vllm-ascend针对vLLMv0.13.0版本的开发分支。下面是维护中的分支:
请参阅版本策略了解更多详细信息。
贡献
请参考CONTRIBUTING文档了解更多关于开发环境搭建、功能测试以及 PR 提交规范的信息。
我们欢迎并重视任何形式的贡献与合作:
社区例会
许可证
Apache 许可证 2.0,如 LICENSE 文件中所示。