Skip to content

[dynamo] Pin guess_tangent_strides_as_outputs in set_output_grad_dtype tests - #201096

Closed
pianpwk wants to merge 1 commit into
mainfrom
export-D125489641
Closed

pianpwk wants to merge 1 commit into
mainfrom
export-D125489641

Conversation

@pianpwk

@pianpwk pianpwk commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary:
Forward fix for D125399978 (#200311). fbcode sets guess_tangent_strides_as_outputs = not is_fbcode(), so in fbcode the backward copies the gradient with aten::clone instead of empty_strided + copy_, and the inline expected DebugMode traces in test_set_output_grad_dtype and test_set_output_grad_dtype_non_tensor_output don't match.

Pin torch._functorch.config.patch(guess_tangent_strides_as_outputs=True) on both tests, matching existing tests in test_backward_higher_order_ops.py, test_modes.py and test_debug_mode.py.

Test Plan:

buck test fbcode//caffe2/test/dynamo:test_dynamo -- --regex 'test_autograd_function.*test_set_output_grad_dtype'

Differential Revision: D125489641

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @jataylo @azahed98

…e tests

Summary:
Forward fix for D125399978 (#200311). fbcode sets `guess_tangent_strides_as_outputs = not is_fbcode()`, so in fbcode the backward copies the gradient with `aten::clone` instead of `empty_strided` + `copy_`, and the inline expected `DebugMode` traces in `test_set_output_grad_dtype` and `test_set_output_grad_dtype_non_tensor_output` don't match.

Pin `torch._functorch.config.patch(guess_tangent_strides_as_outputs=True)` on both tests, matching existing tests in `test_backward_higher_order_ops.py`, `test_modes.py` and `test_debug_mode.py`.

Test Plan:
```
buck test fbcode//caffe2/test/dynamo:test_dynamo -- --regex 'test_autograd_function.*test_set_output_grad_dtype'
```

Differential Revision: D125489641
@pytorch-bot

pytorch-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit b641d66 with merge base c76cbca (image):
💚 Looks good so far! There are no failures yet. 💚

🟢 GREEN LIGHT - PR approved to be merged without human review:

  • Triviality
    • Meta-internal only: adds torch._functorch.config.patch(guess_tangent_strides_as_outputs=True) to two tests in test/dynamo/test_autograd_function.py
    • OSS default is already True: guess_tangent_strides_as_outputs = not is_fbcode() at torch/_functorch/config.py:424, so the patch only changes fbcode runs
  • Test integrity
    • No assertion, expected trace, or skip changed; the tests now run with the same config in fbcode as in OSS
    • Matches existing pins in test_backward_higher_order_ops.py, test_modes.py, and test_debug_mode.py
  • Scope
    • Test-only diff touching two decorators; no production file changed

reason: clean
Reviewed commit: b641d66

Inference job

🐛 Report a wrong verdict

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-codesync

meta-codesync Bot commented Oct 15, 2026

Copy link
Copy Markdown

@pianpwk has exported this pull request. If you are a Meta employee, you can view the originating Diff in D125489641.

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 15, 2026
@meta-codesync

meta-codesync Bot commented Oct 16, 2026

Copy link
Copy Markdown

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

majing921201 pushed a commit to majing921201/pytorch that referenced this pull request Nov 16, 2026
…e tests (pytorch#201096)

Summary:
Forward fix for D125399978 (pytorch#200311). fbcode sets `guess_tangent_strides_as_outputs = not is_fbcode()`, so in fbcode the backward copies the gradient with `aten::clone` instead of `empty_strided` + `copy_`, and the inline expected `DebugMode` traces in `test_set_output_grad_dtype` and `test_set_output_grad_dtype_non_tensor_output` don't match.

Pin `torch._functorch.config.patch(guess_tangent_strides_as_outputs=True)` on both tests, matching existing tests in `test_backward_higher_order_ops.py`, `test_modes.py` and `test_debug_mode.py`.

Test Plan:
```
buck test fbcode//caffe2/test/dynamo:test_dynamo -- --regex 'test_autograd_function.*test_set_output_grad_dtype'
```

Differential Revision: D125489641

Pull Request resolved: pytorch#201096
Approved by: https://github.com/pytorchgreenlight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants