[Ascend]quantization: w4a4, compressed tensors, NZ for non-quantized MOE, Qwen3 MOE double memory consumption fix#11984
Closed
OrangeRedeng wants to merge 56 commits intosgl-project:mainfrom
Closed
[Ascend]quantization: w4a4, compressed tensors, NZ for non-quantized MOE, Qwen3 MOE double memory consumption fix#11984OrangeRedeng wants to merge 56 commits intosgl-project:mainfrom
OrangeRedeng wants to merge 56 commits intosgl-project:mainfrom
Conversation
Contributor
|
Compressed-tensors w8a8 support. Model: Model: |
…cend_memory_consumption.py
This was referenced Dec 4, 2025
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Motivation
The latest version of CANN and Torch-NPU added support for int4 matmul-s and quantization, switching to lower bit quantization will reduce memory consumption by up to 2-x times compared to int8
Adding weight conversion from ND to FRACTAL_NZ speeds up the GroupedMatmul kernel
Modifications
Accuracy Tests
W4A4:
Tested on quantized by experimental msmodelslim QWEN3-8B
ASCEND_RT_VISIBLE_DEVICES=4 STREAMS_PER_DEVICE=32 HCCL_OP_EXPANSION_MODE="AIV" AUTO_USE_UC_MEMORY=0 P2P_HCCL_BUFFSIZE=20 python -m sglang.launch_server --cuda-graph-bs 32 64 256 512 --device npu --attention-backend ascend --trust-remote-code --tp-size 1 --model-path ./msit_Qwen8B_mixed_w4a4_w8a8 --port 30088 --quantization w4a4_int4NZ:
Benchmarking and Profiling
W4A4:
python -m sglang.bench_serving --backend sglang --random-range-ratio 1.0 --dataset-path ./ShareGPT_V3_unfiltered_cleaned_split.json --dataset-name random --num-prompts 64 --max-concurrency 64 --random-input-len 2048 --random-output-len 2048 --host 127.0.0.1 --port 30088 --flush-cacheNZ:
NZ vs ND acceleration, x

Acceleration from 1% to 12% in benchmark
Checklist