Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Context
Part of effort to make TorchTNT OSS compliant.
TorchTNT uses latest pytorch apis. Sometimes these are only available in nightlies. When that's the case, users in OSS using a stable pytorch release will see import errors when they use TorchTNT. This can be guarded against by importing conditionally, only when the compatible pytorch version is detected in the environment.
We have plenty of these checks already. However, at the same time we don't want to bload TNT with too many of these version checks everywhere. Currently we have various version checks for Pytorch 1.0.
I propose to make Pytorch 2.0+ a hard dependency for TorchTNT going forward. This will
And Pytorch 2.0 is documented to be 100% backwards compatible, so no bugs or errors should show up
This Diff
Removes all the Pytorch version checks below 2.0 in various places of the codebase, and all the helper functions which check for version
Differential Revision: D56446353