KTransformers

Qwen 模型

Qwen 页面按模型组织。每个模型下面都有 InferenceTraining 两个任务视角。

总览

模型InferenceTraining
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 单卡 OOMBF16/KT LoRA SFT 4-GPU 20-step 已验证;advanced/high-RAM,Training TPS=1.14

Qwen3-30B-A3B

Inference

本节摘要展示吞吐,不用 latency 排序。

MethodGE关键参数Prefill TPSDecode TPSPeak GPUPeak RSSEvidence
AMXINT80mem-fraction-static=0.85, max-total-tokens=8192, max-running-requests=82797.0184.244.49GB71.16GBGE0 TPS sweep
AMXINT810同上2924.9684.758.71GB71.17GBGE10 TPS sweep
AMXINT820同上3053.0985.9612.93GB71.15GBGE20 TPS sweep
AMXINT830同上3367.9785.5717.15GB71.17GBGE30 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 保留为支撑证据。

MethodRecipe关键参数Training TPSPeak GPUPeak RSSEvidence
AMXINT8LoRA SFTkt_weight_path=/path/to/Qwen3-30B-A3B-INT8, lora_rank=8, batch=1, grad_accum=8, max_steps=2032.455.54GB77.4GB20-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 dircommand.shtrain.logmonitor.jsonlmetrics.json
output diradapter 产物、train_results.jsontrainer_state.json

Qwen3-235B-A22B-Instruct-2507

Inference

MethodGE关键参数Prefill TPSDecode TPSPeak GPUPeak RSS状态
AMXINT80mem-fraction-static=0.85, max-running-requests=4550.9516.6417.5GB229.2GB单卡 24GB baseline
AMXINT85同 GE0n/an/aOOMn/a置灰
AMXINT810同 GE0n/an/aOOMn/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

MethodRecipe关键参数Training TPSPeak GPURAM状态
BF16/KTLoRA SFTcutoff_len=256, lora_rank=8, batch=1, grad_accum=8, max_steps=12, 4 GPU FSDP21.279.59GB/GPUsystem used 527.9GBadvanced/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 smoketransformers 4.57.1 不识别 qwen3_5_moeblocker evidence
shm/sglang-epd BF16 smoke能识别 qwen3_5_moe,进入模型加载后单卡 24GB OOMblocker evidence

下一步需要准备量化/KT Inference 权重、多卡分片或更大显存环境,然后先跑 server smoke,再做 Prefill/Decode TPS sweep。

Training

MethodRecipe关键参数Training TPSPeak GPURAM状态
BF16/KTLoRA SFTcutoff_len=512, lora_rank=8, batch=1, grad_accum=8, max_steps=20, 4 GPU FSDP21.1413.79GB/GPUsystem used 924.0GBadvanced/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