Conversation
`kern run` steps through the forward that takes `--rows` rows and adds `out.len() - 1` to its drafted-rows tally. A forward that writes no `tokens` output (the protocol only needs some forward to sample, not the one the step picks) hands back nothing: the subtraction underflows, a panic in debug, and in release the cursor never advances, so the loop never ends. The step now fails naming the forward. Reproduced with Qwen3-4B whose `decode` has its `sample` call removed (`decode_batch` still samples, so the protocol accepts it) and `kern run --rows 1`: the release build captured the step's graph and spun until a 90 s timeout killed it; with this change it exits 1 at once with "`decode` handed back no token".
This branch has not been deployed
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.
The protocol requires some forward to sample, not the one
kern runsteps through. When the step's forward writes notokensoutput,emittedreturns nothing andout.len() - 1underflows: a panic in debug, and in release a loop that never advances. The step now fails, naming the forward.Verification
Qwen3-4B with
sampleremoved fromdecode(decode_batchstill samples, so the protocol accepts it) andkern run --rows 1: before, the release build spun until a 90 s timeout killed it; after, it exits 1 with`decode` handed back no token; kern run steps through a forward that samples.