Skip to content

torch.backends.fp32_precision setter propagate to cudnn.conv/rnn#179750

Open
khushali9 wants to merge 8 commits intopytorch:mainfrom
khushali9:fp32_invokeAll
Open

torch.backends.fp32_precision setter propagate to cudnn.conv/rnn#179750
khushali9 wants to merge 8 commits intopytorch:mainfrom
khushali9:fp32_invokeAll

Conversation

@khushali9
Copy link
Copy Markdown
Contributor

@khushali9 khushali9 commented Apr 8, 2026

fixes 179445

issue#1
torch.backends.fp32_precision setter doesn't propagate to cudnn.conv/rnn, I have tried to invoke default to handle this.
issue#2 not resolved as that seems like legit to me. we need to error out if someone tries to use legacy and new API at the same time.
suggested workaround to @ydshieh

Let me know what you think.

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Apr 8, 2026

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 3 Awaiting Approval, 1 Cancelled Job, 1 Unrelated Failure

As of commit f11490c with merge base 781bb5c (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

CANCELLED JOB - The following job was cancelled. Please retry:

BROKEN TRUNK - The following job 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.

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Apr 8, 2026

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@khushali9
Copy link
Copy Markdown
Contributor Author

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Apr 8, 2026
Comment thread torch/backends/cudnn/__init__.py Outdated
Comment thread test/test_cuda.py
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Apr 10, 2026

To add the ciflow label ciflow/h100 please first approve the workflows that are awaiting approval (scroll to the bottom of this page).

This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows.

@pytorch-bot pytorch-bot Bot removed the ciflow/h100 label Apr 10, 2026
@eqy
Copy link
Copy Markdown
Collaborator

eqy commented Apr 10, 2026

@pytorchmergebot label ciflow/h100 ciflow/b200

@khushali9
Copy link
Copy Markdown
Contributor Author

khushali9 commented Apr 10, 2026

@eqy can you rerun the CI , I added another push to fix lint and it got canceled.

@eqy
Copy link
Copy Markdown
Collaborator

eqy commented Apr 10, 2026

@pytorchmergebot ciflow/h100 ciflow/b200

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Apr 10, 2026

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: argument command: invalid choice: 'ciflow/h100' (choose from 'merge', 'revert', 'rebase', 'label', 'drci', 'lint', 'fix-lint', 'apply-lint', 'cherry-pick')

usage: @pytorchbot [-h]
                   
                   {merge,revert,rebase,label,drci,lint,fix-lint,apply-lint,cherry-pick}
                   ...

Try @pytorchbot --help for more info.

@eqy
Copy link
Copy Markdown
Collaborator

eqy commented Apr 10, 2026

@pytorchmergebot label ciflow/h100 ciflow/b200

@khushali9
Copy link
Copy Markdown
Contributor Author

@eqy can you please review it, failing test is timeout and not due to my change. Thanks.

Comment thread aten/src/ATen/Context.h
@soulitzer soulitzer requested a review from ngimel April 15, 2026 16:35
@khushali9
Copy link
Copy Markdown
Contributor Author

@eqy @ngimel can someone please review this, thanks.

Comment thread aten/src/ATen/Context.cpp Outdated
@khushali9 khushali9 requested a review from eqy April 17, 2026 21:38
@khushali9
Copy link
Copy Markdown
Contributor Author

@eqy PR is ready to be reviews, removed some more complexity around test and code. Thanks for pointing it out.

@khushali9
Copy link
Copy Markdown
Contributor Author

@eqy PR is ready to be reviewed again.

Copy link
Copy Markdown
Collaborator

@eqy eqy left a comment

Choose a reason for hiding this comment

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

can you also check in the new test that the default for conv/rnn is tf32 before the decorator?

@khushali9
Copy link
Copy Markdown
Contributor Author

@eqy added test update to check for tf32.

@khushali9
Copy link
Copy Markdown
Contributor Author

@eqy can we merge this. Thanks

@ngimel
Copy link
Copy Markdown
Collaborator

ngimel commented Apr 22, 2026

Can someone provide a tl;dr of what's going on with precision settings - I see constant issues about it, warnings warn about nonexistent things, settings don't work, but I don't have a full picture, and I don't understand which part of the full picture (if any) this PR is fixing

@khushali9
Copy link
Copy Markdown
Contributor Author

Can someone provide a tl;dr of what's going on with precision settings - I see constant issues about it, warnings warn about nonexistent things, settings don't work, but I don't have a full picture, and I don't understand which part of the full picture (if any) this PR is fixing

@ngimel I can give you tldr, basically when we set torch.backends.fp32_precision =ieee, it should set for conv/rnn too , but they were not being set, only cunn, matmul were set automatically.

@khushali9
Copy link
Copy Markdown
Contributor Author

@malfet @eqy I have rebased it, hope tests pass and we can merge this soon. Thanks

@khushali9
Copy link
Copy Markdown
Contributor Author

@malfet @eqy I dont think failures are due to my change, can we merge this ?

@eqy
Copy link
Copy Markdown
Collaborator

eqy commented Apr 23, 2026

@ngimel this PR is hopefully orthogonal to user complaints about warning spam with fp32 precision settings
I think the most egregious warning was already removed some time ago #166956 but still receives (loud) complaints from the community members who are on a older release

I'm trying to migrate some of the remaining uses over soon (tm) #180230

@eqy
Copy link
Copy Markdown
Collaborator

eqy commented Apr 23, 2026

@pytorchmergebot rebase

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Successfully rebased fp32_invokeAll onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout fp32_invokeAll && git pull --rebase)

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.

torch.backends.fp32_precision setter doesn't propagate to cudnn.conv/rnn, and mixed new/legacy API access causes RuntimeError

6 participants