Qwen 模型
Qwen 页面按模型组织。每个模型下面都有 Inference 和 Training 两个任务视角。
总览
| 模型 | Inference | Training |
|---|---|---|
| Qwen3-30B-A3B | 单卡 24GB GPU,AMXINT8 已验证;GE30 是默认/prefill 优化,GE20 是 decode-best 变体 | AMXINT8 LoRA SFT 已验证;20-step 主表 Training TPS=32.45 |
| Qwen3-235B-A22B-Instruct-2507 | 单卡 24GB GPU 只能推荐 GE0 baseline;GE5/GE10 已测 OOM 置灰 | BF16/KT LoRA SFT 4-GPU 已验证;advanced/high-RAM,Training TPS=1.27 |
| Qwen3.5-397B-A17B | 当前无 Inference TPS:旧环境不识别 qwen3_5_moe,新环境能识别但 BF16 原始权重在 24GB 单卡 OOM | BF16/KT LoRA SFT 4-GPU 20-step 已验证;advanced/high-RAM,Training TPS=1.14 |
Qwen3-30B-A3B
Inference
本节摘要展示吞吐,不用 latency 排序。
| Method | GE | 关键参数 | Prefill TPS | Decode TPS | Peak GPU | Peak RSS | Evidence |
|---|---|---|---|---|---|---|---|
| AMXINT8 | 0 | mem-fraction-static=0.85, max-total-tokens=8192, max-running-requests=8 | 2797.01 | 84.24 | 4.49GB | 71.16GB | GE0 TPS sweep |
| AMXINT8 | 10 | 同上 | 2924.96 | 84.75 | 8.71GB | 71.17GB | GE10 TPS sweep |
| AMXINT8 | 20 | 同上 | 3053.09 | 85.96 | 12.93GB | 71.15GB | GE20 TPS sweep |
| AMXINT8 | 30 | 同上 | 3367.97 | 85.57 | 17.15GB | 71.17GB | GE30 TPS sweep |
推荐解释:
| 用途 | 推荐 |
|---|---|
| 默认 / Prefill 最高 | GE30,Prefill TPS=3367.97 |
| Decode 最高 | GE20,Decode TPS=85.96 |
| 低 GPU 显存 | GE0,约 4.49GB GPU,Decode TPS 仍接近高 GE 档 |
默认 / prefill 优化启动命令:
export CUDA_VISIBLE_DEVICES=0
export SGLANG_DISABLE_CUDNN_CHECK=1
python -m sglang.launch_server \
--host 127.0.0.1 \
--port 19213 \
--model-path /path/to/Qwen3-30B-A3B \
--served-model-name qwen3-30b-amxint8-ge30 \
--trust-remote-code \
--tp-size 1 \
--context-length 4096 \
--mem-fraction-static 0.85 \
--max-total-tokens 8192 \
--chunked-prefill-size 512 \
--max-prefill-tokens 512 \
--max-running-requests 8 \
--watchdog-timeout 1800 \
--attention-backend triton \
--sampling-backend pytorch \
--disable-cuda-graph \
--disable-radix-cache \
--skip-server-warmup \
--disable-shared-experts-fusion \
--log-requests \
--show-time-cost \
--enable-request-time-stats-logging \
--kt-weight-path /path/to/Qwen3-30B-A3B-INT8 \
--kt-method AMXINT8 \
--kt-num-gpu-experts 30 \
--kt-cpuinfer 96 \
--kt-threadpool-count 2
Decode-best 变体复用同一命令,只改:
--served-model-name qwen3-30b-amxint8-ge20
--kt-num-gpu-experts 20
Training
Training 不拆 prefill/decode,摘要使用总 Training TPS。Qwen3-30B-A3B 使用 20-step stability case;12-step case 保留为支撑证据。
| Method | Recipe | 关键参数 | Training TPS | Peak GPU | Peak RSS | Evidence |
|---|---|---|---|---|---|---|
| AMXINT8 | LoRA SFT | kt_weight_path=/path/to/Qwen3-30B-A3B-INT8, lora_rank=8, batch=1, grad_accum=8, max_steps=20 | 32.45 | 5.54GB | 77.4GB | 20-step stability run |
训练命令:
export CUDA_VISIBLE_DEVICES=0
export USE_KT=1
export DISABLE_VERSION_CHECK=1
accelerate launch \
--config_file /path/to/LLaMA-Factory/examples/ktransformers/accelerate/fsdp2_kt_int8_1gpu.yaml \
/path/to/LLaMA-Factory/src/train.py \
/path/to/training_cases/qwen3-30b-amxint8-training.yaml
证据记录包含:
| 内容 | 说明 |
|---|---|
| run dir | command.sh、train.log、monitor.jsonl、metrics.json |
| output dir | adapter 产物、train_results.json、trainer_state.json |
Qwen3-235B-A22B-Instruct-2507
Inference
| Method | GE | 关键参数 | Prefill TPS | Decode TPS | Peak GPU | Peak RSS | 状态 |
|---|---|---|---|---|---|---|---|
| AMXINT8 | 0 | mem-fraction-static=0.85, max-running-requests=4 | 550.95 | 16.64 | 17.5GB | 229.2GB | 单卡 24GB baseline |
| AMXINT8 | 5 | 同 GE0 | n/a | n/a | OOM | n/a | 置灰 |
| AMXINT8 | 10 | 同 GE0 | n/a | n/a | OOM | n/a | 置灰 |
GE0 启动命令:
python -m sglang.launch_server \
--host 127.0.0.1 \
--port 19217 \
--model-path /path/to/Qwen3-235B-A22B-Instruct-2507 \
--served-model-name qwen3-235b-amxint8-ge0 \
--trust-remote-code \
--tp-size 1 \
--context-length 4096 \
--mem-fraction-static 0.85 \
--max-total-tokens 8192 \
--chunked-prefill-size 512 \
--max-prefill-tokens 512 \
--max-running-requests 4 \
--watchdog-timeout 1800 \
--attention-backend triton \
--sampling-backend pytorch \
--disable-cuda-graph \
--disable-radix-cache \
--skip-server-warmup \
--disable-shared-experts-fusion \
--log-requests \
--show-time-cost \
--enable-request-time-stats-logging \
--kt-weight-path /path/to/Qwen3-235B-A22B-Instruct-2507-Int8 \
--kt-method AMXINT8 \
--kt-num-gpu-experts 0 \
--kt-cpuinfer 96 \
--kt-threadpool-count 2
Training
| Method | Recipe | 关键参数 | Training TPS | Peak GPU | RAM | 状态 |
|---|---|---|---|---|---|---|
| BF16/KT | LoRA SFT | cutoff_len=256, lora_rank=8, batch=1, grad_accum=8, max_steps=12, 4 GPU FSDP2 | 1.27 | 9.59GB/GPU | system used 527.9GB | advanced/high-RAM |
启动命令:
accelerate launch \
--config_file /path/to/LLaMA-Factory/examples/ktransformers/accelerate/fsdp2_kt_bf16.yaml \
/path/to/LLaMA-Factory/src/train.py \
/path/to/training_cases/qwen3-235b-bf16-training.yaml
这条路线证明 Qwen3-235B 可训练,但不是高吞吐推荐,更适合作为 advanced/high-RAM 路线参考。
Qwen3.5-397B-A17B
Inference
当前不展示 Prefill/Decode TPS,因为没有 server-ready 的路线。
| Case | 结果 | 页面状态 |
|---|---|---|
old sglang-kt BF16 smoke | transformers 4.57.1 不识别 qwen3_5_moe | blocker evidence |
| shm/sglang-epd BF16 smoke | 能识别 qwen3_5_moe,进入模型加载后单卡 24GB OOM | blocker evidence |
下一步需要准备量化/KT Inference 权重、多卡分片或更大显存环境,然后先跑 server smoke,再做 Prefill/Decode TPS sweep。
Training
| Method | Recipe | 关键参数 | Training TPS | Peak GPU | RAM | 状态 |
|---|---|---|---|---|---|---|
| BF16/KT | LoRA SFT | cutoff_len=512, lora_rank=8, batch=1, grad_accum=8, max_steps=20, 4 GPU FSDP2 | 1.14 | 13.79GB/GPU | system used 924.0GB | advanced/high-RAM |
启动命令:
accelerate launch \
--config_file /path/to/LLaMA-Factory/examples/ktransformers/accelerate/fsdp2_kt_bf16.yaml \
/path/to/LLaMA-Factory/src/train.py \
/path/to/training_cases/qwen35-397b-bf16-training.yaml
注意:这条路线依赖当前 Torch 2.9 Conv3D 兼容补丁。短步数验证只作为链路确认,主表使用 20-step stability 的 Training TPS=1.14。