Skip to content

[DTensor][autograd] Preserve DTensor type for the gradients of unused output - #173295

Closed
fegin wants to merge 19 commits into
gh/fegin/336/basefrom
gh/fegin/336/head
Closed

fegin wants to merge 19 commits into
gh/fegin/336/basefrom
gh/fegin/336/head

Conversation

@fegin

@fegin fegin commented Jan 24, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

This is a tentative fix to #173123 and the issue encountered in #169393, following the fix to NJT, #136875. When a DTensor is detected, zeros_like() will be used to create the zero gradients to preserve the tensor subclass type.

When an op has multiple outputs but not all are used (e.g., LSE for FlexAttention), autograd will materialize the gradient of the unused output as a zero tensor. But autograd doesn't respect the tensor subclass. In our case, the q, k, v to FlexAttention are all DTensors, hence the outputs of FlexAttention, including LSE, are all DTensors. But LSE is not always used (depending on the model), which results in errors in both eager mode and compiler mode.

In eager mode, DTensor complains users mix torch.Tensor with DTensor in some computation. In compiler mode, compiler raises an exception due to an expected metadata mismatch.

Semantically this fix is correct since we should not upcast a tensor back to a plain tensor. To limit the blast area, we specifically detect DTensor rather than all tensor subclasses, to avoid affecting other subclasses that may not need this behavior.

Conclusion
Based on the discussion with @drisspg, @bdhirsh, @soulitzer, @wconstab, we can land this PR as we limit the PR to DTensor only. But we also need to add a warning to indicate the potential performance issue and point out the solution to remove the zeros_like(). The warning will also print out the backward name so that users can debug.

cc @wanchaol @tianyu-l @wz337 @XilunWu @d4l3k @pragupta @SherlockNoMad @ppwwyyxx @weifengpy

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jan 24, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/173295

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure, 4 Cancelled Jobs, 23 Unrelated Failures

As of commit c6c5767 with merge base babfa88 (image):

NEW FAILURE - The following job has failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

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.

fegin added a commit that referenced this pull request Jan 24, 2026
…radients

This is a tentative fix to #173123 and the issue encountered in #169393, following the fix to NJT, #136875. When a tensor subclass is detected, e.g., DTensor, zeros_like() will be used to create the zero gradients.

When an op has multiple outputs but not all are used (e.g., LSE for FlexAttention), autograd will materialize the gradient of the unused output as a zero tensor. But autograd  doesn't respect the tensor subclass. In our case, the q, k, v to FlexAttention are all DTensors, hence the outputs of FlexAttention, including LSE, are all DTensors. But LSE is not always used (depending on the model), which results in errors in both eager mode and compiler mode.

In eager mode, DTensor complains users mix torch.Tensor with DTensor in some computation. In compiler mode, compiler raises an exception due to an expected metadata mismatch.

Semantically this fix is correct since we should not upcast a tensor back to a plain tensor. However, the blast area is quite big as all tensor subclasses will be affected. An alternative is that we detect whether the tensor subclass is DTensor and only perform this fix for DTensor.  However, even for DTensor, we need to verify the implication when the sharding of the unused output is partial.


ghstack-source-id: 5cf0443
Pull-Request: #173295
@fegin
fegin requested review from bdhirsh, drisspg and wconstab January 24, 2026 20:34
@fegin

fegin commented Jan 24, 2026

Copy link
Copy Markdown
Contributor Author

Just noticed that #173175 was also created to fix. We can use either one.

@aaron-seq aaron-seq left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The implementation correctly identifies the need to preserve tensor subclass types for unused gradients, but the detection mechanism is too broad, causing 19 test failures.

Root cause:
Using is_python_dispatch() (line 783) catches all Python dispatch tensors, including functorch's internal tensors (FakeTensor, AOTAutograd wrappers). When zeros_like() is applied to these tensors instead of creating plain zero tensors, it alters gradient materialization behavior and breaks functorch's input mutation tracking.

Failing tests:

  • 18 failures in test/functorch/test_aotdispatch.py (input mutation tests)
  • 1 failure in test/test_autograd.py::test_undefined_grad_with_tensor_subclass (the new test added in this PR)

Recommendation:
Replace the broad is_python_dispatch() check with more specific detection for DTensor and other tensor subclasses that require zeros_like() preservation. Consider checking for specific subclass types or adding a trait that indicates whether a tensor subclass needs preserved zero gradient behavior, rather than applying this to all Python dispatch tensors.

