modelscope / modelscope/ms-swift

qwen3-235b-a22b模型gptq-int8量化后出现中英文混杂

Open
#7,072 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
15.7k
Forks
1.7k
Avg merge
1d 16h
Merged PRs (30d)
136

Description

Describe the bug
What the bug is, and how to reproduce, better with screenshots(描述bug以及复现过程,最好有截图)

感谢swift框架,训练起来确实比deepspeed快了很多!sft微调模型后,在gptq-int8量化时,遇到了三个问题,还请帮忙解答一下。
1.部署时需要8*A800(80G),但int8量化应该只用4张卡就可以?
2.sglang 只能用v0.5.0才能部署,其他版本(0.4.6,0.5.2,0.5.3,0.5.5)都会报错[2025-12-15 15:22:27] loaded_weight = loaded_weight.narrow(
[2025-12-15 15:22:27] ^^^^^^^^^^^^^^^^^^^^^
[2025-12-15 15:22:27] IndexError: start out of range (expected to be in range of [-12, 12], but got 60)
3.sglang部署后,推理case出现高频中英文混杂问题(约10%)

量化命令:
OMP_NUM_THREADS=14
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
swift export
--model /Qwen3-235B-A22B-Instruct-2507/v0-20251118-hf
--dataset 'xxxx.jsonl'
--quant_n_samples 1024
--quant_batch_size 1
--max_length 16384
--quant_method gptq
--quant_bits 8
--output_dir /Qwen3-235B-A22B-Instruct-2507/v0-20251118-hf-GPTQ-INT8
--model_type qwen3_moe
--device_map cpu

部署命令:
python -m sglang.launch_server --model-path /Qwen3-235B-A22B-Instruct-2507/v0-20251118-hf-GPTQ-INT8 --quantization gptq_marlin --host 0.0.0.0 --port 8000 --mem-fraction-static 0.85 --enable-metrics --context-length 32768 --tp8 --enable-p2p-check

sglang部署报错信息:
[2025-12-15 15:22:27] File "/sgl-workspace/sglang/python/sglang/srt/model_loader/init.py", line 28, in get_model
[2025-12-15 15:22:27] return loader.load_model(
[2025-12-15 15:22:27] ^^^^^^^^^^^^^^^^^^
[2025-12-15 15:22:27] File "/sgl-workspace/sglang/python/sglang/srt/model_loader/loader.py", line 482, in load_model
[2025-12-15 15:22:27] self.load_weights_and_postprocess(
[2025-12-15 15:22:27] File "/sgl-workspace/sglang/python/sglang/srt/model_loader/loader.py", line 490, in load_weights_and_postprocess
[2025-12-15 15:22:27] model.load_weights(weights)
[2025-12-15 15:22:27] File "/sgl-workspace/sglang/python/sglang/srt/models/qwen3_moe.py", line 850, in load_weights
[2025-12-15 15:22:27] weight_loader(
[2025-12-15 15:22:27] File "/sgl-workspace/sglang/python/sglang/srt/layers/moe/fused_moe_triton/layer.py", line 528, in weight_loader
[2025-12-15 15:22:27] self._weight_loader_physical(
[2025-12-15 15:22:27] File "/sgl-workspace/sglang/python/sglang/srt/layers/moe/fused_moe_triton/layer.py", line 548, in _weight_loader_physical
[2025-12-15 15:22:27] self._weight_loader_impl(
[2025-12-15 15:22:27] File "/sgl-workspace/sglang/python/sglang/srt/layers/moe/fused_moe_triton/layer.py", line 697, in _weight_loader_impl
[2025-12-15 15:22:27] self._load_model_weight_or_group_weight_scale(
[2025-12-15 15:22:27] File "/sgl-workspace/sglang/python/sglang/srt/layers/moe/fused_moe_triton/layer.py", line 281, in _load_model_weight_or_group_weight_scale
[2025-12-15 15:22:27] self._load_w2(
[2025-12-15 15:22:27] File "/sgl-workspace/sglang/python/sglang/srt/layers/moe/fused_moe_triton/layer.py", line 439, in _load_w2
[2025-12-15 15:22:27] loaded_weight = loaded_weight.narrow(
[2025-12-15 15:22:27] ^^^^^^^^^^^^^^^^^^^^^
[2025-12-15 15:22:27] IndexError: start out of range (expected to be in range of [-12, 12], but got 60)

中英文混杂示例:
“如地缘政治冲突、经济政策变化 etc,近两周的行业or event,如data below expectations, leader company业绩...”

Your hardware and system info
Write your system info like CUDA version/system/GPU/torch version here(在这里给出硬件信息和系统信息,如CUDA版本,系统,GPU型号和torch版本等)

1.量化环境:
A800(80G)*8
cuda 12.4
torch 2.6.0
auto_gptq 0.7.1
ms_swift 3.10.0

2.部署环境
sglangv0.5.0 rc2 cuda12.6

Additional context
Add any other context about the problem here(在这里补充其他信息)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the ms-swift export command with the listed A800, CUDA, Torch, auto_gptq, and ms-swift versions, then test the sglang launch command across the reported versions. Review the qwen3_moe loading traceback and the mixed-language inference example. Done means the GPU requirements, compatible sglang version, and cause of the language-mixing behavior are established or the issue is narrowed with a reproducible case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.