pytorch - 💡(How to fix) Fix Feedback about Reproducibility doc page [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#178587Fetched 2026-04-08 01:40:38
View on GitHub
Comments
1
Participants
2
Timeline
32
Reactions
0
Author
Participants
Timeline (top)
mentioned ×13subscribed ×13labeled ×5commented ×1
RAW_BUFFERClick to expand / collapse

There is the following issue on this page: https://docs.pytorch.org/docs/stable/notes/randomness.html

Could you add or link a section on the reproducibility of the difference SDPBackend attention backends, i.e., MATH, EFFICIENT, etc.? How do these play together with low-precision computing? When can I expect deterministic results?

cc @svekars @sekyondaMeta @AlannaBurke @drisspg @liangel-02 @howardzhang-cv

extent analysis

Fix Plan

To address the issue, we will add a section on the reproducibility of SDPBackend attention backends in the PyTorch documentation.

Steps

  • Add a new section to the randomness notes page: https://docs.pytorch.org/docs/stable/notes/randomness.html
  • Describe the different SDPBackend attention backends (MATH, EFFICIENT, etc.) and their effects on reproducibility
  • Discuss how these backends interact with low-precision computing
  • Provide examples of when to expect deterministic results

Example Code

import torch

# Set the SDPBackend to MATH for deterministic results
torch.backends.cuda.matmul.allow_tf32 = False
torch.backends.cudnn.deterministic = True

# Set the SDPBackend to EFFICIENT for faster computation
torch.backends.cuda.matmul.allow_tf32 = True
torch.backends.cudnn.deterministic = False

Verification

To verify the fix, check the updated documentation for clarity and accuracy. Test the code snippets to ensure they produce the expected results.

Extra Tips

  • When using low-precision computing, be aware of potential trade-offs between speed and accuracy.
  • Always set the torch.backends.cudnn.deterministic flag to True when requiring deterministic results.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING