Skip to content

Commit

Permalink
Fix building wheels for torch 2.2.0. (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Feb 18, 2024
1 parent 2e042b3 commit 2a8a993
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ubuntu-cpu-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
# outputting for debugging purposes
python ./scripts/github_actions/generate_build_matrix.py
MATRIX=$(python ./scripts/github_actions/generate_build_matrix.py)
# python ./scripts/github_actions/generate_build_matrix.py --test-only-latest-torch
# MATRIX=$(python ./scripts/github_actions/generate_build_matrix.py --test-only-latest-torch)
echo "::set-output name=matrix::${MATRIX}"
build-manylinux-wheels:
Expand Down
20 changes: 20 additions & 0 deletions scripts/github_actions/generate_build_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
import json


def version_ge(a, b):
a_major, a_minor = list(map(int, a.split(".")))[:2]
b_major, b_minor = list(map(int, b.split(".")))[:2]
if a_major > b_major:
return True

if a_major == b_major and a_minor >= b_minor:
return True

return False


def get_args():
parser = argparse.ArgumentParser()
parser.add_argument(
Expand Down Expand Up @@ -216,6 +228,14 @@ def generate_build_matrix(enable_cuda, for_windows, for_macos, test_only_latest_
ans.append({"torch": torch, "python-version": p})
elif for_macos:
ans.append({"torch": torch, "python-version": p})
elif version_ge(torch, "2.2.0"):
ans.append(
{
"torch": torch,
"python-version": p,
"image": "pytorch/manylinux-builder:cpu-2.2",
}
)
else:
ans.append(
{
Expand Down

0 comments on commit 2a8a993

Please sign in to comment.