Skip to main content

vLLM Ascend KV Compression

English | 简体中文

An independently packaged TriAttention KV-cache compression plugin for the upstream-aligned vLLM-HUST and vLLM-Ascend-HUST stacks. Version 0.4 adapts the current hosts and Extension Manager without changing either host repository.

Status: experimental release candidate. Package lifecycle, Ascend kernel smoke, service correctness, and three cold 16K engineering-control pairs pass. The full V4.6 official-baseline, model-matched calibration, quality, and stability matrix remains a release gate. See Validation.

Ownership and maintenance

  • School: Huazhong University of Science and Technology (HUST)
  • Group: CGCL
  • Advisor: Prof. Yao Wan (万瑶)
  • Project lead: Sichen Liu (刘思辰), @Seas0
  • Maintainers: Jiawan Zhang (张家万), @Jiawan23; Ruohao Wei (韦若皓), @kotoriqaq0; and @Seas0

The team agrees to maintain compatibility with vLLM-HUST and vLLM-Ascend-HUST and to publish this work through the vLLM-HUST Extension Manager. This is a CGCL-maintained plugin, not code built into either host.

Source and redistribution scope

The scoring method adapts TriAttention commit a4bc3c8f and the paper TriAttention: Efficient Long Reasoning with Trigonometric KV Compression. The Ascend paged-KV runtime was rewritten and does not copy the reference CUDA kernels.

Repository code and documentation are Apache-2.0. Model weights, datasets, raw logs, and calibration statistics are not included in the wheel or sdist. The development-only committed statistics have incomplete model/data provenance and must not be redistributed merely under this repository's license. See NOTICE, ownership and licensing, and calibration artifacts.

Compatibility

Component Supported line Validated snapshot
vLLM-HUST / vllm >=0.28.1.post1.dev0,<0.29 6cdc0304a8 (0.28.1.post1.dev260)
vLLM-Ascend-HUST / vllm-ascend >=0.25.1rc2.dev0,<0.26 5901bedbb7 (0.25.1rc2.dev232+hust.20260903.4.g5901bedbb)
Extension Manager >=0.2.0.dev0,<0.3 cf1ea71e3e
Python >=3.10,<3.15 3.11.16

The supported topology is one Ascend NPU, the v1 scheduler and NPUModelRunner, one full-attention KV group, block size 128, and dense BF16/FP16 K/V. Unsupported combinations fail during startup. The manifest uses the stable vllm.general_plugins discovery entry point; current hosts do not expose a frozen native KV-lifecycle API, so the narrow host range and contract tests intentionally guard the internal integration seams.

Install, enable, disable, and uninstall

Install the host stack first, then the released wheel:

python -m pip install 'vllm-ascend-kvcompress-hust[manager]==0.4.0'

Copy examples/triattention.json, set stats_path to model- and revision-matched statistics, then run:

vllm-hust-ext extension validate org.vllm-hust.ascend-kvcompress
vllm-hust-ext extension configure org.vllm-hust.ascend-kvcompress \
  --file /absolute/path/triattention.json
vllm-hust-ext extension enable org.vllm-hust.ascend-kvcompress
vllm-hust-ext extension status org.vllm-hust.ascend-kvcompress

export VLLM_PLUGINS=ascend,ascend_kvcompress
vllm-hust-ext run -- vllm serve /path/to/model \
  --block-size 128 --no-enable-prefix-caching --no-async-scheduling

If VLLM_PLUGINS is unset, vLLM discovers all installed plugins. The package remains inert unless the manager or direct enable flag activates it. Stop all host processes before changing state:

vllm-hust-ext extension disable org.vllm-hust.ascend-kvcompress
vllm-hust-ext extension forget org.vllm-hust.ascend-kvcompress
python -m pip uninstall vllm-ascend-kvcompress-hust

These operations only change the plugin package and manager state. Detailed source/environment instructions are in the installation guide, and the isolated wheel workflow is in packaging and release.

For development without Extension Manager:

export VLLM_PLUGINS=ascend,ascend_kvcompress
export VLLM_ASCEND_KVCOMPRESS_ENABLED=1
export VLLM_ASCEND_KVCOMPRESS_CONFIG=/absolute/path/triattention.json
vllm serve /path/to/model --block-size 128 --no-enable-prefix-caching

Unset both VLLM_ASCEND_KVCOMPRESS_* variables and restart to disable it.

Runtime and long-context optimization

After explicit activation, the adapter validates and hooks the current scheduler, KV-cache manager, concrete Ascend block table, and NPUModelRunner. Compression is committed only after a synchronous model step: semantic RoPE positions stay unchanged, physical attention/slot indices use a per-request offset, and old blocks are released at the next scheduler barrier.

Version 0.4 uses direct paged-K scoring, persistent workspaces, fused NPU normalization/head/layer aggregation, dynamic JIT lengths, layer-stride sampling, device-resident offsets, and a tuned 4096-token physical budget. The final 910B2 kernel benchmark measured 1.82x paged-copy, 2.81x direct-score, and 1.34x aggregate speedups against generic references; offset update was 0.83x and is not claimed as an improvement.

In three cold engineering-control pairs on Qwen2.5-14B, each with four fixed 16,384+1,024 requests at 0.4 RPS/concurrency 4, all 24 requests completed with the expected output length. Compression retained 32/128 blocks per request (75% physical KV reduction). Median total throughput was 1431.3 versus 1129.5 tok/s (+26.7%); mean TPOT was 39.16 versus 52.43 ms (-25.3%); mean E2E was 44.37 versus 57.81 s (-23.2%). This is engineering evidence against a same-host compatibility control, not the required official V4.6 B0 claim.

Conflict matrix

Feature 0.4 status Behavior
Prefix cache Conflict Rejected; must be disabled
Speculative decoding Conflict Rejected
KV transfer / disaggregated P/D Conflict Rejected
Quantized KV Conflict Rejected; dense BF16/FP16 only
Hybrid/MLA/sliding/local attention Conflict Rejected
Async scheduling Conflict Rejected
TP/PP/DP/DCP/PCP > 1 Conflict Rejected
BidKV or another scheduler Conflict Standard v1 scheduler required; active balance scheduling rejected
Removed Prefix Router, KV Tiering, KNorm, PyramidKV Ascend, SliceGPT Not integrated No imports or assumptions about former host code
Other general plugins Unverified Use an explicit allowlist and test the combination

Configuration and validation

The example uses a 4096-token budget, 1024-token recompute window, 512-token protected recent window, 8192-token scoring chunks, and every fourth scoring layer. Token counts must be positive multiples of block size 128.

VLLM_PLUGINS='' TORCH_DEVICE_BACKEND_AUTOLOAD=0 python -m pytest -q
python -m ruff check src tests scripts
python -m ruff format --check src tests scripts

An NPU release candidate must also pass numerical kernel smoke and the declared long-context quality/performance/HBM matrix on the exact host stack.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vllm_ascend_kvcompress_hust-0.4.0.tar.gz (417.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vllm_ascend_kvcompress_hust-0.4.0-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file vllm_ascend_kvcompress_hust-0.4.0.tar.gz.

File metadata

File hashes

Hashes for vllm_ascend_kvcompress_hust-0.4.0.tar.gz
Algorithm Hash digest
SHA256 fa3151b022073a70ab973be3c22de7f5388a25a5fdcf993a51259fb0cf5f5607
MD5 b48e86ffc21f2d100545a41367442cc1
BLAKE2b-256 2e502a11f245c4bbd9c551c590060759894650c2fccc96e4bbbd40e768b30f05

See more details on using hashes here.

File details

Details for the file vllm_ascend_kvcompress_hust-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vllm_ascend_kvcompress_hust-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33df57c7afec6015068f48c7482b1287f1e2413a68327c0733d5828795936663
MD5 71d8ab7245c38bc236c502ba179e10f6
BLAKE2b-256 7c76522f842e85beeec239ef8cfa84032f386209cfe9b31651cb60fd175465e7

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.0

2 files

0.5.0

2 files

This release

0.4.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page