Skip to content

Conversation

nbroad1881
Copy link
Contributor

@nbroad1881 nbroad1881 commented Apr 16, 2022

The current check version.parse(torch.__version__) < version.parse("1.11") doesn't work if the version has additional stuff after it like 1.11.0a0+17540c5.

New way: version.parse(version.parse(torch.__version__).base_version) < version.parse("1.11")

This change, as suggested by @whoknowsB here, fixes it.

Fixes #16587 and #14375

Who can review?

@LysandreJik
@sgugger

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 16, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

It also properly deals with the dev0 and the likes, so all good to me, thanks for the fix! Could you just apply the same to the line before (is_torch_less_than_1_8) so that next time someone adds a new check like this, they don't hesitate and follow the same model?

@nbroad1881
Copy link
Contributor Author

It also properly deals with the dev0 and the likes, so all good to me, thanks for the fix! Could you just apply the same to the line before (is_torch_less_than_1_8) so that next time someone adds a new check like this, they don't hesitate and follow the same model?

Done.

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

LGTM!

@sgugger sgugger merged commit 51fa719 into main Apr 18, 2022
@sgugger sgugger deleted the torch_less_than_1_11 branch April 18, 2022 17:02
elusenji pushed a commit to elusenji/transformers that referenced this pull request Jun 12, 2022
…ingface#16806)

* use base_version

* make is_torch_less_than_1_8 match 1_11

Co-authored-by: Nicholas Broad <[email protected]>
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.

debert TypeError: _softmax_backward_data(): argument 'input_dtype' (position 4) must be torch.dtype, not Tensor
4 participants