[Kunlunxin]support DS R1/V3 w4a8int8 per-channel quantization#226
Merged
Conversation
yghstill
reviewed
Jan 23, 2026
| return None | ||
|
|
||
|
|
||
| class DeepSeekV3W4A8Int8Save(DeepSeekV3PTQSaveMulti): |
Collaborator
There was a problem hiding this comment.
Place it class in core/save.py
lishaoao
commented
Jan 23, 2026
| scale = abs_max / qmax | ||
| quantized = torch.round(tensor / scale) | ||
| quantized = torch.clamp(quantized, -qmax, qmax) | ||
| return quantized.to(torch.int8), scale.to(torch.float32) |
| return None | ||
|
|
||
|
|
||
| class DeepSeekV3W4A8Int8Save(DeepSeekV3PTQSaveMulti): |
| # Global configuration of pipeline | ||
| global: | ||
| save_path: ./output | ||
| deploy_backend: vllm |
Contributor
Author
There was a problem hiding this comment.
文件名改成configs/deepseek_r1/w4a8_int8/deepseek_r1_w4a8_int8_kunlun.yaml
yghstill
approved these changes
Jan 28, 2026
dawnranger
pushed a commit
to dawnranger/AngelSlim
that referenced
this pull request
Mar 11, 2026
…t#226) Co-authored-by: lishaohao <lsh862702688@163.com>
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.
What's Changed
w4a8i8to enable the w4a8int8 quantization method for DeepSeek R1/V3 models running on kunlunxin vllmW4A8INT8module, inherited from GPTQ, to support deepseek r1/v3 w4a8int8 quantization with minimal code intrusionW4A8Int8QuantLinearto support quantized weight packing and custom compressed tensors formatKey Details
W4A8INT8module inherits from GPTQ to minimize code modification, specifically adapted for deepseek r1/v3 w4a8int8 quantizationdeepseek_r1_w4a8_int8.yamlW4A8Int8QuantLinearcore functions: quantized weight packing + custom compressed tensors format supportTesting
Usage