2026-01-09 04:36:39 +00:00
2025-08-11 22:21:29 +08:00
2025-12-26 07:37:35 +00:00
2026-01-09 04:36:39 +00:00
2026-01-09 04:36:39 +00:00
2025-12-26 07:37:35 +00:00
2025-02-05 10:53:12 +08:00
2026-01-05 11:31:07 +00:00
2026-01-05 11:31:07 +00:00
2025-01-29 02:44:13 -08:00
2026-01-09 04:36:39 +00:00

XC-LLM: A Specially Optimized LLM Inference Engine for ModelHub XC

Overview

The project is optimized based on the popular LLM inference project vLLM. The current version supports Ascend NPU (910B3 & 910B4).

One of the key features of this project is efficient memory coordination, enabling multiple vLLM instances share and dynamically hold Ascend NPU's physical memory. When an instance is idle, model parameters are offloaded to host memory. Upon a new inference request, the model parameters are quickly restored to the NPUs memory (if not exist), without the need to initialize the engine and load the model from scratch. As a result, from the applications perspective, multiple LLM inference engines can run on the NPU even when their total memory requirements exceed the physical memory limit. This technique is referred to as InfiniVRAM.

Installation

Build from Dockerfile

Clone this repository:

docker build -t vllm-ascend-multi-llm:latest -f ./Dockerfile .

Usage

Note

Some platforms may not allow multiple containers to share the same Ascend NPU. You may try to use privilegd container to bypass this restriction and mount all NPUs, and set the env ASCEND_RT_VISIBLE_DEVICES to specify the target device to use.

  1. To share NPU, processes coordinate via shm, so you need to set all containers with ipc=host.
  2. Start a daemon process in a standalone container, by running vllm_vnpu_daemon installed inside the image.
  3. Start LLM services with this image, following the official usage instructions.
  4. Due to the limited stream resource of Ascend NPU, you may need to restrict graph capture sizes or disable ACLgraph by setting --enforce-eager, especially when launching multiple LLMs. Refer to the link.

Limitations

  • Restricted by the fact that HCCL cannot be shared, deploying more than one model with multi-GPU (e.g., TP) is not feasible currently.
  • The prefix cache will be reset when the LLM is restored, since we just simply discard the KV cache when the LLM is offloaded.
Description
XC-LLM: A Specially Optimized LLM Inference Engine for ModelHub XC
Readme Apache-2.0 8.6 MiB
Languages
Python 66.8%
C++ 31.8%
Shell 1%
CMake 0.2%
Dockerfile 0.1%
Other 0.1%