-
Notifications
You must be signed in to change notification settings - Fork 318
fix incorrect torch version test #2786
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2786
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
torchao/utils.py
Outdated
|
||
# Parser for local identifiers | ||
current_version = re.sub(r"\+.*$", "", torch.__version__) | ||
return parse_version(current_version) >= parse_version(min_version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some impression that we don't want to do this, but @msaroufim would have more context here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems fine to merge altho we probably want to delete the compare_versions function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compare_versions & parse_version
are unavailable to used here because parse_version
only extracts \d+\.\d+\.\d+
(e.g., 2.5.0→[2, 5, 0]). Therefore, we can inject more parsers (e.g., a0, dev) into parse_version
, but I am not certain because check_cpu_version & check_xpu_version
are chained with them.
Hi @namgyu-youn, thanks for fixing this. I think we should actually fix
Basically always return a list of 3 numbers, and -1 represents a pre-release. Then we can just compare as follows:
To me this is simpler than the existing |
Sounds good to me. Customized |
…versions - Co-authored-by: andrewor14 <[email protected]>
…versions - Co-authored-by: andrewor14 <[email protected]>
Summary:
PyTorch pre-release/dev versions have
a0/dev
in their name. Therefore, the right order is the following:For correct order, this PR applies true order within stable and pre-release/dev.
torch_version_at_least
semantics are incorrect #2722Test plan: CI