Conversation
The multi-stream scheduler rebuilds the FX graph from its stream assignment. An in-place op that mutates a graph input without returning a value (Eagle3 captures decoder hidden states into a preallocated buffer with inplace_slice_copy) has no path to the FX output, so the scheduler could emit it after the output node, where it is dead code once the module is recompiled. On the MiniMax-M3 disaggregated context worker (piecewise torch.compile, max_num_streams 3) this dropped the final hidden-state capture and lowered Eagle3 acceptance from 3.48 to 3.24 on GSM8K; aggregated serving with the same compile settings measured 2.98. Make graph exit depend on the last mutation of every in-place target. The mutation is then emitted before output, and when auxiliary streams are live the exit also waits on the mutating stream before a graph-external consumer reads the buffer. This replaces the Eagle-specific priority edge with a general dependency and needs no model-specific op, event or configuration gate. Restore the scheduler unit test and extend it to assert that every capture precedes output, including captures of the last decoder layer. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Zheyu Fu <zheyuf@nvidia.com> (cherry picked from commit 343310a)
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.
Description
The multi-stream scheduler rebuilds the FX graph from its stream assignment. An in-place op that mutates a graph input without returning a value (Eagle3 captures decoder hidden states into a preallocated buffer with
inplace_slice_copy) has no path to the FXoutput, so the scheduler could emit it after the output node, where it is dead code once the module is recompiled. On the MiniMax-M3 disaggregated context worker (piecewise torch.compile,max_num_streams=3) this dropped the final hidden-state capture and lowered Eagle3 acceptance length from 3.48 to 3.24 on GSM8K.Make graph exit depend on the last mutation of every in-place target: the mutation is then emitted before
output, and when auxiliary streams are live the exit also waits on the mutating stream before a graph-external consumer reads the buffer. No model-specific op, event or configuration gate is needed.Test Coverage
tests/unittest/_torch/compilation/test_auto_multi_stream.py(new): the exit node depends on an unreturned in-place mutation and waits on its stream; every hidden-state capture of a decoder stack (including the last layer's) precedesoutputand survives recompilation, for 2 and 3 streams. Scheduled viaunittest/_torch/compilationinl0_b200/l0_h100.PR Checklist
[JIRA/NVBUG/None][type]format/bot run, once opened againstmain)