Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/179649
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New Failures, 4 Unrelated FailuresAs of commit 0b25db7 with merge base a4a69be ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs 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. |
When a pre-partitioned AOT autograd forward graph containing graphsafe_run_with_rng_state is re-traced by make_fx (e.g. when torch.compile wraps an AutoParallel module), the Generator object passed as rng_state could not be serialized into the graph — create_arg raised NotImplementedError for torch._C.Generator. Fix by hoisting Generator objects as module attributes (get_attr nodes) in PythonKeyTracer.create_arg, and teaching Inductor's get_attr handler to produce an ir.GeneratorState backed by torchbind_constants so the Generator is available as a module-level variable in the compiled code. <!-- ps-id: d542629c-9c69-49bd-ac66-a6569e111771 -->
aditvenk
force-pushed
the
ps/rr/_make_fx__handle_torch_generator_in_proxy_tensor_tracing_and_inductor
branch
from
April 8, 2026 00:31
d8524cf to
0b25db7
Compare
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 8, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 21, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 21, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 21, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 21, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 21, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 22, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 22, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 22, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 23, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 24, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 25, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 27, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 27, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 27, 2026
Make compilation a composable, downstream concern: users call
torch.compile() on the module AP returns, optionally using the new
inductor_config() context manager for AP-optimized passes (activation
checkpointing, overlap scheduling).
The key insight is that AP already partitions the joint graph into
fwd/bwd via aot_compile_joint_with_descriptors. The returned module's
forward() is a normal callable -- torch.compile() traces it with
Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's
min-cut partitioner operates on that new graph (not AP's original).
AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather
tagging) are structural after AP's partitioner runs, so they survive
the torch.compile round-trip.
Changes to api.py:
- Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger
parameters from AutoParallel.__init__
- Remove compile parameter from auto_parallel()
- Remove ac_joint_pass call from _apply_placement_common (moved to
inductor_config context manager)
- Run view_to_reshape unconditionally in _apply_placement_common
(previously only ran in the compile path; needed for eager too)
- Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter
wrapper (remove view_to_reshape and overlap scheduling from it)
New file autoparallel/compile.py:
- inductor_config() context manager that sets torch._functorch.config
.joint_custom_pass for AC and torch._inductor.config
.aten_distributed_optimizations.* for overlap scheduling
- Exported from autoparallel.__init__
Examples that previously used compile=True now use:
with inductor_config():
parallel_mod = torch.compile(parallel_mod)
Tests that previously used compile=True are updated similarly.
Three obsolete tests in test_api.py (overlap scheduling under compile,
compile_true smoke test, inference-with-compile) are removed since
they tested the old in-AP compile path.
Depends on pytorch/pytorch#179649 which fixes torch.compile over
pre-partitioned AOTAutograd graphs containing
graphsafe_run_with_rng_state (from selective activation checkpointing).
<!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
aditvenk
added a commit
to meta-pytorch/autoparallel
that referenced
this pull request
Apr 27, 2026
…PI (#415) Make compilation a composable, downstream concern: users call torch.compile() on the module AP returns, optionally using the new inductor_config() context manager for AP-optimized passes (activation checkpointing, overlap scheduling). The key insight is that AP already partitions the joint graph into fwd/bwd via aot_compile_joint_with_descriptors. The returned module's forward() is a normal callable -- torch.compile() traces it with Dynamo, AOTAutograd creates a fresh joint graph, and Inductor's min-cut partitioner operates on that new graph (not AP's original). AC recomputation tags (MUST_RECOMPUTE/MUST_SAVE from FSDP all-gather tagging) are structural after AP's partitioner runs, so they survive the torch.compile round-trip. Changes to api.py: - Remove compile, enable_ac, ac_stage_size_in_GiB, numerics_logger parameters from AutoParallel.__init__ - Remove compile parameter from auto_parallel() - Remove ac_joint_pass call from _apply_placement_common (moved to inductor_config context manager) - Run view_to_reshape unconditionally in _apply_placement_common (previously only ran in the compile path; needed for eager too) - Simplify _boxed_nop_preserve_node_meta to just an FX Interpreter wrapper (remove view_to_reshape and overlap scheduling from it) New file autoparallel/compile.py: - inductor_config() context manager that sets torch._functorch.config .joint_custom_pass for AC and torch._inductor.config .aten_distributed_optimizations.* for overlap scheduling - Exported from autoparallel.__init__ Examples that previously used compile=True now use: with inductor_config(): parallel_mod = torch.compile(parallel_mod) Tests that previously used compile=True are updated similarly. Three obsolete tests in test_api.py (overlap scheduling under compile, compile_true smoke test, inference-with-compile) are removed since they tested the old in-AP compile path. Depends on pytorch/pytorch#179649 which fixes torch.compile over pre-partitioned AOTAutograd graphs containing graphsafe_run_with_rng_state (from selective activation checkpointing). <!-- ps-id: fb58a4ab-f887-4e79-bea8-56ae48f6f36f -->
github-actions
Bot
deleted the
ps/rr/_make_fx__handle_torch_generator_in_proxy_tensor_tracing_and_inductor
branch
May 22, 2026 02:29
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.
When a pre-partitioned AOT autograd forward graph containing graphsafe_run_with_rng_state is re-traced by make_fx (e.g. when torch.compile wraps an AutoParallel module), the Generator object passed as rng_state could not be serialized into the graph — create_arg raised NotImplementedError for torch._C.Generator.
Fix by hoisting Generator objects as module attributes (get_attr nodes) in PythonKeyTracer.create_arg, and teaching Inductor's get_attr handler to produce an ir.GeneratorState backed by torchbind_constants so the Generator is available as a module-level variable in the compiled code.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo