Skip to content

Commit

Permalink
Build wheels for torch 2.1.2 (#1265)
Browse files Browse the repository at this point in the history
* support torch 2.1.2

* Replace random_shuffle with shuffle
  • Loading branch information
csukuangfj committed Dec 21, 2023
1 parent 7711d16 commit 415fe1f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/run-tests-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@ concurrency:

jobs:
run-tests-cpu:
if: github.event.label.name == 'ready' || github.event.label.name == 'cpp-test' || github.event_name == 'push'
runs-on: ${{ matrix.os }}
name: ${{ matrix.python-version }} ${{ matrix.build_type }}
name: ${{ matrix.os }} ${{ matrix.torch }} ${{ matrix.python-version }} ${{ matrix.build_type }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
torch: ["2.1.1"]
torch: ["2.1.2"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
build_type: ["Release", "Debug"]

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ concurrency:

jobs:
run-tests:
if: github.event.label.name == 'ready' || github.event_name == 'push'
runs-on: ${{ matrix.os }}
name: ${{ matrix.build_type }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
cuda: ["12.1"]
torch: ["2.1.1"]
torch: ["2.1.2"]
python-version: ["3.11"]

steps:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ubuntu-cuda-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ jobs:
id: set-matrix
run: |
# outputting for debugging purposes
# python ./scripts/github_actions/generate_build_matrix.py --enable-cuda --test-only-latest-torch
# MATRIX=$(python ./scripts/github_actions/generate_build_matrix.py --enable-cuda --test-only-latest-torch)
python ./scripts/github_actions/generate_build_matrix.py --enable-cuda
MATRIX=$(python ./scripts/github_actions/generate_build_matrix.py --enable-cuda)
echo "::set-output name=matrix::${MATRIX}"
build-manylinux-wheels:
Expand Down
4 changes: 3 additions & 1 deletion k2/csrc/array_ops_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,9 @@ TEST(OpsTest, InvertPermutationTest) {
int32_t len = RandInt(0, 10);
std::vector<int32_t> permutation(len);
std::iota(permutation.begin(), permutation.end(), 0);
std::random_shuffle(permutation.begin(), permutation.end());
std::random_device rd;
std::mt19937 g(rd());
std::shuffle(permutation.begin(), permutation.end(), g);
Array1<int32_t> permutation_array(c, permutation);
Array1<int32_t> permutation_array_inv =
InvertPermutation(permutation_array);
Expand Down
8 changes: 7 additions & 1 deletion scripts/github_actions/generate_build_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,16 @@ def generate_build_matrix(
if not for_windows
else ["11.8.0", "12.1.0"],
},
"2.1.2": {
"python-version": ["3.8", "3.9", "3.10", "3.11"],
"cuda": ["11.8", "12.1"] # default 12.1
if not for_windows
else ["11.8.0", "12.1.0"],
},
# https://github.com/Jimver/cuda-toolkit/blob/master/src/links/windows-links.ts
}
if test_only_latest_torch:
latest = "2.1.1"
latest = "2.1.2"
matrix = {latest: matrix[latest]}

if for_windows or for_macos:
Expand Down

0 comments on commit 415fe1f

Please sign in to comment.