Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[MXFP8] Fix compile test configuration
  • Loading branch information
0z5a committed Nov 4, 2026
commit 638a69de8f4c67bad46769fb864d3649838caf0c
2 changes: 2 additions & 0 deletions tests/unit_tests/gpu/quantization/test_mxfp8_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ def test_mxfp8_linear_runs_outside_plain_eager(
)

if execution_mode == "compile":
# Compiled autograd requires the non-in-place WGRAD path.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment names the wrong mechanism. "Compiled autograd" is a separate feature, and this test doesn't use it. The error comes from uses_inplace_wgrad_accum (torchtitan/models/common/linear/inplace_wgrad_accum.py:54), which raises when torch.compiler.is_compiling() is true. That happens because torch.compile traces the forward, and a traced backward can't read and clear weight.grad. A future reader might go looking for compiled autograd and wonder why it isn't enabled.

Suggested change
# Compiled autograd requires the non-in-place WGRAD path.
# A traced forward cannot add WGRAD into weight.grad in place.

linear.inplace_wgrad_accum = False
output = torch.compile(linear, fullgraph=True)(x)
else:
output = checkpoint(linear, x, use_reentrant=False)
Expand Down