fix(serve): restore sampled think-cap continuation (cherry-pick f03b494dc — completes #523)#524
Merged
Merged
Conversation
Restore the correctness behavior lost when redline was brought onto master: disable the content-blind 4-gram loop guard by default, forward the resolved medium think budget through the serve API, and continue AR/DFlash/native-MTP generation after the forced think close. The fixed-seed A3B sampled battery on hiptrx now produces visible coherent output for all 5 prompts. A controlled repeat measured 158.24 tok/s capped vs 156.94 uncapped; the earlier 153.02 sample was transient run-state variance, not a stable cap penalty. Adds focused tests for the guard default and serve cap precedence. The unrelated MTP prefix-cache work from 7eac3c8 is intentionally not included. (cherry picked from commit f03b494)
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.
Cherry-picks
f03b494dcfromredline(-xtrailer preserved) — the complete, hiptrx-validated fix for the runaway-thinking pairing.Why: #523 restored only the n-gram half (guard default 8→0). But master also gated the med think-cap behind
max_think_explicit, so with the default config (thinking_budget: "med", no override) the 2048 cap wasn't forwarded — leaving master with neither runaway guard by default after #523. This restores the whole 7eac3c8 correctness unit:resolveServeThinkCap()replaces the&& max_think_explicitgate),</think>close.Validated (from the commit): fixed-seed A3B sampled battery on hiptrx now produces visible coherent output for all 5 prompts; controlled repeat 158.24 tok/s capped vs 156.94 uncapped (perf-neutral; the earlier 153.02 was transient run-state variance). Adds
serve_think_cap.test.ts+ guard-default tests.Scope: deliberately excludes the unrelated MTP prefix-cache from 7eac3c8. Verified here:
cargo check -p hipfire-runtime -p hipfire-arch-qwen35green;bun test serve_think_cap.test.ts2/2 pass.