Skip to content

perf(rocm): prepack Kimi-K3 latent tail weights to FP8 - #18

Open
JohnQinAMD wants to merge 1 commit into
perf/kimi-k3-latent-tail-cleanfrom
perf/kimi-k3-latent-tail-fp8-clean
Open

JohnQinAMD wants to merge 1 commit into
perf/kimi-k3-latent-tail-cleanfrom
perf/kimi-k3-latent-tail-fp8-clean

Conversation

@JohnQinAMD

@JohnQinAMD JohnQinAMD commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

Prepack each local Kimi-K3 latent-tail up-projection to row-scaled OCP E4M3
after checkpoint loading, then select the AITER FP8 tail only for its exact
supported contract. The packed tensors are nonpersistent buffers owned by the
routed output transform; unsupported requests retain the existing BF16 tail.

This PR is stacked on #17 and depends on
JohnQinAMD/aiter-amd#18.

Scope

The integration adds one opt-in ROCm environment switch, a model-load prepack
hook over locally constructed decoder layers, and focused dispatch/fallback
tests. It does not change NVIDIA code or checkpoint serialization, and it does
not allocate or quantize during graph capture.

Enable with VLLM_ROCM_USE_KIMI_K3_LATENT_TAIL_FP8=1.

Correctness

The AITER real-weight rotating-bank campaign checked 24 cases:

  • worst RRMSE versus BF16: 0.020959;
  • minimum cosine: 0.999780;
  • minimum SNR: 33.573 dB;
  • worst RRMSE versus dequantized FP8: 1.487e-5.

The Wave40 endpoint bundle passed GSM8K first 100 at 100/100, with zero invalid
responses and zero paired answer changes.

Performance

MI355X/gfx950, 92 rotating real weights, 11 trials, 30 graph replays/trial:

Path ms/token
BF16 parent 0.920660
FP8 candidate 0.668757
Saving 0.251903

The kernel speedup is 1.376673x. In the Wave40 bundle, TPOT improved from
12.194182 to 11.886058 ms and throughput from 82.006322 to 84.132180
tok/s/GPU.

Validation

  • Current-branch changed-file pre-commit passes, including Ruff, format,
    Python 3.10 mypy, SPDX, import guards, environment-schema checks, and the
    CUDA API guard.
  • Focused tests cover packed-tensor ownership, FP8 dispatch, and exact BF16
    fallback.
  • The exact clean current-main integration passed all 3 focused cases in the
    immutable MI355X validation image. The companion AITER FP8 suite passed 7/7.
  • The clean current-stack TP8 diagnostic is not used as candidate evidence.
    The candidate scored 2/100, but the same-image flag-off parent scored 0/3
    and exhausted all 1,536 allowed output tokens; the candidate's same first
    three were also 0/3. This is an invalid common control, not an attributable
    FP8-tail regression. The accepted-stack 100/100 result above remains the
    fixed endpoint evidence until that parent regression is repaired.
  • git diff --check passes.

Disclosure

Developed with assistance from OpenAI Codex. The author reviewed the model-load
lifecycle, precision contract, fallback behavior, and performance evidence.

Keep the packed row-scaled E4M3 representation owned by each routed output transform and build it after checkpoint loading. Dispatch only for the exact supported contract and retain the existing BF16 tail as fallback.

Assisted-by: OpenAI Codex
Signed-off-by: Yanyuan Qin <yanyuan.qin@amd.com>
@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

PRs do not trigger a full CI run by default. Reviewers with write access and configured trusted contributors can comment /ci run whenever CI signals are needed.

Once the PR is approved or has the ready label, the PR author can also use /ci run or /ci retry. New commits do not start CI automatically.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

Agent Guidelines

IMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban.

🚀

@JohnQinAMD
JohnQinAMD marked this pull request as ready for review July 31, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Ready for CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant