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

PyTorch and Torchvision version update #1216

Merged
merged 45 commits into from
Jan 24, 2025

Conversation

tanwarsh
Copy link
Collaborator

@tanwarsh tanwarsh commented Dec 16, 2024

Update PyTorch to version 2.4.1 and Torchvision to version 0.19.1.

Fix for #1075.

@tanwarsh
Copy link
Collaborator Author

tanwarsh commented Dec 18, 2024

Pipelines are facing Issue pytorch/pytorch#140914.

@tanwarsh tanwarsh changed the title WIP: PyTorch and Torchvision version update PyTorch and Torchvision version update Dec 18, 2024
@kta-intel
Copy link
Collaborator

Pipelines are facing Issue pytorch/pytorch#140914.

Thanks for raising the issue. Can you look into the possibility of adding the monkey patch to openfl.interface.cli?
I didn't do any extensive testing on the e2e functionality, but it got past the TypeError

pytorch/pytorch#140914 (comment)

If it works, we can maybe implement it while we wait for a more robust upstream solution, or we can investigate where/how pip._vendor.typing_extensions is being forcibly called for a more robust solution in our code base

@tanwarsh
Copy link
Collaborator Author

Pipelines are facing Issue pytorch/pytorch#140914.

Thanks for raising the issue. Can you look into the possibility of adding the monkey patch to openfl.interface.cli? I didn't do any extensive testing on the e2e functionality, but it got past the TypeError

pytorch/pytorch#140914 (comment)

If it works, we can maybe implement it while we wait for a more robust upstream solution, or we can investigate where/how pip._vendor.typing_extensions is being forcibly called for a more robust solution in our code base

Thank you @kta-intel. Workaround patch worked.

@kta-intel
Copy link
Collaborator

kta-intel commented Jan 8, 2025

@MasterSkepticista @kta-intel, We are using version 2.4.1 now without patch. Please review again.

Thanks for checking into that @tanwarsh. Glad 2.4.1 is not raising the TypeError issue. My open now is if downgrading setuptools is the path we want to go. Even if we're able to justify it for a release, if we're stuck at 59.6.0 going forward with torch workloads, that could be unsustainable long term

@tanwarsh
Copy link
Collaborator Author

@MasterSkepticista @kta-intel, We are using version 2.4.1 now without patch. Please review again.

Thanks for checking into that @tanwarsh. Glad 2.4.1 is not raising the TypeError issue. My open now is if downgrading setuptools is the path we want to go. Even if we're able to justify it for a release, if we're stuck at 59.6.0 going forward with torch workloads, that could be unsustainable long term

@kta-intel , I tried few things, trying different version and patches suggested in few issues logged in setuptools github repo but none of them are working. Looks like we are stuck with this solution.

@tanwarsh
Copy link
Collaborator Author

@psfoley @kta-intel @teoparvanov @rahulga1,
There are two solutions for the issue with Setuptools:

  1. Pin Setuptools to version 59.6.0, which has a vulnerability issue. EXCEPTION : /python3.11/distutils/core.py pytorch/pytorch#143288.
  2. Apply a patch to use the latest version of Setuptools (current changes).

Please review this PR and share your thoughts so that we can move forward.

@kta-intel
Copy link
Collaborator

@psfoley @kta-intel @teoparvanov @rahulga1, There are two solutions for the issue with Setuptools:

  1. Pin Setuptools to version 59.6.0, which has a vulnerability issue. EXCEPTION : /python3.11/distutils/core.py pytorch/pytorch#143288.
  2. Apply a patch to use the latest version of Setuptools (current changes).

Please review this PR and share your thoughts so that we can move forward.

I am okay with the patch for now, though we should keep it in the backlog to look for a more robust solution
Btw, do you know if this will break older versions (i.e. torch=2.3)?

@tanwarsh
Copy link
Collaborator Author

@psfoley @kta-intel @teoparvanov @rahulga1, There are two solutions for the issue with Setuptools:

  1. Pin Setuptools to version 59.6.0, which has a vulnerability issue. EXCEPTION : /python3.11/distutils/core.py pytorch/pytorch#143288.
  2. Apply a patch to use the latest version of Setuptools (current changes).

Please review this PR and share your thoughts so that we can move forward.

I am okay with the patch for now, though we should keep it in the backlog to look for a more robust solution Btw, do you know if this will break older versions (i.e. torch=2.3)?

This issue is not seen in torch==2.3.1, but the PR is to update torch from 2.3.1 because we were facing this issue #1075

@kta-intel
Copy link
Collaborator

@psfoley @kta-intel @teoparvanov @rahulga1, There are two solutions for the issue with Setuptools:

  1. Pin Setuptools to version 59.6.0, which has a vulnerability issue. EXCEPTION : /python3.11/distutils/core.py pytorch/pytorch#143288.
  2. Apply a patch to use the latest version of Setuptools (current changes).

Please review this PR and share your thoughts so that we can move forward.

I am okay with the patch for now, though we should keep it in the backlog to look for a more robust solution Btw, do you know if this will break older versions (i.e. torch=2.3)?

This issue is not seen in torch==2.3.1, but the PR is to update torch from 2.3.1 because we were facing this issue #1075

I was asking if patching os.environ["SETUPTOOLS_USE_DISTUTILS"] = "stdlib" would affect torch==2.3.1. If so, we should make note of it in a "known issues" section that a user would have to patch to local in their own application if they cannot upgrade, since we cannot expect a user to modify framework-level code, such as openfl/federated/__init__.py. But it doesn't, then it is no problem

@tanwarsh
Copy link
Collaborator Author

@psfoley @kta-intel @teoparvanov @rahulga1, There are two solutions for the issue with Setuptools:

  1. Pin Setuptools to version 59.6.0, which has a vulnerability issue. EXCEPTION : /python3.11/distutils/core.py pytorch/pytorch#143288.
  2. Apply a patch to use the latest version of Setuptools (current changes).

Please review this PR and share your thoughts so that we can move forward.

I am okay with the patch for now, though we should keep it in the backlog to look for a more robust solution Btw, do you know if this will break older versions (i.e. torch=2.3)?

This issue is not seen in torch==2.3.1, but the PR is to update torch from 2.3.1 because we were facing this issue #1075

I was asking if patching os.environ["SETUPTOOLS_USE_DISTUTILS"] = "stdlib" would affect torch==2.3.1. If so, we should make note of it in a "known issues" section that a user would have to patch to local in their own application if they cannot upgrade, since we cannot expect a user to modify framework-level code, such as openfl/federated/__init__.py. But it doesn't, then it is no problem

@kta-intel , sorry for the misunderstanding. I tested this in local. This patch works with version 2.3.1 as well. User will not have to modify anything.

Copy link
Collaborator

@teoparvanov teoparvanov left a comment

Choose a reason for hiding this comment

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

Hey @tanwarsh, thanks for upgrading the PyTorch workspaces to 2.4.1! I see this PR as an intermediate step on our "journey" to 2.5.

@teoparvanov teoparvanov merged commit 1c50c0f into securefederatedai:develop Jan 24, 2025
21 of 23 checks passed
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.

5 participants