Views
No views yet
lm_head, vision tower and multimodal projector1cd Quark/examples/torch/language_modeling/llm_ptq/
2
3python3 quantize_quark.py \
4 --model_dir moonshotai/Kimi-K2.7-Code \
5 --output_dir Kimi-K2.7-Code-MXFP4 \
6 --file2file_quantization \
7 --trust_remote_code \
8 --quant_scheme mxfp4 \
9 --layer_quant_scheme '*self_attn*' ptpc_fp8 \
10 --exclude_layers "*lm_head*" "*mlp.gate" "*mm_projector*" \
11 "*vision_tower*" "mtp.*" "*shared_expert_gate*" "*router*" \
12 --model_export hf_formatdocker pull rocm/vllm-dev:nightly_main_202606161export VLLM_ROCM_USE_AITER=1
2export VLLM_ROCM_USE_AITER_MLA=0
3export VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS=0
4export VLLM_ROCM_USE_AITER_FP4BMM=0
5
6python3 -m vllm.entrypoints.openai.api_server \
7 --model amd/Kimi-K2.7-Code-MXFP4 \
8 --trust-remote-code \
9 --tensor-parallel-size 4 \
10 --gpu-memory-utilization 0.9 \
11 --max-model-len 8192| Benchmark | Kimi-K2.7-Code | Kimi-K2.7-Code-MXFP4 (this model) | Recovery |
| GSM8K (strict-match) | 95.07 | 94.80 | 99.7% |
| GSM8K (flexible-extract) | 95.15 | 94.77 | 99.6% |
lm-evaluation-harness framework
with the vLLM backend (rocm/vllm-dev nightly, vLLM 0.23.1rc1). The model
is served first, then evaluated via the OpenAI-compatible completions API.--no-enable-prefix-caching) for deterministic evaluation results.1# 1) Serve
2export VLLM_ROCM_USE_AITER=1 VLLM_ROCM_USE_AITER_MLA=0 \
3 VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS=0 VLLM_ROCM_USE_AITER_FP4BMM=0
4python3 -m vllm.entrypoints.openai.api_server \
5 --model amd/Kimi-K2.7-Code-MXFP4 \
6 --trust-remote-code --tensor-parallel-size 4 \
7 --gpu-memory-utilization 0.9 --max-model-len 8192 \
8 --seed 42 --no-enable-prefix-caching
9
10# 2) Evaluate
11lm_eval --model local-completions \
12 --model_args "model=amd/Kimi-K2.7-Code-MXFP4,base_url=http://0.0.0.0:8000/v1/completions,num_concurrent=128,tokenized_requests=False,max_length=8192,add_bos_token=True,seed=42,trust_remote_code=True" \
13 --tasks gsm8k --num_fewshot 5 --batch_size 1 --seed 42