Comment thread torch/csrc/autograd/python_function.cpp Resolved
[ghstack-poisoned]
fegin added a commit that referenced this pull request Jan 28, 2026
…d DTensor outputs

This is a tentative fix to #173123 and the issue encountered
in #169393, following the fix to NJT, #136875. When a DTensor is detected, zeros_like() will be used to create the zero gradients to preserve the tensor subclass type.

When an op has multiple outputs but not all are used (e.g., LSE for FlexAttention), autograd will materialize the gradient of the unused output as a zero tensor. But autograd doesn't respect the tensor   subclass. In our case, the q, k, v to FlexAttention are all DTensors, hence the outputs of FlexAttention, including LSE, are all DTensors. But LSE is not always used (depending on the model), which results in errors in both eager mode and compiler mode.

In eager mode, DTensor complains users mix torch.Tensor with DTensor in some computation. In compiler mode, compiler raises an exception due to an expected metadata mismatch.

Semantically this fix is correct since we should not upcast a tensor back to a plain tensor. To limit the blast area, we specifically detect DTensor rather than all tensor subclasses, to avoid affecting other subclasses that may not need this behavior. Even for DTensor, we need to verify the implication when the sharding of the unused output is partial.

ghstack-source-id: d1eebc9
Pull-Request: #173295
[ghstack-poisoned]
fegin added a commit that referenced this pull request Jan 28, 2026
…d DTensor outputs

This is a tentative fix to #173123 and the issue encountered
in #169393, following the fix to NJT, #136875. When a DTensor is detected, zeros_like() will be used to create the zero gradients to preserve the tensor subclass type.

When an op has multiple outputs but not all are used (e.g., LSE for FlexAttention), autograd will materialize the gradient of the unused output as a zero tensor. But autograd doesn't respect the tensor   subclass. In our case, the q, k, v to FlexAttention are all DTensors, hence the outputs of FlexAttention, including LSE, are all DTensors. But LSE is not always used (depending on the model), which results in errors in both eager mode and compiler mode.

In eager mode, DTensor complains users mix torch.Tensor with DTensor in some computation. In compiler mode, compiler raises an exception due to an expected metadata mismatch.

Semantically this fix is correct since we should not upcast a tensor back to a plain tensor. To limit the blast area, we specifically detect DTensor rather than all tensor subclasses, to avoid affecting other subclasses that may not need this behavior. Even for DTensor, we need to verify the implication when the sharding of the unused output is partial.

ghstack-source-id: b2e053e
Pull-Request: #173295
@fegin fegin changed the title [DTensor][autograd] Preserve tensor subclass type for unused output gradients [DTensor][autograd] Preserve DTensor type for unused output gradients Jan 28, 2026
@fegin fegin changed the title [DTensor][autograd] Preserve DTensor type for unused output gradients [DTensor][autograd] Preserve DTensor type for the gradients of unused output Jan 28, 2026
@fegin fegin added module: dtensor distributed tensor tag release notes: distributed (dtensor) release notes category labels Jan 28, 2026
[ghstack-poisoned]
fegin added a commit that referenced this pull request Jan 28, 2026
…d DTensor outputs

This is a tentative fix to #173123 and the issue encountered
in #169393, following the fix to NJT, #136875. When a DTensor is detected, zeros_like() will be used to create the zero gradients to preserve the tensor subclass type.

When an op has multiple outputs but not all are used (e.g., LSE for FlexAttention), autograd will materialize the gradient of the unused output as a zero tensor. But autograd doesn't respect the tensor   subclass. In our case, the q, k, v to FlexAttention are all DTensors, hence the outputs of FlexAttention, including LSE, are all DTensors. But LSE is not always used (depending on the model), which results in errors in both eager mode and compiler mode.

In eager mode, DTensor complains users mix torch.Tensor with DTensor in some computation. In compiler mode, compiler raises an exception due to an expected metadata mismatch.

Semantically this fix is correct since we should not upcast a tensor back to a plain tensor. To limit the blast area, we specifically detect DTensor rather than all tensor subclasses, to avoid affecting other subclasses that may not need this behavior. Even for DTensor, we need to verify the implication when the sharding of the unused output is partial.

ghstack-source-id: 55ea9c0
Pull-Request: #173295
[ghstack-poisoned]
fegin added a commit that referenced this pull request Jan 28, 2026
…d DTensor outputs

This is a tentative fix to #173123 and the issue encountered
in #169393, following the fix to NJT, #136875. When a DTensor is detected, zeros_like() will be used to create the zero gradients to preserve the tensor subclass type.

