mirror of
https://github.com/csukuangfj/kaldifeat.git
synced 2025-08-13 12:02:19 +00:00
support torch 2.1
This commit is contained in:
parent
d37b2bb540
commit
50e2af6f4a
2
.github/workflows/build-doc.yml
vendored
2
.github/workflows/build-doc.yml
vendored
@ -35,7 +35,7 @@ jobs:
|
|||||||
python-version: [3.8]
|
python-version: [3.8]
|
||||||
steps:
|
steps:
|
||||||
# refer to https://github.com/actions/checkout
|
# refer to https://github.com/actions/checkout
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
4
.github/workflows/macos-cpu-wheels.yml
vendored
4
.github/workflows/macos-cpu-wheels.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Generating build matrix
|
- name: Generating build matrix
|
||||||
@ -38,7 +38,7 @@ jobs:
|
|||||||
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
2
.github/workflows/publish_to_pypi.yml
vendored
2
.github/workflows/publish_to_pypi.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
|||||||
pypi:
|
pypi:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
6
.github/workflows/run-tests-macos-cpu.yml
vendored
6
.github/workflows/run-tests-macos-cpu.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Generating build matrix
|
- name: Generating build matrix
|
||||||
@ -45,14 +45,14 @@ jobs:
|
|||||||
|
|
||||||
run_tests_macos_cpu:
|
run_tests_macos_cpu:
|
||||||
needs: generate_build_matrix
|
needs: generate_build_matrix
|
||||||
runs-on: macos-10.15
|
runs-on: macos-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
10
.github/workflows/run-tests-ubuntu-cpu.yml
vendored
10
.github/workflows/run-tests-ubuntu-cpu.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Generating build matrix
|
- name: Generating build matrix
|
||||||
@ -52,7 +52,7 @@ jobs:
|
|||||||
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@ -61,12 +61,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
- name: Install GCC 7
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y gcc-7 g++-7
|
|
||||||
echo "CC=/usr/bin/gcc-7" >> $GITHUB_ENV
|
|
||||||
echo "CXX=/usr/bin/g++-7" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install PyTorch ${{ matrix.torch }}
|
- name: Install PyTorch ${{ matrix.torch }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
14
.github/workflows/run-tests-ubuntu-cuda.yml
vendored
14
.github/workflows/run-tests-ubuntu-cuda.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Generating build matrix
|
- name: Generating build matrix
|
||||||
@ -45,14 +45,14 @@ jobs:
|
|||||||
|
|
||||||
run_tests_ubuntu_cuda:
|
run_tests_ubuntu_cuda:
|
||||||
needs: generate_build_matrix
|
needs: generate_build_matrix
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@ -61,14 +61,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
- name: Install GCC 7
|
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y gcc-7 g++-7
|
|
||||||
echo "CC=/usr/bin/gcc-7" >> $GITHUB_ENV
|
|
||||||
echo "CXX=/usr/bin/g++-7" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
|
|
||||||
- name: Install CUDA Toolkit ${{ matrix.cuda }}
|
- name: Install CUDA Toolkit ${{ matrix.cuda }}
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
6
.github/workflows/run-tests-windows-cpu.yml
vendored
6
.github/workflows/run-tests-windows-cpu.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Generating build matrix
|
- name: Generating build matrix
|
||||||
@ -46,14 +46,14 @@ jobs:
|
|||||||
run_tests_windows_cpu:
|
run_tests_windows_cpu:
|
||||||
# see https://github.com/actions/virtual-environments/blob/win19/20210525.0/images/win/Windows2019-Readme.md
|
# see https://github.com/actions/virtual-environments/blob/win19/20210525.0/images/win/Windows2019-Readme.md
|
||||||
needs: generate_build_matrix
|
needs: generate_build_matrix
|
||||||
runs-on: windows-2019
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
6
.github/workflows/run-tests-windows-cuda.yml
vendored
6
.github/workflows/run-tests-windows-cuda.yml
vendored
@ -33,7 +33,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Generating build matrix
|
- name: Generating build matrix
|
||||||
@ -46,14 +46,14 @@ jobs:
|
|||||||
|
|
||||||
run_tests_windows_cuda:
|
run_tests_windows_cuda:
|
||||||
needs: generate_build_matrix
|
needs: generate_build_matrix
|
||||||
runs-on: windows-2019
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
6
.github/workflows/style_check.yml
vendored
6
.github/workflows/style_check.yml
vendored
@ -29,12 +29,12 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04, macos-10.15]
|
os: [ubuntu-latest, macos-latest]
|
||||||
python-version: [3.7, 3.8, 3.9]
|
python-version: ["3.8"]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
2
.github/workflows/test-wheels.yml
vendored
2
.github/workflows/test-wheels.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
|||||||
python-version: ["3.8", "3.9", "3.10"]
|
python-version: ["3.8", "3.9", "3.10"]
|
||||||
steps:
|
steps:
|
||||||
# refer to https://github.com/actions/checkout
|
# refer to https://github.com/actions/checkout
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
4
.github/workflows/ubuntu-cpu-wheels.yml
vendored
4
.github/workflows/ubuntu-cpu-wheels.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Generating build matrix
|
- name: Generating build matrix
|
||||||
@ -38,7 +38,7 @@ jobs:
|
|||||||
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
4
.github/workflows/windows-x64-cpu-wheels.yml
vendored
4
.github/workflows/windows-x64-cpu-wheels.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Generating build matrix
|
- name: Generating build matrix
|
||||||
@ -38,7 +38,7 @@ jobs:
|
|||||||
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
@ -147,9 +147,16 @@ def generate_build_matrix(enable_cuda, for_windows, for_macos, test_only_latest_
|
|||||||
if not for_windows
|
if not for_windows
|
||||||
else ["11.7.1", "11.8.0"],
|
else ["11.7.1", "11.8.0"],
|
||||||
},
|
},
|
||||||
|
"2.1.0": {
|
||||||
|
"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:
|
if test_only_latest_torch:
|
||||||
latest = "2.0.1"
|
latest = "2.1.0"
|
||||||
matrix = {latest: matrix[latest]}
|
matrix = {latest: matrix[latest]}
|
||||||
|
|
||||||
if for_windows or for_macos:
|
if for_windows or for_macos:
|
||||||
|
@ -49,6 +49,12 @@ case "$cuda" in
|
|||||||
11.7)
|
11.7)
|
||||||
url=https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run
|
url=https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run
|
||||||
;;
|
;;
|
||||||
|
11.8)
|
||||||
|
url=https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
|
||||||
|
;;
|
||||||
|
12.1)
|
||||||
|
url=https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.run
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown cuda version: $cuda"
|
echo "Unknown cuda version: $cuda"
|
||||||
exit 1
|
exit 1
|
||||||
@ -63,10 +69,21 @@ retry curl -LSs -O $url
|
|||||||
filename=$(basename $url)
|
filename=$(basename $url)
|
||||||
echo "filename: $filename"
|
echo "filename: $filename"
|
||||||
chmod +x ./$filename
|
chmod +x ./$filename
|
||||||
sudo ./$filename --toolkit --silent
|
|
||||||
|
ls -lh
|
||||||
|
ls -lh /usr/local
|
||||||
|
|
||||||
|
sudo ./$filename \
|
||||||
|
--silent \
|
||||||
|
--toolkit \
|
||||||
|
--no-opengl-libs \
|
||||||
|
--no-drm \
|
||||||
|
--no-man-page
|
||||||
|
|
||||||
rm -fv ./$filename
|
rm -fv ./$filename
|
||||||
|
|
||||||
export CUDA_HOME=/usr/local/cuda
|
export CUDA_HOME=/usr/local/cuda
|
||||||
export PATH=$CUDA_HOME/bin:$PATH
|
export PATH=$CUDA_HOME/bin:$PATH
|
||||||
export LD_LIBRARY_PATH=$CUDA_HOME/lib:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=$CUDA_HOME/lib:$LD_LIBRARY_PATH
|
||||||
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
|
||||||
|
ls -lh $CUDA_HOME
|
||||||
|
@ -42,6 +42,12 @@ case $cuda in
|
|||||||
11.7)
|
11.7)
|
||||||
filename=cudnn-11.3-linux-x64-v8.2.0.53.tgz
|
filename=cudnn-11.3-linux-x64-v8.2.0.53.tgz
|
||||||
;;
|
;;
|
||||||
|
11.8)
|
||||||
|
filename=cudnn-11.3-linux-x64-v8.2.0.53.tgz
|
||||||
|
;;
|
||||||
|
12.1)
|
||||||
|
filename=cudnn-linux-x86_64-8.9.5.29_cuda12-archive.tar.xz
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unsupported cuda version: $cuda"
|
echo "Unsupported cuda version: $cuda"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -13,11 +13,12 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
set -x
|
|
||||||
|
|
||||||
torch=$TORCH_VERSION
|
if [ x"$TORCH_VERSION" != x"" ] && [ x"$CUDA_VERSION" != x"" ]; then
|
||||||
cuda=$CUDA_VERSION
|
torch=$TORCH_VERSION
|
||||||
echo "torch: $torch, cuda: $cuda"
|
cuda=$CUDA_VERSION
|
||||||
|
fi
|
||||||
|
|
||||||
case ${torch} in
|
case ${torch} in
|
||||||
1.5.*)
|
1.5.*)
|
||||||
case ${cuda} in
|
case ${cuda} in
|
||||||
@ -171,6 +172,19 @@ case ${torch} in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
2.1.*)
|
||||||
|
case ${cuda} in
|
||||||
|
11.8)
|
||||||
|
package="torch==${torch}+cu118"
|
||||||
|
url=https://download.pytorch.org/whl/torch_stable.html
|
||||||
|
;;
|
||||||
|
12.1)
|
||||||
|
package="torch==${torch}"
|
||||||
|
# Leave it empty to use PyPI.
|
||||||
|
url=
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unsupported PyTorch version: ${torch}"
|
echo "Unsupported PyTorch version: ${torch}"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user