Repository navigation
[DSV4.1][gfx1250] Fix the crash on a single-launch served step: no hidden states for the drafter's ids (#3177) - #3185
Merged
Conversation
…he drafter's ids (#3177) The gfx1250 DeepSeek-V4.1 single-launch step (#3109, step_override) runs the whole decode step, drafts included, and returns no hidden states. #3136 sliced the drafter's input ids by hidden_states.shape[0], so postprocess crashed on the first served step. ModelRunner._draft_input_ids keeps the hidden states' rows where there are any (a PCP rank's shard on a pure middle chunk) and takes the step's running_tokens otherwise, at all three call sites. #3091's served rounds return hidden states and are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
|
valarLip
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3177.
Problem
On gfx1250, DeepSeek-V4.1-Flash crashed on the first decode step that the single-launch kernel served:
Cause
The bug came from two PRs meeting on main, #3109 and #3136. #3091 did not cause it.
03b584b8, the gfx1250 single-launch decode step) runs the whole decode step in one FlyDSL launch per rank: target, sampling, verification and the next drafts. It plugs intoModelRunnerthroughStepOverrideModel/_step_override. When it serves a step,run_modelreturns(None, None). The drafter'sproposeis wrapped, so on a served step it returns the drafts the kernel already drew and never reads the hidden states.bf657561, TBO metadata refactor) landed on main before [DSV4.1][gfx1250] Single-launch decode step (FlyDSL) #3109 merged. It changed the drafter's input ids inpostprocess(and in the align-only draft call) frominput_ids.gpu[1 : batch.total_tokens_num + 1]toinput_ids.gpu[1 : hidden_states.shape[0] + 1].#3109 was developed and validated on a base without #3136, so
03b584b8as merged already crashes on every served step. The5b4fbfdein the report is a later main.#3091 (gfx950 high-interactivity monokernels) is not involved. Its served rounds (
served_by_round,compute_head→round/post_verify) keep the target forward returning hidden states, and its drafts run through the normalpropose_draft_token_ids. Itscompute_headexists only on the hi model, andconsumes_device_verdictis False without a hi decode round, so neither is active on gfx1250.Fix
ModelRunner._draft_input_ids(batch, hidden_states)returns the ids the drafter reads, one per row the forward ran:running_tokens.running_tokens, from the forward context'sForwardMode.All three call sites (deferred, undeferred and align-only drafts) use it now.
Note: two mechanisms for a model taking over part of a decode step
ATOM now has two parallel ways for a model to take over part of a decode step, and each hooks into
run_model/postprocessdifferently:served_by_round)compute_head)StepOverrideModel)(None, None); outputs read from_servedThis crash happened because
postprocessassumed only the first. Unifying the two is a larger change and should be discussed with both PRs' authors. It is not done here.Test
blackandruffpass on the changed file.