When an op has multiple outputs but not all are used (e.g., LSE for FlexAttention), autograd will materialize the gradient of the unused output as a zero tensor. But autograd doesn't respect the tensor   subclass. In our case, the q, k, v to FlexAttention are all DTensors, hence the outputs of FlexAttention, including LSE, are all DTensors. But LSE is not always used (depending on the model), which results in errors in both eager mode and compiler mode.

In eager mode, DTensor complains users mix torch.Tensor with DTensor in some computation. In compiler mode, compiler raises an exception due to an expected metadata mismatch.

Semantically this fix is correct since we should not upcast a tensor back to a plain tensor. To limit the blast area, we specifically detect DTensor rather than all tensor subclasses, to avoid affecting other subclasses that may not need this behavior. Even for DTensor, we need to verify the implication when the sharding of the unused output is partial.

ghstack-source-id: 620c374
Pull-Request: #173295
[ghstack-poisoned]
fegin added a commit that referenced this pull request Jan 29, 2026
…d DTensor outputs

This is a tentative fix to #173123 and the issue encountered
in #169393, following the fix to NJT, #136875. When a DTensor is detected, zeros_like() will be used to create the zero gradients to preserve the tensor subclass type.

When an op has multiple outputs but not all are used (e.g., LSE for FlexAttention), autograd will materialize the gradient of the unused output as a zero tensor. But autograd doesn't respect the tensor   subclass. In our case, the q, k, v to FlexAttention are all DTensors, hence the outputs of FlexAttention, including LSE, are all DTensors. But LSE is not always used (depending on the model), which results in errors in both eager mode and compiler mode.

In eager mode, DTensor complains users mix torch.Tensor with DTensor in some computation. In compiler mode, compiler raises an exception due to an expected metadata mismatch.

Semantically this fix is correct since we should not upcast a tensor back to a plain tensor. To limit the blast area, we specifically detect DTensor rather than all tensor subclasses, to avoid affecting other subclasses that may not need this behavior. Even for DTensor, we need to verify the implication when the sharding of the unused output is partial.

ghstack-source-id: d076810
Pull-Request: #173295
[ghstack-poisoned]
fegin added a commit that referenced this pull request Jan 29, 2026
…d DTensor outputs

This is a tentative fix to #173123 and the issue encountered
in #169393, following the fix to NJT, #136875. When a DTensor is detected, zeros_like() will be used to create the zero gradients to preserve the tensor subclass type.

When an op has multiple outputs but not all are used (e.g., LSE for FlexAttention), autograd will materialize the gradient of the unused output as a zero tensor. But autograd doesn't respect the tensor   subclass. In our case, the q, k, v to FlexAttention are all DTensors, hence the outputs of FlexAttention, including LSE, are all DTensors. But LSE is not always used (depending on the model), which results in errors in both eager mode and compiler mode.

In eager mode, DTensor complains users mix torch.Tensor with DTensor in some computation. In compiler mode, compiler raises an exception due to an expected metadata mismatch.

Semantically this fix is correct since we should not upcast a tensor back to a plain tensor. To limit the blast area, we specifically detect DTensor rather than all tensor subclasses, to avoid affecting other subclasses that may not need this behavior. Even for DTensor, we need to verify the implication when the sharding of the unused output is partial.

ghstack-source-id: 9b7d176
Pull-Request: #173295
@fegin
fegin requested a review from wconstab January 29, 2026 07:40

@soulitzer soulitzer left a comment

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.

Thanks, add some small comments.

Comment thread torch/csrc/autograd/python_function.cpp Resolved
Comment thread torch/csrc/autograd/python_function.cpp Outdated
cdata->name(),
". This preserves the DTensor type but may have performance "
"implications. To avoid this: (1) call "
"ctx.set_materialize_grads(False) in forward() (only works when "

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.

Suggesting a different wording here:

To avoid this:

  1. If you are in eager (e.g. the name of the autograd.Function is not CompiledFunction) it means that one of the outputs of your autograd.Function is unused. You can call ctx.set_materialize_grads(False) in the forward() and update the backward() to handle potential None gradients.
  2. If you are in compile, it means that one of the outputs to the compiled region is unused. You should detach() any outputs that are unused and explicitly or implicitly (i.e., saved as a global) returned from the compiled region.

pytorchmergebot added a commit that referenced this pull request Feb 7, 2026
pytorchmergebot added a commit that referenced this pull request Feb 7, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@fegin your PR has been successfully reverted.

