fix incorrect torch version test#2786
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. ❌ 3 New FailuresAs of commit 05edf52 with merge base e6b38bb ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
||
| # 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.
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.
seems fine to merge altho we probably want to delete the compare_versions function
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
btw we also have
Line 1002 in 43b4106
I vaguely remember at some point that we don't want to use parse version, but don't remember why though
|
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 <andrewor14@gmail.com>
…versions - Co-authored-by: andrewor14 <andrewor14@gmail.com>
| version = re.sub(r"\+.*$", "", version_string) | ||
|
|
||
| # Check for pre-release indicators (including all common patterns) | ||
| is_prerelease = bool(re.search(r"(a|b|dev)", version)) |
There was a problem hiding this comment.
Seems like this is simpler:
is_prerelease = bool(re.search(r"(git|dev)", version_string))
match = re.match(r"(\d+)\.(\d+)\.(\d+)", version_string)
any other patterns we need to search for? @jerryzh168
There was a problem hiding this comment.
git and dev should be enough I think, we have git locally and dev in nightly
| Examples: "2.5.0.dev20240708+cu121" -> [2, 5, -1], "2.5.0" -> [2, 5, 0] | ||
| """ | ||
| # Check for pre-release indicators | ||
| is_prerelease = bool(re.search(r"(git|dev)", version_string)) |
There was a problem hiding this comment.
please also verify the version string for pytorch, if you build it from source
There was a problem hiding this comment.
git and dev should be enough I think, we have git locally and dev in nightly
Aren't the above comments mentioning git and dev enough for a pre-release pattern? Let me know if I am missing something.
There was a problem hiding this comment.
Yeah should be git if you build from source, this is mine: 2.9.0a0+git1f19003
There was a problem hiding this comment.
yeah I was referring to torchao as well but then realized this is for torch
|
Thanks @namgyu-youn, this looks good to me! The test failures are unrelated. |
Summary: version semantics is fixed in pytorch#2786 and we are updating the version check logic accordingly Test Plan: python test/integration/test_integration.py -k test_autoquant_hp_float Reviewers: Subscribers: Tasks: Tags:
Summary: version semantics is fixed in #2786 and we are updating the version check logic accordingly Test Plan: python test/integration/test_integration.py -k test_autoquant_hp_float Reviewers: Subscribers: Tasks: Tags:
* fix torch version detector * add pre-release parser for torch_version_at_least and remove compare_versions - Co-authored-by: andrewor14 <andrewor14@gmail.com> * add pre-release parser for torch_version_at_least and remove compare_versions - Co-authored-by: andrewor14 <andrewor14@gmail.com> * remove local test code * update PyTorch pre-release version indicator * update pre-release patterns
Summary: version semantics is fixed in #2786 and we are updating the version check logic accordingly Test Plan: python test/integration/test_integration.py -k test_autoquant_hp_float Reviewers: Subscribers: Tasks: Tags:
Summary:
PyTorch pre-release/dev versions have
a0/devin 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_leastsemantics are incorrect #2722Test plan: CI