Skip to content

Support kimi k3 nvfp4 checkpoint - #53132

Merged
zyongye merged 3 commits into
vllm-project:mainfrom
wzhao18:wzhao/k3-nvfp4
Aug 21, 2026
Merged

zyongye merged 3 commits into
vllm-project:mainfrom
wzhao18:wzhao/k3-nvfp4

Conversation

@wzhao18

@wzhao18 wzhao18 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Purpose

This PR supports running kimi k3 nvfp4 checkpoint nvidia/Kimi-K3-NVFP4

Test Plan

  • Kimi K3 GSM8k on 8 x B300

Test Result

TP8:

vllm serve nvidia/Kimi-K3-NVFP4 \
  -tp 8 \
  --load-format fastsafetensors \
  --no-enable-flashinfer-autotune \
  --trust-remote-code \
  --language-model-only \
  --attention-config '{"mla_prefill_backend":"TRTLLM_RAGGED","use_prefill_query_quantization":true}' \
  --kv-cache-dtype fp8 \
  --speculative-config '{"model":"Inferact/Kimi-K3-DSpark","method":"dspark","num_speculative_tokens":4,"rejection_sample_method":"standard"}' \
  --enable-prompt-tokens-details \
  --prefix-match-unit 128

|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value |   |Stderr|
|-----|------:|----------------|-----:|-----------|---|-----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match|↑  |0.9591|±  |0.0055|
|     |       |strict-match    |     5|exact_match|↑  |0.9591|±  |0.0055|

TEP8:

|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value |   |Stderr|
|-----|------:|----------------|-----:|-----------|---|-----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match|↑  |0.9606|±  |0.0054|
|     |       |strict-match    |     5|exact_match|↑  |0.9598|±  |0.0054|

DCP8:

|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value |   |Stderr|
|-----|------:|----------------|-----:|-----------|---|-----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match|↑  |0.9575|±  |0.0056|
|     |       |strict-match    |     5|exact_match|↑  |0.9575|±  |0.0056|

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: wzhao18 <wzhao18.sz@gmail.com>
Signed-off-by: wzhao18 <wzhao18.sz@gmail.com>
@mergify mergify Bot added deepseek Related to DeepSeek models mrv2 Model Runner V2 specific labels Aug 21, 2026
@github-project-automation github-project-automation Bot moved this to Ready in NVIDIA Aug 21, 2026
@zyongye

zyongye commented Aug 21, 2026

Copy link
Copy Markdown
Member

/ci run

@zyongye
zyongye enabled auto-merge (squash) August 21, 2026 04:07
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 21, 2026
@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #84955 for commit dd72b3df39b2.

@zyongye
zyongye merged commit f8e0602 into vllm-project:main Aug 21, 2026
136 of 137 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in NVIDIA Aug 21, 2026
@DamirLisak

Copy link
Copy Markdown

@wzhao18 support for deepseek v4 nvfp4 checkpoint #52447? 🙏☺️

wyettzeng pushed a commit to wyettzeng/vllm that referenced this pull request Aug 21, 2026
Signed-off-by: wzhao18 <wzhao18.sz@gmail.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Wyett <wyettzeng@gmail.com>
juhi10071998 added a commit to juhi10071998/vllm that referenced this pull request Aug 21, 2026
…trim FormatScheme

