Skip to content

[None][perf] Explicitly set Kimi K3 router correction bias in FP32 - #17061

Closed
jiaganc wants to merge 1 commit into
NVIDIA:feat/kimi_k3from
jiaganc:codex/kimi-k3-router-bias-fp32
Closed

[None][perf] Explicitly set Kimi K3 router correction bias in FP32#17061
jiaganc wants to merge 1 commit into
NVIDIA:feat/kimi_k3from
jiaganc:codex/kimi-k3-router-bias-fp32

Conversation

@jiaganc

@jiaganc jiaganc commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai summary

Description

Make the Kimi K3 router correction-bias dtype invariant explicit by allocating
e_score_correction_bias as FP32. The checkpoint loader copies into the
destination parameter dtype, so the bias remains FP32 after loading.

Pass the stored parameter directly to the fused noaux_tc routing path instead
of requesting a per-call .float() conversion. This preserves routing behavior
while ensuring the fused path cannot allocate an upcast tensor when model
construction uses a non-FP32 default dtype.

Test Coverage

  • pre-commit run --files tensorrt_llm/_torch/modules/kimi_k3_moe/kimi_k3_moe_gate.py
  • python3 -m py_compile tensorrt_llm/_torch/modules/kimi_k3_moe/kimi_k3_moe_gate.py
  • CUDA unit tests were not run because no remote GPU target was specified.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com>
@jiaganc jiaganc changed the title [None][perf] Keep Kimi K3 router correction bias in FP32 [None][perf] Explicitly set Kimi K3 router correction bias in FP32 Jul 30, 2026
@jiaganc

jiaganc commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

Will implement in #17312.

@jiaganc jiaganc closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant