You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Feature] Support NZ static buffers for prefetch offload (vllm-project#11945)
### What this PR does / why we need it?
This PR supports Ascend NZ-format static buffers for prefetch CPU
offload.
- Marks parameters whose quantized weights are transformed to
`ACL_FORMAT_FRACTAL_NZ` during `process_weights_after_loading`, after
`maybe_trans_nz` has run.
- Casts the corresponding prefetch `StaticBufferPool` buffers to
`ACL_FORMAT_FRACTAL_NZ` during `post_init`, so offloaded weights are
copied back into buffers with the expected Ascend storage format.
- Refactors the Ascend prefetch offloader to reuse upstream vLLM
`PrefetchOffloader` behavior while installing Ascend-specific module
offloaders and keeping CUDA stream/event aliases mapped to NPU APIs
after model runner initialization.
In my setup, this makes it possible to run prefill for GLM-5.1-W8A8 with
context `max-model-len 202752`, `max-num-batched-tokens 128`,
`block-size 128` and `gpu-memory-utilization 0.92` on a single-node
16-card a3, although it is still very slow. I use prefetch CPU offload
for selected MLP weights with:
```bash
--offload-backend prefetch
--offload-group-size 4
--offload-num-in-group 2
--offload-prefetch-step 2
--offload-params mlp
```
### Previous works
[vllm-project#10251](vllm-project#10251)
added the initial Ascend prefetch offloader by porting the upstream vLLM
implementation and replacing CUDA stream/event APIs with NPU
equivalents. However, that implementation still reused the normal-layout
`StaticBufferPool` flow and did not preserve Ascend NZ weight format for
static buffers.
This matters because vLLM Ascend has enabled NZ conversion for quantized
weights by default since
[vllm-project#4878](vllm-project#4878), included
from `v0.13.0rc1`: `VLLM_ASCEND_ENABLE_NZ=1` means quantized weights are
transformed to NZ by `maybe_trans_nz` during
`process_weights_after_loading`. When prefetch offload copies those NZ
weights through normal-layout static buffers, the offloaded weights may
be restored with the wrong layout. I tested the vllm-project#10251 behavior on
Ascend A3 and reproduced accuracy issues from this mismatch.
- vLLM version: v0.24.0
- vLLM main:
vllm-project/vllm@85c09e9
---------
Signed-off-by: KINGFIOX <me@kingfiox.work>
Co-authored-by: kurumi5210 <Jaychou1620@Gmail.com>
0 commit comments