Skip to content

Commit a07f168

Browse files
csukuangfjpkufoolpzelaskojtrmal
authored
Remove unused code (k2-fsa#857)
* Update doc URL. (k2-fsa#821) * Support indexing 2-axes RaggedTensor, Support slicing for RaggedTensor (k2-fsa#825) * Support index 2-axes RaggedTensor, Support slicing for RaggedTensor * Fix compiling errors * Fix unit test * Change RaggedTensor.data to RaggedTensor.values * Fix style * Add docs * Run nightly-cpu when pushing code to nightly-cpu branch * Prune with max_arcs in IntersectDense (k2-fsa#820) * Add checking for array constructor * Prune with max arcs * Minor fix * Fix typo * Fix review comments * Fix typo * Release v1.8 * Create a ragged tensor from a regular tensor. (k2-fsa#827) * Create a ragged tensor from a regular tensor. * Add tests for creating ragged tensors from regular tensors. * Add more tests. * Print ragged tensors in a way like what PyTorch is doing. * Fix test cases. * Trigger GitHub actions manually. (k2-fsa#829) * Run GitHub actions on merging. (k2-fsa#830) * Support printing ragged tensors in a more compact way. (k2-fsa#831) * Support printing ragged tensors in a more compact way. * Disable support for torch 1.3.1 * Fix test failures. * Add levenshtein alignment (k2-fsa#828) * Add levenshtein graph * Contruct k2.RaggedTensor in python part * Fix review comments, return aux_labels in ctc_graph * Fix tests * Fix bug of accessing symbols * Fix bug of accessing symbols * Change argument name, add levenshtein_distance interface * Fix test error, add tests for levenshtein_distance * Fix review comments and add unit test for c++ side * update the interface of levenshtein alignment * Fix review comments * Release v1.9 * Support a[b[i]] where both a and b are ragged tensors. (k2-fsa#833) * Display import error solution message on MacOS (k2-fsa#837) * Fix installation doc. (k2-fsa#841) * Fix installation doc. Remove Windows support. Will fix it later. * Fix style issues. * fix typos in the install instructions (k2-fsa#844) * make cmake adhere to the modernized way of finding packages outside default dirs (k2-fsa#845) * import torch first in the smoke tests to preven SEGFAULT (k2-fsa#846) * Add doc about how to install a CPU version of k2. (k2-fsa#850) * Add doc about how to install a CPU version of k2. * Remove property setter of Fsa.labels * Update Ubuntu version in GitHub CI since 16.04 reaches end-of-life. * Support PyTorch 1.10. (k2-fsa#851) * Fix test cases for k2.union() (k2-fsa#853) * Revert "Construct RaggedArc from unary function tensor (#30)" (#31) This reverts commit cca7a54. * Remove unused code. * Fix github actions. Avoid downloading all git LFS files. * Enable github actions for v2.0-pre branch. Co-authored-by: Wei Kang <wkang@pku.org.cn> Co-authored-by: Piotr Żelasko <petezor@gmail.com> Co-authored-by: Jan "yenda" Trmal <jtrmal@gmail.com>
1 parent f375a83 commit a07f168

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+765
-3050
lines changed

.github/workflows/build-cpu.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
push:
2323
branches:
2424
- master
25+
- v2.0-pre
2526
pull_request:
2627
types: [labeled]
2728

@@ -36,8 +37,8 @@ jobs:
3637
fail-fast: false
3738
matrix:
3839
os: [ubuntu-18.04, macos-10.15]
39-
torch: ["1.5.0", "1.5.1", "1.6.0", "1.7.0", "1.7.1", "1.8.0", "1.8.1", "1.9.0"]
40-
# Python 3.9 is for PyTorch 1.7.1, 1.8.x, 1.9.0,
40+
torch: ["1.5.0", "1.5.1", "1.6.0", "1.7.0", "1.7.1", "1.8.0", "1.8.1", "1.9.0", "1.9.1", "1.10"]
41+
# Python 3.9 is for PyTorch 1.7.1, 1.8.x, 1.9.x, 1.10
4142
python-version: [3.6, 3.7, 3.8, 3.9]
4243
exclude:
4344
- python-version: 3.9 # exclude Python 3.9 for [1.5.0, 1.5.1, 1.6.0, 1.7.0]

.github/workflows/build.yml

+42-6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
push:
2323
branches:
2424
- master
25+
- v2.0-pre
2526
pull_request:
2627
types: [labeled]
2728

@@ -37,19 +38,42 @@ jobs:
3738
matrix:
3839
os: [ubuntu-18.04]
3940
# from https://download.pytorch.org/whl/torch_stable.html
40-
# 1.9.0 supports: cuda10.2 (default), 11.1
41+
# Note: There are no torch versions for CUDA 11.2
42+
#
43+
# 1.10 supports: cuda10.2 (default), 11.1, 11.3
44+
# 1.9.x supports: cuda10.2 (default), 11.1
4145
# PyTorch 1.8.x supports: cuda 10.1, 10.2 (default), 11.1
4246
# PyTorch 1.7.x supports: cuda 10.1, 10.2 (default), 11.0
4347
# PyTorch 1.6.0 supports: cuda 10.1, 10.2 (default)
4448
# PyTorch 1.5.x supports: cuda 10.1, 10.2 (default)
4549
# Other PyTorch versions are not tested
46-
cuda: ["10.1", "10.2", "11.0", "11.1"]
50+
# CUDA 11.3 is for torch 1.10
51+
cuda: ["10.1", "10.2", "11.0", "11.1", "11.3"]
4752
gcc: ["7"]
48-
torch: ["1.5.0", "1.5.1", "1.6.0", "1.7.0", "1.7.1", "1.8.0", "1.8.1", "1.9.0"]
49-
# Python 3.9 is for PyTorch 1.7.1, 1.8.0, 1.8.1, 1.9.0
53+
torch: ["1.5.0", "1.5.1", "1.6.0", "1.7.0", "1.7.1", "1.8.0", "1.8.1", "1.9.0", "1.9.1", "1.10"]
54+
#
55+
# Python 3.9 is for PyTorch 1.7.1, 1.8.0, 1.8.1, 1.9.x, 1.10
5056
python-version: [3.6, 3.7, 3.8, 3.9]
5157
exclude:
52-
- cuda: "11.0" # exclude 11.0 for [1.5.0, 1.5.1, 1.6.0, 1.8.0, 1.8.1, 1.9.0]
58+
- cuda: "11.3" # exclude 11.3 for [1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1]
59+
torch: "1.5.0"
60+
- cuda: "11.3"
61+
torch: "1.5.1"
62+
- cuda: "11.3"
63+
torch: "1.6.0"
64+
- cuda: "11.3"
65+
torch: "1.7.0"
66+
- cuda: "11.3"
67+
torch: "1.7.1"
68+
- cuda: "11.3"
69+
torch: "1.8.0"
70+
- cuda: "11.3"
71+
torch: "1.8.1"
72+
- cuda: "11.3"
73+
torch: "1.9.0"
74+
- cuda: "11.3"
75+
torch: "1.9.1"
76+
- cuda: "11.0" # exclude 11.0 for [1.5.0, 1.5.1, 1.6.0, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10]
5377
torch: "1.5.0"
5478
- cuda: "11.0"
5579
torch: "1.5.1"
@@ -61,6 +85,10 @@ jobs:
6185
torch: "1.8.1"
6286
- cuda: "11.0"
6387
torch: "1.9.0"
88+
- cuda: "11.0"
89+
torch: "1.9.1"
90+
- cuda: "11.0"
91+
torch: "1.10"
6492
- cuda: "11.1" # exclude 11.1 for [1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1]
6593
torch: "1.5.0"
6694
- cuda: "11.1"
@@ -71,8 +99,12 @@ jobs:
7199
torch: "1.7.0"
72100
- cuda: "11.1"
73101
torch: "1.7.1"
74-
- cuda: "10.1" # exclude CUDA 10.1 for [1.9.0]
102+
- cuda: "10.1" # exclude CUDA 10.1 for [1.9.0, 1.9.1, 1.10]
75103
torch: "1.9.0"
104+
- cuda: "10.1"
105+
torch: "1.9.1"
106+
- cuda: "10.1"
107+
torch: "1.10"
76108
- python-version: 3.9 # exclude Python 3.9 for [1.5.0, 1.5.1, 1.6.0, 1.7.0]
77109
torch: "1.5.0"
78110
- python-version: 3.9
@@ -117,6 +149,10 @@ jobs:
117149
echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
118150
echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
119151
152+
- name: Install git lfs
153+
run: |
154+
sudo apt-get install -y git-lfs
155+
120156
- name: Setup Python ${{ matrix.python-version }}
121157
uses: actions/setup-python@v2
122158
with:

.github/workflows/build_conda.yml

+20-9
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,20 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
os: [ubuntu-16.04]
36-
# anaconda does not support 3.9 as of 2021.05.08
35+
os: [ubuntu-18.04]
3736
python-version: [3.6, 3.7, 3.8, 3.9]
38-
# python-version: [3.6, 3.7, 3.8]
39-
cuda: ["10.1", "10.2", "11.0", "11.1"]
37+
cuda: ["10.1", "10.2", "11.0", "11.1", "11.3"]
4038
# from https://download.pytorch.org/whl/torch_stable.html
4139
#
42-
# PyTorch 1.9.0 supports: 10.2 (default), 11.1
40+
# PyTorch 1.10 supports: 10.2 (default), 11.1, 11.3
41+
# PyTorch 1.9.x supports: 10.2 (default), 11.1
4342
# PyTorch 1.8.1 supports: cuda 10.1, 10.2 (default), 11.1
4443
# PyTorch 1.8.0 supports: cuda 10.1, 10.2 (default), 11.1
4544
# PyTorch 1.7.x supports: cuda 10.1, 10.2 (default), 11.0, 9.2 (not included in this setup)
4645
# PyTorch 1.6.0 supports: cuda 10.1, 10.2 (default), 9.2 (not included in this setup)
4746
# PyTorch 1.5.x supports: cuda 10.1, 10.2 (default), 9.2 (not included in this setup)
4847
#
49-
# PyTorch 1.8.x and 1.7.1 support 3.6, 3.7, 3.8, 3.9
48+
# PyTorch 1.7.1, 1.8.x, 1.9.x, and 1.10 support 3.6, 3.7, 3.8, 3.9
5049
# PyTorch 1.7.0, 1.6.0, and 1.5.x support 3.6, 3.7, 3.8
5150
#
5251
# Other PyTorch versions are not tested
@@ -57,9 +56,9 @@ jobs:
5756
# https://github.com/csukuangfj/k2/runs/2533830771?check_suite_focus=true
5857
# and
5958
# https://github.com/NVIDIA/apex/issues/805
60-
torch: ["1.6.0", "1.7.0", "1.7.1", "1.8.0", "1.8.1", "1.9.0"]
59+
torch: ["1.6.0", "1.7.0", "1.7.1", "1.8.0", "1.8.1", "1.9.0", "1.9.1", "1.10"]
6160
exclude:
62-
# - cuda: "11.0" # exclude 11.0 for [1.5.0, 1.5.1, 1.6.0, 1.8.0, 1.8.1, 1.9.0]
61+
# - cuda: "11.0" # exclude 11.0 for [1.5.0, 1.5.1, 1.6.0, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10]
6362
# torch: "1.5.0"
6463
# - cuda: "11.0"
6564
# torch: "1.5.1"
@@ -71,6 +70,10 @@ jobs:
7170
torch: "1.8.1"
7271
- cuda: "11.0"
7372
torch: "1.9.0"
73+
- cuda: "11.0"
74+
torch: "1.9.1"
75+
- cuda: "11.0"
76+
torch: "1.10"
7477
# - cuda: "11.1" # exclude 11.1 for [1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1]
7578
# torch: "1.5.0"
7679
# - cuda: "11.1"
@@ -81,8 +84,12 @@ jobs:
8184
torch: "1.7.0"
8285
- cuda: "11.1"
8386
torch: "1.7.1"
84-
- cuda: "10.1" # exclude 10.1 for [1.9.0]
87+
- cuda: "10.1" # exclude 10.1 for [1.9.0, 1.9.1, 1.10]
8588
torch: "1.9.0"
89+
- cuda: "10.1"
90+
torch: "1.9.1"
91+
- cuda: "10.1"
92+
torch: "1.10"
8693
- python-version: 3.9 # exclude Python 3.9 for [1.5.0, 1.5.1, 1.6.0, 1.7.0]
8794
torch: "1.5.0"
8895
- python-version: 3.9
@@ -142,6 +149,10 @@ jobs:
142149
conda info
143150
nproc
144151
152+
- name: Install git lfs
153+
run: |
154+
sudo apt-get install -y git-lfs
155+
145156
- name: Download cudnn 8.0
146157
shell: bash -l {0}
147158
env:

.github/workflows/build_conda_cpu.yml

+13-15
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,25 @@ jobs:
4242
strategy:
4343
fail-fast: false
4444
matrix:
45-
os: [ubuntu-16.04, macos-10.15]
46-
# anaconda does not support 3.9 as of 2021.05.08
47-
# python-version: [3.6, 3.7, 3.8, 3.9]
48-
python-version: [3.6, 3.7, 3.8]
45+
os: [ubuntu-18.04, macos-10.15]
46+
python-version: [3.6, 3.7, 3.8, 3.9]
4947
# from https://download.pytorch.org/whl/torch_stable.html
5048
#
51-
# PyTorch 1.9.0, 1.8.x, and 1.7.1 support 3.6, 3.7, 3.8, 3.9
49+
# PyTorch 1.10, 1.9.x, 1.8.x, and 1.7.1 support 3.6, 3.7, 3.8, 3.9
5250
# PyTorch 1.7.0, 1.6.0, and 1.5.x support 3.6, 3.7, 3.8
5351
#
5452
# Other PyTorch versions are not tested
5553
#
56-
torch: ["1.5.0", "1.5.1", "1.6.0", "1.7.0", "1.7.1", "1.8.0", "1.8.1", "1.9.0"]
57-
# exclude:
58-
# - python-version: 3.9 # exclude Python 3.9 for [1.5.0, 1.5.1, 1.6.0, 1.7.0]
59-
# torch: "1.5.0"
60-
# - python-version: 3.9
61-
# torch: "1.5.1"
62-
# - python-version: 3.9
63-
# torch: "1.6.0"
64-
# - python-version: 3.9
65-
# torch: "1.7.0"
54+
torch: ["1.5.0", "1.5.1", "1.6.0", "1.7.0", "1.7.1", "1.8.0", "1.8.1", "1.9.0", "1.9.1", "1.10"]
55+
exclude:
56+
- python-version: 3.9 # exclude Python 3.9 for [1.5.0, 1.5.1, 1.6.0, 1.7.0]
57+
torch: "1.5.0"
58+
- python-version: 3.9
59+
torch: "1.5.1"
60+
- python-version: 3.9
61+
torch: "1.6.0"
62+
- python-version: 3.9
63+
torch: "1.7.0"
6664

6765
steps:
6866
# refer to https://github.com/actions/checkout

.github/workflows/nightly-cpu.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ jobs:
3939
fail-fast: false
4040
matrix:
4141
os: [ubuntu-18.04, macos-10.15]
42-
# Python 3.9 is for PyTorch 1.7.1, 1.8.x, 1.9.0
42+
# Python 3.9 is for PyTorch 1.7.1, 1.8.x, 1.9.x, 1.10
4343
python-version: [3.6, 3.7, 3.8, 3.9]
44-
torch: ["1.4.0", "1.5.0", "1.5.1", "1.6.0", "1.7.0", "1.7.1", "1.8.0", "1.8.1", "1.9.0"]
44+
torch: ["1.4.0", "1.5.0", "1.5.1", "1.6.0", "1.7.0", "1.7.1", "1.8.0", "1.8.1", "1.9.0", "1.9.1", "1.10"]
4545
exclude:
4646
- python-version: 3.9 # exclude Python 3.9 for [1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0]
4747
torch: "1.4.0"

.github/workflows/nightly.yml

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: nightly
22

33
on:
4+
push:
5+
branches:
6+
- nightly
47
schedule:
58
# minute (0-59)
69
# hour (0-23)
@@ -80,6 +83,10 @@ jobs:
8083
./scripts/github_actions/install_torch.sh
8184
python3 -c "import torch; print('torch version:', torch.__version__)"
8285
86+
- name: Install git lfs
87+
run: |
88+
sudo apt-get install -y git-lfs
89+
8390
- name: Download cudnn 8.0
8491
env:
8592
cuda: ${{ matrix.cuda }}

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

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
push:
2323
branches:
2424
- master
25+
- v2.0-pre
2526
pull_request:
2627
types: [labeled]
2728

.github/workflows/run-tests.yml

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
push:
2323
branches:
2424
- master
25+
- v2.0-pre
2526
pull_request:
2627
types: [labeled]
2728

@@ -91,6 +92,10 @@ jobs:
9192
./scripts/github_actions/install_torch.sh
9293
python3 -c "import torch; print('torch version:', torch.__version__)"
9394
95+
- name: Install git lfs
96+
run: |
97+
sudo apt-get install -y git-lfs
98+
9499
- name: Download cudnn 8.0
95100
env:
96101
cuda: ${{ matrix.cuda }}

.github/workflows/style_check.yml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ on:
2020
push:
2121
branches:
2222
- master
23+
- v2.0-pre
2324
pull_request:
2425
branches:
2526
- master

.github/workflows/wheel-stable.yml

+4
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ jobs:
7070
./scripts/github_actions/install_torch.sh
7171
python3 -c "import torch; print('torch version:', torch.__version__)"
7272
73+
- name: Install git lfs
74+
run: |
75+
sudo apt-get install -y git-lfs
76+
7377
- name: Download cudnn 8.0
7478
env:
7579
cuda: ${{ matrix.cuda }}

.github/workflows/wheel.yml

+4
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ jobs:
7070
./scripts/github_actions/install_torch.sh
7171
python3 -c "import torch; print('torch version:', torch.__version__)"
7272
73+
- name: Install git lfs
74+
run: |
75+
sudo apt-get install -y git-lfs
76+
7377
- name: Download cudnn 8.0
7478
env:
7579
cuda: ${{ matrix.cuda }}

CMakeLists.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
1717
if(POLICY CMP0111)
1818
cmake_policy(SET CMP0111 OLD)
1919
endif()
20+
if(POLICY CMP0074)
21+
cmake_policy(SET CMP0074 NEW)
22+
endif()
2023

2124
set(languages CXX)
2225
set(_K2_WITH_CUDA ON)
@@ -205,8 +208,14 @@ if(K2_WITH_CUDA)
205208
# set(K2_COMPUTE_ARCHS 30 32 35 50 52 53 60 61 62 70 72)
206209
# message(WARNING "arch 62/72 are not supported for now")
207210

208-
# refer to https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/
211+
# see https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/
212+
# https://www.myzhar.com/blog/tutorials/tutorial-nvidia-gpu-cuda-compute-capability/
209213
set(K2_COMPUTE_ARCH_CANDIDATES 35 50 60 61 70 75)
214+
if(CUDA_VERSION VERSION_GREATER "11.0")
215+
list(APPEND K2_COMPUTE_ARCH_CANDIDATES 80 86)
216+
endif()
217+
message(STATUS "K2_COMPUTE_ARCH_CANDIDATES ${K2_COMPUTE_ARCH_CANDIDATES}")
218+
210219
set(K2_COMPUTE_ARCHS)
211220

212221
foreach(COMPUTE_ARCH IN LISTS K2_COMPUTE_ARCH_CANDIDATES)

0 commit comments

Comments
 (0)