Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/166472
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ⏳ 1 Pending, 1 Unrelated FailureAs of commit b2d9489 with merge base 0674e0a ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 1 checks: trunk / linux-jammy-cuda12.8-py3.10-gcc11 / test (default, 2, 5, linux.g6.4xlarge.experimental.nvidia.gpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 1 checks: trunk / linux-jammy-cuda12.8-py3.10-gcc11 / test (default, 2, 5, linux.g6.4xlarge.experimental.nvidia.gpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
|
@pytorchbot merge -f "unrelated mandatory check failure" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Upstream pytorch#166472 (mlazos, '[user-streams] Switch to fx annotations at trace time') changed StreamContextVariable.target_values from a positional list [stream_var] to a dict {"stream": idx} so that StreamContextVariable.enter() (inherited from FxTracebackAnnotateVariable.enter) could feed it to torch.fx.traceback.annotate. That broke three other consumers of target_values -- output_graph.py's stack_ctx_args / locals_ctx_args population, the base ContextWrappingVariable.reconstruct, and BlockStackEntry.resume_fn -> ReenterWith.try_finally -- all of which iterate it as a positional tuple. tuple({"stream": 3}) flattens to ("stream",): the int index is silently dropped and the rebuild call ends up as e.g. torch.cuda.stream("stream"), which fails with a confusing device-string parse error. The breakage has been latent since pytorch#166472 because FxTracebackAnnotateVariable.reconstruct_type raises Unsupported("torch.fx.traceback.annotate escaped from compiled region") unconditionally, short-circuiting the rebuild before the dict-vs-positional mismatch can surface. The visible symptom is a silent ungraceful graph break that drops the post-break body when a graph break occurs inside with torch.cuda.stream(s):. This fix structurally separates the two purposes of target_values: * self.annotation = {"stream": idx} is a new dedicated field that enter() passes to torch.fx.traceback.annotate. * target_values = () keeps the positional rebuild contract happy. Then StreamContextVariable.reconstruct_type is overridden to push a 0-arg callable -- functools.partial(torch.cuda.stream, <Stream>) -- installed as a global on the compiled function via OutputGraph.install_global_by_id. The base ContextWrappingVariable.reconstruct appends CALL 0 (target_values is empty), invoking the partial to produce a fresh StreamContext just in time for the resume prologue's BEFORE_WITH. functools.partial (rather than a freshly-defined closure) is critical: dynamo retraces the resume prologue, and a closure defined inside torch/_dynamo would be classified as MOD_SKIPLIST'd and refuse-to-trace, breaking the prologue. functools.partial is a builtin that dynamo handles natively, and the wrapped target (torch.cuda.stream) is plainly traceable. enter() is also inlined (rather than inherited from FxTracebackAnnotateVariable.enter) because the parent passes self.target_values to annotate, but target_values is now the positional rebuild-args tuple; the annotation dict lives on self.annotation. reconstruct_type is overridden alongside to bypass FxTracebackAnnotateVariable.reconstruct_type's unconditional Unsupported raise. Regression test added at test/dynamo/test_streams.py::test_target_values_dict_round_trips_through_graph_break: graph break inside with torch.cuda.stream(s):, asserts two graph fragments are captured (rather than the post-break body being silently dropped to eager). Whole test_streams.py suite: 68 pass, 7 platform-skipped, no regressions. Authored with Claude. Signed-off-by: Tom Fogal <[email protected]> Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Upstream pytorch#166472 (mlazos, '[user-streams] Switch to fx annotations at trace time') changed StreamContextVariable.target_values from a positional list [stream_var] to a dict {"stream": idx} so that StreamContextVariable.enter() (inherited from FxTracebackAnnotateVariable.enter) could feed it to torch.fx.traceback.annotate. That broke three other consumers of target_values -- output_graph.py's stack_ctx_args / locals_ctx_args population, the base ContextWrappingVariable.reconstruct, and BlockStackEntry.resume_fn -> ReenterWith.try_finally -- all of which iterate it as a positional tuple. tuple({"stream": 3}) flattens to ("stream",): the int index is silently dropped and the rebuild call ends up as e.g. torch.cuda.stream("stream"), which fails with a confusing device-string parse error. The breakage has been latent since pytorch#166472 because FxTracebackAnnotateVariable.reconstruct_type raises Unsupported("torch.fx.traceback.annotate escaped from compiled region") unconditionally, short-circuiting the rebuild before the dict-vs-positional mismatch can surface. The visible symptom is a silent ungraceful graph break that drops the post-break body when a graph break occurs inside with torch.cuda.stream(s):. This fix structurally separates the two purposes of target_values: * self.annotation = {"stream": idx} is a new dedicated field that enter() passes to torch.fx.traceback.annotate. * target_values = () keeps the positional rebuild contract happy. Then StreamContextVariable.reconstruct_type is overridden to push a 0-arg callable -- functools.partial(torch.cuda.stream, <Stream>) -- installed as a global on the compiled function via OutputGraph.install_global_by_id. The base ContextWrappingVariable.reconstruct appends CALL 0 (target_values is empty), invoking the partial to produce a fresh StreamContext just in time for the resume prologue's BEFORE_WITH. functools.partial (rather than a freshly-defined closure) is critical: dynamo retraces the resume prologue, and a closure defined inside torch/_dynamo would be classified as MOD_SKIPLIST'd and refuse-to-trace, breaking the prologue. functools.partial is a builtin that dynamo handles natively, and the wrapped target (torch.cuda.stream) is plainly traceable. enter() is also inlined (rather than inherited from FxTracebackAnnotateVariable.enter) because the parent passes self.target_values to annotate, but target_values is now the positional rebuild-args tuple; the annotation dict lives on self.annotation. reconstruct_type is overridden alongside to bypass FxTracebackAnnotateVariable.reconstruct_type's unconditional Unsupported raise. Regression test added at test/dynamo/test_streams.py::test_target_values_dict_round_trips_through_graph_break: graph break inside with torch.cuda.stream(s):, asserts two graph fragments are captured (rather than the post-break body being silently dropped to eager). Whole test_streams.py suite: 68 pass, 7 platform-skipped, no regressions. Authored with Claude. Signed-off-by: Tom Fogal <[email protected]> Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Upstream pytorch#166472 (mlazos, '[user-streams] Switch to fx annotations at trace time') changed StreamContextVariable.target_values from a positional list [stream_var] to a dict {"stream": idx} so that StreamContextVariable.enter() (inherited from FxTracebackAnnotateVariable.enter) could feed it to torch.fx.traceback.annotate. That broke three other consumers of target_values -- output_graph.py's stack_ctx_args / locals_ctx_args population, the base ContextWrappingVariable.reconstruct, and BlockStackEntry.resume_fn -> ReenterWith.try_finally -- all of which iterate it as a positional tuple. tuple({"stream": 3}) flattens to ("stream",): the int index is silently dropped and the rebuild call ends up as e.g. torch.cuda.stream("stream"), which fails with a confusing device-string parse error. The breakage has been latent since pytorch#166472 because FxTracebackAnnotateVariable.reconstruct_type raises Unsupported("torch.fx.traceback.annotate escaped from compiled region") unconditionally, short-circuiting the rebuild before the dict-vs-positional mismatch can surface. The visible symptom is a silent ungraceful graph break that drops the post-break body when a graph break occurs inside with torch.cuda.stream(s):. This fix structurally separates the two purposes of target_values: * self.annotation = {"stream": idx} is a new dedicated field that enter() passes to torch.fx.traceback.annotate. * target_values = () keeps the positional rebuild contract happy. Then StreamContextVariable.reconstruct_type is overridden to push a 0-arg callable -- functools.partial(torch.cuda.stream, <Stream>) -- installed as a global on the compiled function via OutputGraph.install_global_by_id. The base ContextWrappingVariable.reconstruct appends CALL 0 (target_values is empty), invoking the partial to produce a fresh StreamContext just in time for the resume prologue's BEFORE_WITH. functools.partial (rather than a freshly-defined closure) is critical: dynamo retraces the resume prologue, and a closure defined inside torch/_dynamo would be classified as MOD_SKIPLIST'd and refuse-to-trace, breaking the prologue. functools.partial is a builtin that dynamo handles natively, and the wrapped target (torch.cuda.stream) is plainly traceable. enter() is also inlined (rather than inherited from FxTracebackAnnotateVariable.enter) because the parent passes self.target_values to annotate, but target_values is now the positional rebuild-args tuple; the annotation dict lives on self.annotation. reconstruct_type is overridden alongside to bypass FxTracebackAnnotateVariable.reconstruct_type's unconditional Unsupported raise. Regression test added at test/dynamo/test_streams.py::test_target_values_dict_round_trips_through_graph_break: graph break inside with torch.cuda.stream(s):, asserts two graph fragments are captured (rather than the post-break body being silently dropped to eager). Whole test_streams.py suite: 68 pass, 7 platform-skipped, no regressions. Authored with Claude. Signed-off-by: Tom Fogal <[email protected]> Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…4487) Upstream #166472 ('[user-streams] Switch to fx annotations at trace time') changed `StreamContextVariable.target_values` from a positional list [stream_var] to a dict {"stream": idx} so that StreamContextVariable.enter() (inherited from FxTracebackAnnotateVariable.enter) could feed it to torch.fx.traceback.annotate. That broke three other consumers of target_values -- output_graph.py's stack_ctx_args / locals_ctx_args population, the base ContextWrappingVariable.reconstruct, and BlockStackEntry.resume_fn -> ReenterWith.try_finally -- all of which iterate it as a positional tuple. tuple({"stream": 3}) flattens to ("stream",): the int index is silently dropped and the rebuild call ends up as e.g. torch.cuda.stream("stream"), which fails with a confusing device-string parse error. The breakage has been latent since #166472 because FxTracebackAnnotateVariable.reconstruct_type raises Unsupported("torch.fx.traceback.annotate escaped from compiled region") unconditionally, short-circuiting the rebuild before the dict-vs-positional mismatch can surface. The visible symptom is a silent ungraceful graph break that drops the post-break body when a graph break occurs inside with torch.cuda.stream(s):. This fix structurally separates the two purposes of target_values: * self.annotation = {"stream": idx} is a new dedicated field that enter() passes to torch.fx.traceback.annotate. * target_values = () keeps the positional rebuild contract happy. Then StreamContextVariable.reconstruct_type is overridden to push a 0-arg callable -- functools.partial(torch.cuda.stream, <Stream>) -- installed as a global on the compiled function via OutputGraph.install_global_by_id. The base ContextWrappingVariable.reconstruct appends CALL 0 (target_values is empty), invoking the partial to produce a fresh StreamContext just in time for the resume prologue's BEFORE_WITH. functools.partial (rather than a freshly-defined closure) is critical: dynamo retraces the resume prologue, and a closure defined inside torch/_dynamo would be classified as MOD_SKIPLIST'd and refuse-to-trace, breaking the prologue. functools.partial is a builtin that dynamo handles natively, and the wrapped target (torch.cuda.stream) is plainly traceable. enter() is also inlined (rather than inherited from FxTracebackAnnotateVariable.enter) because the parent passes self.target_values to annotate, but target_values is now the positional rebuild-args tuple; the annotation dict lives on self.annotation. reconstruct_type is overridden alongside to bypass FxTracebackAnnotateVariable.reconstruct_type's unconditional Unsupported raise. Regression test added at test/dynamo/test_streams.py::test_target_values_dict_round_trips_through_graph_break: graph break inside with torch.cuda.stream(s):, asserts two graph fragments are captured (rather than the post-break body being silently dropped to eager). Whole test_streams.py suite: 68 pass, 7 platform-skipped, no regressions. Authored with Claude. Pull Request resolved: #184487 Approved by: https://github.com/williamwen42, https://github.com/mlazos Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…orch#184487) Upstream pytorch#166472 ('[user-streams] Switch to fx annotations at trace time') changed `StreamContextVariable.target_values` from a positional list [stream_var] to a dict {"stream": idx} so that StreamContextVariable.enter() (inherited from FxTracebackAnnotateVariable.enter) could feed it to torch.fx.traceback.annotate. That broke three other consumers of target_values -- output_graph.py's stack_ctx_args / locals_ctx_args population, the base ContextWrappingVariable.reconstruct, and BlockStackEntry.resume_fn -> ReenterWith.try_finally -- all of which iterate it as a positional tuple. tuple({"stream": 3}) flattens to ("stream",): the int index is silently dropped and the rebuild call ends up as e.g. torch.cuda.stream("stream"), which fails with a confusing device-string parse error. The breakage has been latent since pytorch#166472 because FxTracebackAnnotateVariable.reconstruct_type raises Unsupported("torch.fx.traceback.annotate escaped from compiled region") unconditionally, short-circuiting the rebuild before the dict-vs-positional mismatch can surface. The visible symptom is a silent ungraceful graph break that drops the post-break body when a graph break occurs inside with torch.cuda.stream(s):. This fix structurally separates the two purposes of target_values: * self.annotation = {"stream": idx} is a new dedicated field that enter() passes to torch.fx.traceback.annotate. * target_values = () keeps the positional rebuild contract happy. Then StreamContextVariable.reconstruct_type is overridden to push a 0-arg callable -- functools.partial(torch.cuda.stream, <Stream>) -- installed as a global on the compiled function via OutputGraph.install_global_by_id. The base ContextWrappingVariable.reconstruct appends CALL 0 (target_values is empty), invoking the partial to produce a fresh StreamContext just in time for the resume prologue's BEFORE_WITH. functools.partial (rather than a freshly-defined closure) is critical: dynamo retraces the resume prologue, and a closure defined inside torch/_dynamo would be classified as MOD_SKIPLIST'd and refuse-to-trace, breaking the prologue. functools.partial is a builtin that dynamo handles natively, and the wrapped target (torch.cuda.stream) is plainly traceable. enter() is also inlined (rather than inherited from FxTracebackAnnotateVariable.enter) because the parent passes self.target_values to annotate, but target_values is now the positional rebuild-args tuple; the annotation dict lives on self.annotation. reconstruct_type is overridden alongside to bypass FxTracebackAnnotateVariable.reconstruct_type's unconditional Unsupported raise. Regression test added at test/dynamo/test_streams.py::test_target_values_dict_round_trips_through_graph_break: graph break inside with torch.cuda.stream(s):, asserts two graph fragments are captured (rather than the post-break body being silently dropped to eager). Whole test_streams.py suite: 68 pass, 7 platform-skipped, no regressions. Authored with Claude. Pull Request resolved: pytorch#184487 Approved by: https://github.com/williamwen42, https://github.com/mlazos Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…orch#184487) Upstream pytorch#166472 ('[user-streams] Switch to fx annotations at trace time') changed `StreamContextVariable.target_values` from a positional list [stream_var] to a dict {"stream": idx} so that StreamContextVariable.enter() (inherited from FxTracebackAnnotateVariable.enter) could feed it to torch.fx.traceback.annotate. That broke three other consumers of target_values -- output_graph.py's stack_ctx_args / locals_ctx_args population, the base ContextWrappingVariable.reconstruct, and BlockStackEntry.resume_fn -> ReenterWith.try_finally -- all of which iterate it as a positional tuple. tuple({"stream": 3}) flattens to ("stream",): the int index is silently dropped and the rebuild call ends up as e.g. torch.cuda.stream("stream"), which fails with a confusing device-string parse error. The breakage has been latent since pytorch#166472 because FxTracebackAnnotateVariable.reconstruct_type raises Unsupported("torch.fx.traceback.annotate escaped from compiled region") unconditionally, short-circuiting the rebuild before the dict-vs-positional mismatch can surface. The visible symptom is a silent ungraceful graph break that drops the post-break body when a graph break occurs inside with torch.cuda.stream(s):. This fix structurally separates the two purposes of target_values: * self.annotation = {"stream": idx} is a new dedicated field that enter() passes to torch.fx.traceback.annotate. * target_values = () keeps the positional rebuild contract happy. Then StreamContextVariable.reconstruct_type is overridden to push a 0-arg callable -- functools.partial(torch.cuda.stream, <Stream>) -- installed as a global on the compiled function via OutputGraph.install_global_by_id. The base ContextWrappingVariable.reconstruct appends CALL 0 (target_values is empty), invoking the partial to produce a fresh StreamContext just in time for the resume prologue's BEFORE_WITH. functools.partial (rather than a freshly-defined closure) is critical: dynamo retraces the resume prologue, and a closure defined inside torch/_dynamo would be classified as MOD_SKIPLIST'd and refuse-to-trace, breaking the prologue. functools.partial is a builtin that dynamo handles natively, and the wrapped target (torch.cuda.stream) is plainly traceable. enter() is also inlined (rather than inherited from FxTracebackAnnotateVariable.enter) because the parent passes self.target_values to annotate, but target_values is now the positional rebuild-args tuple; the annotation dict lives on self.annotation. reconstruct_type is overridden alongside to bypass FxTracebackAnnotateVariable.reconstruct_type's unconditional Unsupported raise. Regression test added at test/dynamo/test_streams.py::test_target_values_dict_round_trips_through_graph_break: graph break inside with torch.cuda.stream(s):, asserts two graph fragments are captured (rather than the post-break body being silently dropped to eager). Whole test_streams.py suite: 68 pass, 7 platform-skipped, no regressions. Authored with Claude. Pull Request resolved: pytorch#184487 Approved by: https://github.com/williamwen42, https://github.com/mlazos Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…orch#184487) Upstream pytorch#166472 ('[user-streams] Switch to fx annotations at trace time') changed `StreamContextVariable.target_values` from a positional list [stream_var] to a dict {"stream": idx} so that StreamContextVariable.enter() (inherited from FxTracebackAnnotateVariable.enter) could feed it to torch.fx.traceback.annotate. That broke three other consumers of target_values -- output_graph.py's stack_ctx_args / locals_ctx_args population, the base ContextWrappingVariable.reconstruct, and BlockStackEntry.resume_fn -> ReenterWith.try_finally -- all of which iterate it as a positional tuple. tuple({"stream": 3}) flattens to ("stream",): the int index is silently dropped and the rebuild call ends up as e.g. torch.cuda.stream("stream"), which fails with a confusing device-string parse error. The breakage has been latent since pytorch#166472 because FxTracebackAnnotateVariable.reconstruct_type raises Unsupported("torch.fx.traceback.annotate escaped from compiled region") unconditionally, short-circuiting the rebuild before the dict-vs-positional mismatch can surface. The visible symptom is a silent ungraceful graph break that drops the post-break body when a graph break occurs inside with torch.cuda.stream(s):. This fix structurally separates the two purposes of target_values: * self.annotation = {"stream": idx} is a new dedicated field that enter() passes to torch.fx.traceback.annotate. * target_values = () keeps the positional rebuild contract happy. Then StreamContextVariable.reconstruct_type is overridden to push a 0-arg callable -- functools.partial(torch.cuda.stream, <Stream>) -- installed as a global on the compiled function via OutputGraph.install_global_by_id. The base ContextWrappingVariable.reconstruct appends CALL 0 (target_values is empty), invoking the partial to produce a fresh StreamContext just in time for the resume prologue's BEFORE_WITH. functools.partial (rather than a freshly-defined closure) is critical: dynamo retraces the resume prologue, and a closure defined inside torch/_dynamo would be classified as MOD_SKIPLIST'd and refuse-to-trace, breaking the prologue. functools.partial is a builtin that dynamo handles natively, and the wrapped target (torch.cuda.stream) is plainly traceable. enter() is also inlined (rather than inherited from FxTracebackAnnotateVariable.enter) because the parent passes self.target_values to annotate, but target_values is now the positional rebuild-args tuple; the annotation dict lives on self.annotation. reconstruct_type is overridden alongside to bypass FxTracebackAnnotateVariable.reconstruct_type's unconditional Unsupported raise. Regression test added at test/dynamo/test_streams.py::test_target_values_dict_round_trips_through_graph_break: graph break inside with torch.cuda.stream(s):, asserts two graph fragments are captured (rather than the post-break body being silently dropped to eager). Whole test_streams.py suite: 68 pass, 7 platform-skipped, no regressions. Authored with Claude. Pull Request resolved: pytorch#184487 Approved by: https://github.com/williamwen42, https://github.com/mlazos Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Stack from ghstack (oldest at bottom):
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames @Lucaskabela