Skip to content

[Fix] kimi-k3: Preserve pipeline graph bank inputs and bound chunk profiling - #43604

Merged
ch-wan merged 2 commits into
mainfrom
cheng/hot-fix/kimi-k3-pipeline-graphs
Oct 15, 2026
Merged

ch-wan merged 2 commits into
mainfrom
cheng/hot-fix/kimi-k3-pipeline-graphs

Conversation

@ch-wan

@ch-wan ch-wan commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

This PR was part of the following stack (oldest at bottom; all merged):

Motivation

The text-only Kimi K3 wrapper does not expose its pipeline layer range to the model runner. A receiving stage consequently captures an empty inherited attention-residual bank: block-aligned cuts produce incorrect decode results, and cuts inside a block fail graph capture. Dynamic chunk profiling can also allocate requests longer than the request-to-token mapping, leaving KV slots unreachable during release.

Changes

Expose the text model's actual start/end layers. Bound complete profiling requests by model context and request mapping capacity, preserve the existing 1.25x chunk probe range when capacity allows, and release each prepared profiling request even if its forward fails. The prefill budget continues to constrain predicted chunks.

Validation

  • B200, synthetic 6-layer Kimi K3, bank block size 4, asymmetric dummy weights, TP2, NCCL: unchanged main reproduces the 3+3 capture assertion, 4+2 decode logprob difference of 0.06181, and 477,708 leaked KV slots after dynamic profiling.
  • Fixed chunk size 16: graph PP2 at both 3+3 and 4+2 cuts, and eager PP2 at 3+3, match graph PP1 bitwise across all six prompts, including prefill and decode logprobs.
  • Dynamic chunking: default chunk budget startup succeeds; both cuts complete eight prompts up to 4,104 tokens with live chunk predictions and graph decode, without idle pool invariant failures. Their complete outputs match bitwise.
  • CPU coverage includes three model-range regression methods and two profiler methods. The updated profiler methods pass, covering context/mapping limits, a 20,480-token probe for a 16,384-token base chunk with sufficient context, and forward-failure cleanup. Two probe-range subcases fail with the prior prefill-budget cap. All pre-commit checks pass.

GPU results are from the prior revision. Removing the prefill-budget cap leaves profiling lengths unchanged for those configurations: their 8,192-token context or 1.25x chunk limit is tighter. GPU comparisons were not rerun for this profiler-only revision.

The two fixes are rebased onto main 72730d6360 with unchanged patch IDs. The adapter PRs above this one build on these fixes. CPU regressions were rerun on the resulting stack; prior B200 comparisons were not rerun.

Current Stack Validation

All three updated adapter commits passed pre-commit independently; the two K3 commits are unchanged. The final stack CPU suite passed 481 tests and 7,409 subtests, with 21 hardware-specific skips. Independent common-layer and Inkling boundary suites passed 372 tests / 7,315 subtests and 386 tests / 7,329 subtests, respectively.

Four new regressions fail on the prior implementation and pass with the fixes. They cover terminal export releasing state retained by an old output handle (including a failing final norm), terminal reader binding for written/pending/fused output with two contexts, rejection and cleanup when binding changes read capabilities, and rejection of bindable update results on both immediate and deferred exit paths. Existing tests cover the converted containers, short-convolution positions and stateless V4 terminal reads.

The earlier callback-selection, transformed-reader and row-transport context regressions remain covered. No GPU tests or formal performance benchmarks were rerun for these fixes; prior GPU evidence retains its stated limitations.

Landing

Rebased onto main 71a17dbc24 for merge. Validation above predates this rebase; no tests or benchmarks were rerun as part of landing.


CI States

Latest PR Test (Base): 🚫 Run #38710132047
Latest PR Test (Extra): 🚫 Run #38710132022
Latest PR Test (AMD ROCm 10): ❌ Run #38710131970

@ch-wan
ch-wan force-pushed the cheng/hot-fix/kimi-k3-pipeline-graphs branch from 6be9152 to c6c7ec9 Compare October 11, 2026 09:51
@ch-wan ch-wan changed the title [Fix] Preserve Kimi K3 pipeline graph bank inputs and bound chunk profiling [Fix] kimi-k3: Preserve pipeline graph bank inputs and bound chunk profiling Oct 14, 2026
@ch-wan
ch-wan force-pushed the cheng/hot-fix/kimi-k3-pipeline-graphs branch from c6c7ec9 to e207db2 Compare October 14, 2026 19:27
@ch-wan
ch-wan marked this pull request as ready for review October 14, 2026 19:47
@ch-wan
ch-wan force-pushed the cheng/hot-fix/kimi-k3-pipeline-graphs branch from e207db2 to 160ec2c Compare October 15, 2026 09:03
@ch-wan
ch-wan merged commit d59c344 into main Oct 15, 2026
3 of 4 checks passed
@ch-wan
ch-wan deleted the cheng/hot-fix/kimi-k3-pipeline-graphs branch October 15, 2026 09:03
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