Skip to content

Commit 1dd4af6

Browse files
hotfix: Fix parsing pytorch verison (#1749)
<!-- .github/pull_request_template.md --> ## πŸ“Œ Description There was an issue in parsing the torch major version, so this PR fixes the problem. ## πŸ” Related Issues <!-- Link any related issues here --> ## πŸš€ Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### βœ… Pre-commit Checks - [x] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [x] I have installed the hooks with `pre-commit install`. - [x] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## πŸ§ͺ Tests - [x] Tests have been added or updated as needed. - [x] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. -->
1 parent 8ddfd28 commit 1dd4af6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

β€Žflashinfer/jit/cpp_ext.pyβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def torch_get_pybind11_abi_build_flags() -> List[str]:
2525
# NOTE: starting from torch 2.9, this function is no longer needed
2626
# torch (cuda) version format is now like 2.9.0+cu129, so we need to split the version string
2727
# and check if the major version is at least 2.9
28-
if Version(re.split(r"\+.*", torch.__version__)[0]) >= Version("2.9"):
28+
torch_major_version = re.split(r"(\d+\.\d+)", torch.__version__)[1]
29+
if Version(torch_major_version) >= Version("2.9"):
2930
return []
3031
else:
3132
abi_cflags = []

0 commit comments

Comments
Β (0)