Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

namgyu-youn
Copy link
Contributor

@namgyu-youn namgyu-youn commented Aug 18, 2025

Summary:
PyTorch pre-release/dev versions have a0/dev in their name. Therefore, the right order is the following:

2.4.0 (stable) < 2.5.0.dev / 2.5.0.git < 2.5.0 (stable)

For correct order, this PR applies true order within stable and pre-release/dev.

Test plan: CI

Copy link

pytorch-bot bot commented Aug 18, 2025

🔗 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.

❌ 1 New Failure

As of commit 0ada4b5 with merge base e6b38bb (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 18, 2025
@namgyu-youn namgyu-youn changed the title fix torch version detector fix incorrect torch version test Aug 18, 2025

# Parser for local identifiers
current_version = re.sub(r"\+.*$", "", torch.__version__)
return parse_version(current_version) >= parse_version(min_version)
Copy link
Contributor

@jerryzh168 jerryzh168 Aug 18, 2025

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

Copy link
Member

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

Copy link
Contributor Author

@namgyu-youn namgyu-youn Aug 19, 2025

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.

@jerryzh168 jerryzh168 requested a review from msaroufim August 18, 2025 22:48
@msaroufim msaroufim requested a review from andrewor14 August 19, 2025 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

torch_version_at_least semantics are incorrect
3 participants