A FP8_PB_WO output width that is not a multiple of 128 (a partial trailing
block; e.g. GLM's replicated fused_qkv_a_proj = 2048 + 576 = 2624) is padded
up to a block boundary with zeros before the kernel post-load, the GEMM runs
on the padded weight, and the output is trimmed back to the logical width with
bias added after. This is wei-zhao vllm-project#53132's approach, expressed as a
FormatScheme (_Fp8PbWoPartialBlock) on the generic method rather than a
per-format class -- post_process pads the weight, apply wraps the kernel to
trim the output. A new FormatScheme.apply hook makes this compute-time residue
expressible without touching ModelOptLinearMethod. KFp8Block128 sizes the
weight_scale by cdiv to match the (padded) block count. No-op for the common
block-aligned case.

Chosen over a no-pad variant because it handles any width and does not depend
on DeepGEMM's undocumented N-alignment tolerance -- it is the logic upstream
already merged. Test is a faithful port of vllm-project#53132's
test_modelopt_fp8_pb_wo_hides_output_padding for the generic method.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Juhi Mittal <juhim@nvidia.com>
zufangzhu pushed a commit to zufangzhu/vllm that referenced this pull request Aug 24, 2026
Signed-off-by: wzhao18 <wzhao18.sz@gmail.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>
juhi10071998 added a commit to juhi10071998/vllm that referenced this pull request Aug 24, 2026
…trim FormatScheme

A FP8_PB_WO output width that is not a multiple of 128 (a partial trailing
block; e.g. GLM's replicated fused_qkv_a_proj = 2048 + 576 = 2624) is padded
up to a block boundary with zeros before the kernel post-load, the GEMM runs
on the padded weight, and the output is trimmed back to the logical width with
bias added after. This is wei-zhao vllm-project#53132's approach, expressed as a
FormatScheme (_Fp8PbWoPartialBlock) on the generic method rather than a
per-format class -- post_process pads the weight, apply wraps the kernel to
trim the output. A new FormatScheme.apply hook makes this compute-time residue
expressible without touching ModelOptLinearMethod. KFp8Block128 sizes the
weight_scale by cdiv to match the (padded) block count. No-op for the common
block-aligned case.

Chosen over a no-pad variant because it handles any width and does not depend
on DeepGEMM's undocumented N-alignment tolerance -- it is the logic upstream
already merged. Test is a faithful port of vllm-project#53132's
test_modelopt_fp8_pb_wo_hides_output_padding for the generic method.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Juhi Mittal <juhim@nvidia.com>
khushali9 pushed a commit to khushali9/vllm that referenced this pull request Aug 29, 2026
Signed-off-by: wzhao18 <wzhao18.sz@gmail.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: khushali9 <khushali.desai9@gmail.com>
juhi10071998 added a commit to juhi10071998/vllm that referenced this pull request Aug 31, 2026
…trim FormatScheme

A FP8_PB_WO output width that is not a multiple of 128 (a partial trailing
block; e.g. GLM's replicated fused_qkv_a_proj = 2048 + 576 = 2624) is padded
up to a block boundary with zeros before the kernel post-load, the GEMM runs
on the padded weight, and the output is trimmed back to the logical width with
bias added after. This is wei-zhao vllm-project#53132's approach, expressed as a
FormatScheme (_Fp8PbWoPartialBlock) on the generic method rather than a
per-format class -- post_process pads the weight, apply wraps the kernel to
trim the output. A new FormatScheme.apply hook makes this compute-time residue
expressible without touching ModelOptLinearMethod. KFp8Block128 sizes the
weight_scale by cdiv to match the (padded) block count. No-op for the common
block-aligned case.

Chosen over a no-pad variant because it handles any width and does not depend
on DeepGEMM's undocumented N-alignment tolerance -- it is the logic upstream
already merged. Test is a faithful port of vllm-project#53132's
test_modelopt_fp8_pb_wo_hides_output_padding for the generic method.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Juhi Mittal <juhim@nvidia.com>
juhi10071998 added a commit to juhi10071998/vllm that referenced this pull request Aug 31, 2026
The rebase onto vllm-project#53132/Kimi K3 brought in mla_attention.py's
_get_kv_b_proj_input_dtype, which imported and isinstance-checked the deleted
ModelOptFp8PbWoLinearMethod (a runtime ImportError for MLA + block-FP8 models,
caught by mypy). Map it to the generic ModelOptLinearMethod + the block-FP8
weight key (kFp8Static128BlockSym), same absorption as deep_gemm_warmup. Also
reword a test docstring (mis-scaled -> wrong scales) to satisfy the typos hook.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Juhi Mittal <juhim@nvidia.com>
am-cohere pushed a commit to am-cohere/vllm that referenced this pull request Sep 1, 2026
Signed-off-by: wzhao18 <wzhao18.sz@gmail.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
juhi10071998 added a commit to juhi10071998/vllm that referenced this pull request Sep 1, 2026
…trim FormatScheme

A FP8_PB_WO output width that is not a multiple of 128 (a partial trailing
block; e.g. GLM's replicated fused_qkv_a_proj = 2048 + 576 = 2624) is padded
up to a block boundary with zeros before the kernel post-load, the GEMM runs
on the padded weight, and the output is trimmed back to the logical width with
bias added after. This is wei-zhao vllm-project#53132's approach, expressed as a
FormatScheme (_Fp8PbWoPartialBlock) on the generic method rather than a
per-format class -- post_process pads the weight, apply wraps the kernel to
trim the output. A new FormatScheme.apply hook makes this compute-time residue
expressible without touching ModelOptLinearMethod. KFp8Block128 sizes the
weight_scale by cdiv to match the (padded) block count. No-op for the common
block-aligned case.

Chosen over a no-pad variant because it handles any width and does not depend
on DeepGEMM's undocumented N-alignment tolerance -- it is the logic upstream
already merged. Test is a faithful port of vllm-project#53132's
test_modelopt_fp8_pb_wo_hides_output_padding for the generic method.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Juhi Mittal <juhim@nvidia.com>
juhi10071998 added a commit to juhi10071998/vllm that referenced this pull request Sep 1, 2026
The rebase onto vllm-project#53132/Kimi K3 brought in mla_attention.py's
_get_kv_b_proj_input_dtype, which imported and isinstance-checked the deleted
ModelOptFp8PbWoLinearMethod (a runtime ImportError for MLA + block-FP8 models,
caught by mypy). Map it to the generic ModelOptLinearMethod + the block-FP8
weight key (kFp8Static128BlockSym), same absorption as deep_gemm_warmup. Also
reword a test docstring (mis-scaled -> wrong scales) to satisfy the typos hook.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Juhi Mittal <juhim@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek Related to DeepSeek models k3 kimi mrv2 Model Runner V2 specific nvidia quantization ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants