Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time to Say Goodbye, torch 1.7 and 1.8 #22291

Merged
merged 4 commits into from
Mar 21, 2023
Merged

Time to Say Goodbye, torch 1.7 and 1.8 #22291

merged 4 commits into from
Mar 21, 2023

Conversation

ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Mar 21, 2023

What does this PR do?

We have been together for more than 2 years ❤️

(see this discussion)

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.

There is a bit more work to do ;-) The goal of pinning a minimum version is to remove all the code specific to older PyTorch versions.

In this case I haven't caught some PyTorch 1.7 specific code but there are a lot of PyTorch 1.8-specific code. In particular we can replace all instance of torch_int_div which was there to execute a different line depending on the version.

@ydshieh
Copy link
Collaborator Author

ydshieh commented Mar 21, 2023

Thank you @sgugger . I will try to make a clean breakup

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 21, 2023

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

@ydshieh ydshieh marked this pull request as draft March 21, 2023 15:15
@ydshieh ydshieh changed the title Time to Say Goodbye, torch 1.7 and 1.8 [WIP] Time to Say Goodbye, torch 1.7 and 1.8 Mar 21, 2023
@ydshieh ydshieh marked this pull request as ready for review March 21, 2023 16:08
@ydshieh ydshieh changed the title [WIP] Time to Say Goodbye, torch 1.7 and 1.8 Time to Say Goodbye, torch 1.7 and 1.8 Mar 21, 2023
@ydshieh
Copy link
Collaborator Author

ydshieh commented Mar 21, 2023

Hope I don't miss anything

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

LGTM!

Parting is such sweet sorrow, but it's time to say goodbye torch < 1.9 🥲

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.

Thanks a lot! Diving into the codebase a bit more, I see a test for PyTorch 1.8.0 in onnx.convert (and anything using TORCH_ONNX_DICT_INPUTS_MINIMUM_VERSION which is 1.8.0).

In modeling_utils there are also some require_version_core("torch>=1.9") which can now be removed.

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.

Thanks again!

@stas00
Copy link
Contributor

stas00 commented Mar 22, 2023

ok, the deepspeed CI is running pt-1.8 - how do we solve that then?

I have passed this change to the Deepspeed team let's see what they say.

edit: they followed suit microsoft/DeepSpeed#3082

raghavanone pushed a commit to raghavanone/transformers that referenced this pull request Apr 5, 2023
* time to say goodbye, torch 1.7 and 1.8

* clean up torch_int_div

* clean up is_torch_less_than_1_8-9

* update

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
* time to say goodbye, torch 1.7 and 1.8

* clean up torch_int_div

* clean up is_torch_less_than_1_8-9

* update

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
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.

None yet

5 participants