目录
Sijie Fu

[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?

xlite backend in xlite/xlite_model_runner:XliteModelRunner keep a copy of NPUModelRunner‘s model for compatibility. In xlite full mode, xlite handles both the prefill stage and the decode stage. Before this PR, NPUModelRunner/aclgraph reserves peak memory during profile runs, which reduced available memory for KV caches and affected xlite perrformance.

With this PR, aclgraph model 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.

Signed-off-by: Sijie Fu fusijie@huawei.com Co-authored-by: LuLina lina.lulina@huawei.com

3个月前3955次提交

vllm-ascend

vLLM Ascend Plugin

| 关于昇腾 | 官方文档 | #sig-ascend | 用户论坛 | 社区例会 |

English | 中文


最新消息 🔥

  • [2026/05] 我们发布了新的正式版本 v0.18.0! 请按照官方指南开始在Ascend上部署vLLM Ascend Plugin。
  • [2026/02] 我们发布了新的正式版本 v0.13.0! 请按照官方指南开始在Ascend上部署vLLM Ascend Plugin。
更多内容

总览

vLLM 昇腾插件 (vllm-ascend) 是一个由社区维护的让vLLM在Ascend NPU无缝运行的后端插件。

此插件是 vLLM 社区中支持昇腾后端的推荐方式。它遵循[RFC]: Hardware pluggable所述原则:通过解耦的方式提供了vLLM对Ascend NPU的支持。

使用 vLLM 昇腾插件,可以让类Transformer、混合专家(MOE)、嵌入、多模态等流行的大语言模型在 Ascend NPU 上无缝运行。

支持的模型详细信息,请参考模型支持列表。

准备

  • 硬件:Atlas 800I A2 Inference系列、Atlas A2 Training系列、Atlas 800I A3 Inference系列、Atlas A3 Training系列、Atlas 300I Duo(实验性支持)
  • 操作系统:Linux
  • 软件:
    • Python >= 3.10, < 3.12
    • CANN == 9.0.0 (Ascend HDK 版本详见 版本说明)
    • PyTorch == 2.10.0, torch-npu == 2.10.0
    • vLLM (与vllm-ascend版本一致)

开始使用

推荐您使用以下版本快速开始使用:

Version Release type Doc
v0.22.1rc1 最新RC版本 请查看快速开始和安装指南了解更多
v0.18.0 最新正式/稳定版本 请查看快速开始和安装指南了解更多

分支策略

vllm-ascend有主干分支和开发分支。

  • main: 主干分支,与vLLM的主干分支对应,并通过昇腾CI持续进行质量看护。
  • releases/vX.Y.Z: 开发分支,随vLLM部分新版本发布而创建,比如releases/v0.13.0是vllm-ascend针对vLLM v0.13.0 版本的开发分支。

下面是维护中的分支:

分支 状态 备注
main Maintained 基于vLLM main分支和vLLM最新版本(v0.23.0)CI看护
v0.7.1-dev Unmaintained 不再维护
v0.7.3-dev Unmaintained 只允许Bug修复,不会再发布新版本
v0.9.1-dev Unmaintained 只允许Bug修复,不会再发布新版本
v0.11.0-dev Unmaintained 只允许Bug修复,不会再发布新版本
releases/v0.13.0 Maintained 基于vLLM v0.13.0版本CI看护
releases/v0.18.0 Maintained 基于vLLM v0.18.0版本CI看护
releases/v0.20.2rc Maintained 基于vLLM v0.20.2版本CI看护
rfc/feature-name Maintained 为协作创建的特性分支

请参阅版本策略了解更多详细信息。

贡献

请参考CONTRIBUTING文档了解更多关于开发环境搭建、功能测试以及 PR 提交规范的信息。

我们欢迎并重视任何形式的贡献与合作:

  • 请通过Issue来告知我们您遇到的任何Bug。
  • 请通过用户论坛来交流使用问题和寻求帮助。

社区例会

许可证

Apache 许可证 2.0,如 LICENSE 文件中所示。

关于
145.5 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号