@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Feb 7, 2026
[ghstack-poisoned]
[ghstack-poisoned]
def test_multi_layer_memory_usage_with_zeros_like(self):
"""
Test memory usage when multiple layers each use MultiOutputFunc with
an unused DTensor output. Selective activation checkpointing (SAC) is

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.

The SAC interaction is pretty orthogonal imo, to make the intent of the test clearer, just test w/o SAC, and check that the output is not saved?

self->output_info.emplace_back(wrapped_output.value(), use_zeros_like);
bool output_is_dtensor = is_dtensor(obj);
bool output_is_nested = wrapped_output->is_nested();
bool use_zeros_like = is_differentiable && num_outputs > 1 &&

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.

Do we want to combine the next PR (num_outputs = 1 case) into this one?

@soulitzer soulitzer left a comment

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.

Thanks! Added minor comments

// For DTensor, this preserves the mesh and placements while using minimal
// memory (just a single element instead of the full tensor).
// We use new_zeros({}) to create a scalar with the same type/subclass.
template_var = var.new_zeros({}).detach();

@soulitzer soulitzer Feb 11, 2026 •

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.

Detach before new_zeros

Suggested change
template_var = var.new_zeros({}).detach();
template_var = var.detach().new_zeros({});

[ghstack-poisoned]
fegin added a commit that referenced this pull request Feb 18, 2026
…d DTensor outputs

This is a tentative fix to #173123 and the issue encountered
in #169393, following the fix to NJT, #136875. When a DTensor is detected, zeros_like() will be used to create the zero gradients to preserve the tensor subclass type.

When an op has multiple outputs but not all are used (e.g., LSE for FlexAttention), autograd will materialize the gradient of the unused output as a zero tensor. But autograd doesn't respect the tensor   subclass. In our case, the q, k, v to FlexAttention are all DTensors, hence the outputs of FlexAttention, including LSE, are all DTensors. But LSE is not always used (depending on the model), which results in errors in both eager mode and compiler mode.

In eager mode, DTensor complains users mix torch.Tensor with DTensor in some computation. In compiler mode, compiler raises an exception due to an expected metadata mismatch.

Semantically this fix is correct since we should not upcast a tensor back to a plain tensor. To limit the blast area, we specifically detect DTensor rather than all tensor subclasses, to avoid affecting other subclasses that may not need this behavior. Even for DTensor, we need to verify the implication when the sharding of the unused output is partial.

ghstack-source-id: 6e071e0
Pull-Request: #173295
[ghstack-poisoned]
fegin added a commit that referenced this pull request Feb 19, 2026
…d DTensor outputs

This is a tentative fix to #173123 and the issue encountered
in #169393, following the fix to NJT, #136875. When a DTensor is detected, zeros_like() will be used to create the zero gradients to preserve the tensor subclass type.

When an op has multiple outputs but not all are used (e.g., LSE for FlexAttention), autograd will materialize the gradient of the unused output as a zero tensor. But autograd doesn't respect the tensor   subclass. In our case, the q, k, v to FlexAttention are all DTensors, hence the outputs of FlexAttention, including LSE, are all DTensors. But LSE is not always used (depending on the model), which results in errors in both eager mode and compiler mode.

In eager mode, DTensor complains users mix torch.Tensor with DTensor in some computation. In compiler mode, compiler raises an exception due to an expected metadata mismatch.

Semantically this fix is correct since we should not upcast a tensor back to a plain tensor. To limit the blast area, we specifically detect DTensor rather than all tensor subclasses, to avoid affecting other subclasses that may not need this behavior. Even for DTensor, we need to verify the implication when the sharding of the unused output is partial.

ghstack-source-id: 0d5548d
Pull-Request: #173295
pytorchmergebot pushed a commit that referenced this pull request Feb 19, 2026
…unctions (#173865)

When an autograd function has multiple outputs but only some are used, the gradients for unused
outputs are None. By default, autograd materializes these as zero tensors.

#173295 improved this for DTensor outputs by using zeros_like() to preserve the DTensor type.  However, #173295 doesn't work with from_local(). When autograd materializes a zero gradient for from_local, it creates a plain torch.Tensor, which causes a type mismatch error when mixed with DTensor in subsequent computations.

This PR updates both from_local and to_local to explicitly handle None gradients in their backward
functions, avoiding reliance on autograd's default materialization behavior.
Pull Request resolved: #173865
Approved by: https://github.com/soulitzer, https://github.com/wconstab
radeksm pushed a commit to radeksm/pytorch that referenced this pull request Feb 20, 2026
… output (pytorch#173295)

This is a tentative fix to pytorch#173123 and the issue encountered in pytorch#169393, following the fix to NJT, pytorch#136875. When a DTensor is detected, zeros_like() will be used to create the zero gradients to preserve the tensor subclass type.

When an op has multiple outputs but not all are used (e.g., LSE for FlexAttention), autograd will materialize the gradient of the unused output as a zero tensor. But autograd doesn't respect the tensor   subclass. In our case, the q, k, v to FlexAttention are all DTensors, hence the outputs of FlexAttention, including LSE, are all DTensors. But LSE is not always used (depending on the model), which results in errors in both eager mode and compiler mode.

In eager mode, DTensor complains users mix torch.Tensor with DTensor in some computation. In compiler mode, compiler raises an exception due to an expected metadata mismatch.

Semantically this fix is correct since we should not upcast a tensor back to a plain tensor. To limit the blast area, we specifically detect DTensor rather than all tensor subclasses, to avoid affecting other subclasses that may not need this behavior.

**Conclusion**
Based on the discussion with @drisspg, @bdhirsh, @soulitzer, @wconstab, we can land this PR as we limit the PR to DTensor only. But we also need to add a warning to indicate the potential performance issue and point out the solution to remove the zeros_like(). The warning will also print out the backward name so that users can debug.

Pull Request resolved: pytorch#173295
Approved by: https://github.com/soulitzer
radeksm pushed a commit to radeksm/pytorch that referenced this pull request Feb 20, 2026
…unctions (pytorch#173865)

When an autograd function has multiple outputs but only some are used, the gradients for unused
outputs are None. By default, autograd materializes these as zero tensors.

pytorch#173295 improved this for DTensor outputs by using zeros_like() to preserve the DTensor type.  However, pytorch#173295 doesn't work with from_local(). When autograd materializes a zero gradient for from_local, it creates a plain torch.Tensor, which causes a type mismatch error when mixed with DTensor in subsequent computations.

This PR updates both from_local and to_local to explicitly handle None gradients in their backward
functions, avoiding reliance on autograd's default materialization behavior.
Pull Request resolved: pytorch#173865
Approved by: https://github.com/soulitzer, https://github.com/wconstab
ghstack dependencies: pytorch#173295
radeksm pushed a commit to radeksm/pytorch that referenced this pull request Feb 20, 2026
radeksm pushed a commit to radeksm/pytorch that referenced this pull request Feb 20, 2026
norx1991 pushed a commit that referenced this pull request Feb 24, 2026
…unctions (#173865)

When an autograd function has multiple outputs but only some are used, the gradients for unused
outputs are None. By default, autograd materializes these as zero tensors.

#173295 improved this for DTensor outputs by using zeros_like() to preserve the DTensor type.  However, #173295 doesn't work with from_local(). When autograd materializes a zero gradient for from_local, it creates a plain torch.Tensor, which causes a type mismatch error when mixed with DTensor in subsequent computations.

This PR updates both from_local and to_local to explicitly handle None gradients in their backward
functions, avoiding reliance on autograd's default materialization behavior.
Pull Request resolved: #173865
Approved by: https://github.com/soulitzer, https://github.com/wconstab
@albanD
albanD removed their request for review March 27, 2026 18:15
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
…unctions (pytorch#173865)

When an autograd function has multiple outputs but only some are used, the gradients for unused
outputs are None. By default, autograd materializes these as zero tensors.

pytorch#173295 improved this for DTensor outputs by using zeros_like() to preserve the DTensor type.  However, pytorch#173295 doesn't work with from_local(). When autograd materializes a zero gradient for from_local, it creates a plain torch.Tensor, which causes a type mismatch error when mixed with DTensor in subsequent computations.

This PR updates both from_local and to_local to explicitly handle None gradients in their backward
functions, avoiding reliance on autograd's default materialization behavior.
Pull Request resolved: pytorch#173865
Approved by: https://github.com/soulitzer, https://github.com/wconstab
@github-actions

Copy link
Copy Markdown
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions Bot added the Stale label May 26, 2026
@pytorch-bot pytorch-bot Bot added the ciflow/dtensor Run DTensor specific tests label May 26, 2026
@github-actions github-actions Bot closed this Jun 26, 2026
@github-actions
github-actions Bot deleted the gh/fegin/336/head branch July 27, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/dtensor Run DTensor specific tests ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged module: dtensor distributed tensor tag release notes: distributed (dtensor) release notes category Reverted Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants