Skip to content

Revert 45777#45942

Merged
Rocketknight1 merged 1 commit into
mainfrom
revert-45777-conftest-tf32
May 13, 2026
Merged

Revert 45777#45942
Rocketknight1 merged 1 commit into
mainfrom
revert-45777-conftest-tf32

Conversation

@Rocketknight1

@Rocketknight1 Rocketknight1 commented May 13, 2026

Copy link
Copy Markdown
Member

#45777 removed some lines in the conftest which work around a torch issue, but the Torch fix hasn't propagated through to our CI version of Torch yet, so we need to put them back for now!

cc @vasqu

@Rocketknight1 Rocketknight1 marked this pull request as ready for review May 13, 2026 12:26

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you!

Comment thread conftest.py
# The flag below controls whether to allow TF32 on cuDNN. This flag defaults to True.
# We set it to `False` for CI. See https://github.com/pytorch/pytorch/issues/157274#issuecomment-3090791615
enable_tf32(False)
# # torch.backends.fp32_precision does not cascade to torch.backends.cudnn.conv.fp32_precision and torch.backends.cudnn.rnn.fp32_precision

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could we check the torch version for this block where the fix exists?

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.

@vasqu It is already taken care inside the enable_tf32 method that I added.

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.

Took care of it in new fix. :)

@Rocketknight1

Copy link
Copy Markdown
Member Author

cc @ydshieh @khushali9, what version of Torch do we need in the CI before we can remove those lines again?

@Rocketknight1 Rocketknight1 enabled auto-merge May 13, 2026 12:34
@Rocketknight1 Rocketknight1 added this pull request to the merge queue May 13, 2026
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Merged via the queue into main with commit edcdeb5 May 13, 2026
34 checks passed
@Rocketknight1 Rocketknight1 deleted the revert-45777-conftest-tf32 branch May 13, 2026 12:40
@ydshieh

ydshieh commented May 13, 2026

Copy link
Copy Markdown
Collaborator

it's torch 2.12, not released yet I think

@khushali9

khushali9 commented May 13, 2026

Copy link
Copy Markdown
Contributor

@Rocketknight1 I checked it is not 2.12 but the next release 2.13 on June 8. I will keep a check and create my PR again to have it merge once Pytorch version is released. cc @ydshieh Thanks!

@ydshieh

ydshieh commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Oh yes, sorry indeed 2.13. Thank you for handling it.

You can use is_torch_greater_or_equal from src/transformers/utils/__init__.py that is defined in src/transformers/utils/import_utils.py

@khushali9

khushali9 commented May 14, 2026

Copy link
Copy Markdown
Contributor

Sure @ydshieh thanks

jp1924 pushed a commit to jp1924/transformers that referenced this pull request May 18, 2026
khushali9 pushed a commit to khushali9/transformers that referenced this pull request Jun 8, 2026
@khushali9

Copy link
Copy Markdown
Contributor

@ydshieh I checked pytorch 2.13 release is not out yet, I am keeping an eye, I will make this changes as soon as they have release out.

@khushali9

khushali9 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@ydshieh my PR is out as Pytorch has 2.13 release with my bug fixes in. Also kept version aware fix in as you mentioned earlier. #47222 Can you review it. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants