Skip to content

feat: support Ascend W8A8-MXFP8 rollout#355

Open
cqq70605 wants to merge 7 commits into
vllm-project:mainfrom
cqq70605:rollout_support_mx
Open

feat: support Ascend W8A8-MXFP8 rollout#355
cqq70605 wants to merge 7 commits into
vllm-project:mainfrom
cqq70605:rollout_support_mx

Conversation

@cqq70605

Copy link
Copy Markdown

Summary

  • add lazy Ascend W8A8-MXFP8 online quantization utilities for Linear, packed Linear, and FusedMoE weights
  • integrate the worker lifecycle with both colocated IPC and decoupled NCCL rollout weight updates
  • add English and Chinese support guides, configuration examples, limitations, and Ascend 950 acceptance steps

MXFP4 and external vLLM servers are intentionally outside this change. The implementation targets local vllm-ascend/main at commit 8bedc666.

Testing

  • 101 passed, 1 warning across MXFP8, vLLM engine, IPC, and NCCL focused tests
  • Ruff checks passed
  • Python compileall passed
  • English and Chinese Sphinx builds passed
  • git diff --check passed

Real Ascend 950 hardware validation remains required; the documented acceptance procedure covers both IPC and NCCL modes.

@read-the-docs-community

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements online W8A8-MXFP8 rollout weight updates for Ascend 950 in both colocated IPC and decoupled NCCL deployments. It introduces a lazy-imported Ascend utility module and a vLLM worker extension (AscendMXFP8WorkerExtension) to handle on-demand quantization of BF16 weights using torch_npu.npu_dynamic_mx_quant and coordinate layout preparation and finalization. The Vime engine orchestration is updated to inject this extension and manage the update lifecycle. Comprehensive unit tests and bilingual documentation are also added. Feedback is provided regarding a potential shape mismatch bug in quantize_mxfp8_weights where flattening and squeezing the scale tensor can over-squeeze it when the number of groups is exactly 1; simplifying this to scale.squeeze(-1) is recommended.

axis=-1,
dst_type=torch_npu.float8_e4m3fn,
)
scale = scale.flatten(-2, -1).squeeze(-1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using scale.flatten(-2, -1).squeeze(-1) can lead to a shape mismatch bug when the number of groups along the quantized dimension is exactly 1 (i.e., N // 32 == 1 or M // 32 == 1).

In that case:

  1. scale starts with shape (..., 1, 1).
  2. scale.flatten(-2, -1) flattens the last two dimensions to (..., 1).
  3. scale.squeeze(-1) removes the remaining dimension of size 1, resulting in (...) (e.g., a 1D tensor instead of a 2D tensor).

This unexpected reduction in dimensionality will cause shape mismatches or errors during layout restoration or inference in vllm-ascend. Since npu_dynamic_mx_quant always appends a singleton dimension of size 1 at the end of the scale tensor, simply calling scale.squeeze(-1) is both safer and cleaner.

Suggested change
scale = scale.flatten(-2, -1).squeeze(-1)
scale = scale.squeeze(-1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant