Skip to content

Commit 415fe1f

Browse files
authored
Build wheels for torch 2.1.2 (#1265)
* support torch 2.1.2 * Replace random_shuffle with shuffle
1 parent 7711d16 commit 415fe1f

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

.github/workflows/run-tests-cpu.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@ concurrency:
4646

4747
jobs:
4848
run-tests-cpu:
49-
if: github.event.label.name == 'ready' || github.event.label.name == 'cpp-test' || github.event_name == 'push'
5049
runs-on: ${{ matrix.os }}
51-
name: ${{ matrix.python-version }} ${{ matrix.build_type }}
50+
name: ${{ matrix.os }} ${{ matrix.torch }} ${{ matrix.python-version }} ${{ matrix.build_type }}
5251
strategy:
5352
fail-fast: false
5453
matrix:
5554
os: [ubuntu-latest, macos-latest]
56-
torch: ["2.1.1"]
55+
torch: ["2.1.2"]
5756
python-version: ["3.8", "3.9", "3.10", "3.11"]
5857
build_type: ["Release", "Debug"]
5958

.github/workflows/run-tests.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,13 @@ concurrency:
4646

4747
jobs:
4848
run-tests:
49-
if: github.event.label.name == 'ready' || github.event_name == 'push'
5049
runs-on: ${{ matrix.os }}
51-
name: ${{ matrix.build_type }}
5250
strategy:
5351
fail-fast: false
5452
matrix:
5553
os: [ubuntu-latest]
5654
cuda: ["12.1"]
57-
torch: ["2.1.1"]
55+
torch: ["2.1.2"]
5856
python-version: ["3.11"]
5957

6058
steps:

.github/workflows/ubuntu-cuda-wheels.yml

+4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ jobs:
2525
id: set-matrix
2626
run: |
2727
# outputting for debugging purposes
28+
# python ./scripts/github_actions/generate_build_matrix.py --enable-cuda --test-only-latest-torch
29+
# MATRIX=$(python ./scripts/github_actions/generate_build_matrix.py --enable-cuda --test-only-latest-torch)
30+
2831
python ./scripts/github_actions/generate_build_matrix.py --enable-cuda
2932
MATRIX=$(python ./scripts/github_actions/generate_build_matrix.py --enable-cuda)
33+
3034
echo "::set-output name=matrix::${MATRIX}"
3135
3236
build-manylinux-wheels:

k2/csrc/array_ops_test.cu

+3-1
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,9 @@ TEST(OpsTest, InvertPermutationTest) {
15731573
int32_t len = RandInt(0, 10);
15741574
std::vector<int32_t> permutation(len);
15751575
std::iota(permutation.begin(), permutation.end(), 0);
1576-
std::random_shuffle(permutation.begin(), permutation.end());
1576+
std::random_device rd;
1577+
std::mt19937 g(rd());
1578+
std::shuffle(permutation.begin(), permutation.end(), g);
15771579
Array1<int32_t> permutation_array(c, permutation);
15781580
Array1<int32_t> permutation_array_inv =
15791581
InvertPermutation(permutation_array);

scripts/github_actions/generate_build_matrix.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,16 @@ def generate_build_matrix(
172172
if not for_windows
173173
else ["11.8.0", "12.1.0"],
174174
},
175+
"2.1.2": {
176+
"python-version": ["3.8", "3.9", "3.10", "3.11"],
177+
"cuda": ["11.8", "12.1"] # default 12.1
178+
if not for_windows
179+
else ["11.8.0", "12.1.0"],
180+
},
175181
# https://github.com/Jimver/cuda-toolkit/blob/master/src/links/windows-links.ts
176182
}
177183
if test_only_latest_torch:
178-
latest = "2.1.1"
184+
latest = "2.1.2"
179185
matrix = {latest: matrix[latest]}
180186

181187
if for_windows or for_macos:

0 commit comments

Comments
 (0)