diff --git a/.github/workflows/run-tests-macos-cpu.yml b/.github/workflows/run-tests-macos-cpu.yml index 02e3118..d34dd15 100644 --- a/.github/workflows/run-tests-macos-cpu.yml +++ b/.github/workflows/run-tests-macos-cpu.yml @@ -66,7 +66,7 @@ jobs: run: | python3 -m pip install -qq --upgrade pip python3 -m pip install -qq wheel twine typing_extensions soundfile numpy - python3 -m pip install -qq torch==${{ matrix.torch }} -f https://download.pytorch.org/whl/torch_stable.html + python3 -m pip install -qq torch==${{ matrix.torch }} -f https://download.pytorch.org/whl/torch_stable.html || python3 -m pip install -qq torch==${{ matrix.torch }} -f https://download.pytorch.org/whl/torch/ python3 -c "import torch; print('torch version:', torch.__version__)" diff --git a/.github/workflows/run-tests-ubuntu-cpu.yml b/.github/workflows/run-tests-ubuntu-cpu.yml index baa9a03..0baa2ca 100644 --- a/.github/workflows/run-tests-ubuntu-cpu.yml +++ b/.github/workflows/run-tests-ubuntu-cpu.yml @@ -69,7 +69,7 @@ jobs: python3 -m pip install --upgrade pip python3 -m pip install wheel twine typing_extensions soundfile python3 -m pip install bs4 requests tqdm numpy - python3 -m pip install -qq torch==${{ matrix.torch }}+cpu -f https://download.pytorch.org/whl/torch_stable.html + python3 -m pip install -qq torch==${{ matrix.torch }}+cpu -f https://download.pytorch.org/whl/torch_stable.html || python3 -m pip install -qq torch==${{ matrix.torch }}+cpu -f https://download.pytorch.org/whl/torch/ python3 -c "import torch; print('torch version:', torch.__version__)" diff --git a/.github/workflows/run-tests-windows-cpu.yml b/.github/workflows/run-tests-windows-cpu.yml index 12cbf53..cb3e62e 100644 --- a/.github/workflows/run-tests-windows-cpu.yml +++ b/.github/workflows/run-tests-windows-cpu.yml @@ -71,7 +71,7 @@ jobs: - name: Install PyTorch ${{ matrix.torch }} run: | - pip3 install -qq torch==${{ matrix.torch }}+cpu -f https://download.pytorch.org/whl/torch_stable.html + pip3 install -qq torch==${{ matrix.torch }}+cpu -f https://download.pytorch.org/whl/torch_stable.html || pip3 install -qq torch==${{ matrix.torch }}+cpu -f https://download.pytorch.org/whl/torch/ pip3 install -qq wheel twine dataclasses numpy typing_extensions soundfile - name: Display CMake version diff --git a/.github/workflows/run-tests-windows-cuda.yml b/.github/workflows/run-tests-windows-cuda.yml index db9d6b5..937a445 100644 --- a/.github/workflows/run-tests-windows-cuda.yml +++ b/.github/workflows/run-tests-windows-cuda.yml @@ -113,7 +113,7 @@ jobs: python3 -m pip install -qq --upgrade pip python3 -m pip install -qq wheel twine numpy typing_extensions python3 -m pip install -qq dataclasses soundfile numpy - python3 -m pip install -qq torch==${{ matrix.torch }}${v} -f https://download.pytorch.org/whl/torch_stable.html numpy + python3 -m pip install -qq torch==${{ matrix.torch }}${v} -f https://download.pytorch.org/whl/torch_stable.html numpy || python3 -m pip install -qq torch==${{ matrix.torch }}${v} -f https://download.pytorch.org/whl/torch/ numpy python3 -c "import torch; print('torch version:', torch.__version__)" diff --git a/.github/workflows/test-wheels.yml b/.github/workflows/test-wheels.yml index 9d3ea70..6d27bbf 100644 --- a/.github/workflows/test-wheels.yml +++ b/.github/workflows/test-wheels.yml @@ -47,7 +47,7 @@ jobs: if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'windows') shell: bash run: | - pip install torch==${{ github.event.inputs.torch_version }}+cpu -f https://download.pytorch.org/whl/torch_stable.html + pip install torch==${{ github.event.inputs.torch_version }}+cpu -f https://download.pytorch.org/whl/torch_stable.html || pip install torch==${{ github.event.inputs.torch_version }}+cpu -f https://download.pytorch.org/whl/torch/ - name: Install kaldifeat shell: bash diff --git a/.github/workflows/windows-x64-cpu-wheels.yml b/.github/workflows/windows-x64-cpu-wheels.yml index 3bf54cc..f9a1a92 100644 --- a/.github/workflows/windows-x64-cpu-wheels.yml +++ b/.github/workflows/windows-x64-cpu-wheels.yml @@ -52,7 +52,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 env: - CIBW_BEFORE_BUILD: pip install torch==${{ matrix.torch}}+cpu -f https://download.pytorch.org/whl/torch_stable.html cmake numpy + CIBW_BEFORE_BUILD: pip install torch==${{ matrix.torch}}+cpu -f https://download.pytorch.org/whl/torch_stable.html cmake numpy || pip install torch==${{ matrix.torch}}+cpu -f https://download.pytorch.org/whl/torch/ cmake numpy CIBW_BUILD: ${{ matrix.python-version }}-win_amd64 CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "" CIBW_BUILD_VERBOSITY: 3 diff --git a/doc/source/installation/from_wheels.rst b/doc/source/installation/from_wheels.rst index 28539ae..61cf292 100644 --- a/doc/source/installation/from_wheels.rst +++ b/doc/source/installation/from_wheels.rst @@ -21,29 +21,29 @@ Suppose you want to install the following wheel: .. code-block:: bash - https://huggingface.co/csukuangfj/kaldifeat/resolve/main/ubuntu-cpu/kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + https://huggingface.co/csukuangfj/kaldifeat/resolve/main/ubuntu-cpu/kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl you can use one of the following methods: .. code-block:: bash # method 1 - pip install torch==2.2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html - pip install kaldifeat==1.25.4.dev20240210+cpu.torch2.2.0 -f https://csukuangfj.github.io/kaldifeat/cpu.html + pip install torch==2.4.0+cpu -f https://download.pytorch.org/whl/torch/ + pip install kaldifeat==1.25.4.dev20240725+cpu.torch2.4.0 -f https://csukuangfj.github.io/kaldifeat/cpu.html # For users from China # 中国国内用户,如果访问不了 huggingface, 请使用 - # pip install kaldifeat==1.25.4.dev20240210+cpu.torch2.2.0 -f https://csukuangfj.github.io/kaldifeat/cpu-cn.html + # pip install kaldifeat==1.25.4.dev20240725+cpu.torch2.4.0 -f https://csukuangfj.github.io/kaldifeat/cpu-cn.html # method 2 - pip install torch==2.2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html - wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/ubuntu-cpu/kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + pip install torch==2.4.0+cpu -f https://download.pytorch.org/whl/torch/ + wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/ubuntu-cpu/kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl # For users from China # 中国国内用户,如果访问不了 huggingface, 请使用 - # wget https://hf-mirror.com/csukuangfj/kaldifeat/resolve/main/ubuntu-cpu/kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + # wget https://hf-mirror.com/csukuangfj/kaldifeat/resolve/main/ubuntu-cpu/kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pip install ./kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + pip install ./kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Windows (CPU) -------------- @@ -52,29 +52,29 @@ Suppose you want to install the following wheel: .. code-block:: bash - https://huggingface.co/csukuangfj/kaldifeat/resolve/main/windows-cpu/kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-win_amd64.whl + https://huggingface.co/csukuangfj/kaldifeat/resolve/main/windows-cpu/kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp312-cp312-win_amd64.whl you can use one of the following methods: .. code-block:: bash # method 1 - pip install torch==2.2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html - pip install kaldifeat==1.25.4.dev20240210+cpu.torch2.2.0 -f https://csukuangfj.github.io/kaldifeat/cpu.html + pip install torch==2.4.0+cpu -f https://download.pytorch.org/whl/torch/ + pip install kaldifeat==1.25.4.dev20240725+cpu.torch2.4.0 -f https://csukuangfj.github.io/kaldifeat/cpu.html # For users from China # 中国国内用户,如果访问不了 huggingface, 请使用 - # pip install kaldifeat==1.25.4.dev20240210+cpu.torch2.2.0 -f https://csukuangfj.github.io/kaldifeat/cpu-cn.html + # pip install kaldifeat==1.25.4.dev20240725+cpu.torch2.4.0 -f https://csukuangfj.github.io/kaldifeat/cpu-cn.html # method 2 - pip install torch==2.2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html - wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/windows-cpu/kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-win_amd64.whl + pip install torch==2.4.0+cpu -f https://download.pytorch.org/whl/torch/ + wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/windows-cpu/kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp312-cp312-win_amd64.whl # For users from China # 中国国内用户,如果访问不了 huggingface, 请使用 - # wget https://hf-mirror.com/csukuangfj/kaldifeat/resolve/main/windows-cpu/kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-win_amd64.whl + # wget https://hf-mirror.com/csukuangfj/kaldifeat/resolve/main/windows-cpu/kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp312-cp312-win_amd64.whl - pip install ./kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-win_amd64.whl + pip install ./kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp312-cp312-win_amd64.whl macOS (CPU) ----------- @@ -83,29 +83,29 @@ Suppose you want to install the following wheel: .. code-block:: bash - https://huggingface.co/csukuangfj/kaldifeat/resolve/main/macos/kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-macosx_12_0_universal2.whl + https://huggingface.co/csukuangfj/kaldifeat/resolve/main/macos/kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp311-cp311-macosx_11_0_arm64.whl you can use one of the following methods: .. code-block:: bash # method 1 - pip install torch==2.2.0 - pip install kaldifeat==1.25.4.dev20240210+cpu.torch2.2.0 -f https://csukuangfj.github.io/kaldifeat/cpu.html + pip install torch==2.4.0 + pip install kaldifeat==1.25.4.dev20240725+cpu.torch2.4.0 -f https://csukuangfj.github.io/kaldifeat/cpu.html # For users from China # 中国国内用户,如果访问不了 huggingface, 请使用 - # pip install kaldifeat==1.25.4.dev20240210+cpu.torch2.2.0 -f https://csukuangfj.github.io/kaldifeat/cpu-cn.html + # pip install kaldifeat==1.25.4.dev20240725+cpu.torch2.4.0 -f https://csukuangfj.github.io/kaldifeat/cpu-cn.html # method 2 - pip install torch==2.2.0 -f https://download.pytorch.org/whl/torch_stable.html - wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/macos/kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-macosx_12_0_universal2.whl + pip install torch==2.4.0 -f https://download.pytorch.org/whl/torch/ + wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/macos/kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp311-cp311-macosx_11_0_arm64.whl # For users from China # 中国国内用户,如果访问不了 huggingface, 请使用 - # wget https://hf-mirror.com/csukuangfj/kaldifeat/resolve/main/macos/kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-macosx_12_0_universal2.whl + # wget https://hf-mirror.com/csukuangfj/kaldifeat/resolve/main/macos/kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp311-cp311-macosx_11_0_arm64.whl - pip install ./kaldifeat-1.25.4.dev20240210+cpu.torch2.2.0-cp312-cp312-macosx_12_0_universal2.whl + pip install ./kaldifeat-1.25.4.dev20240725+cpu.torch2.4.0-cp311-cp311-macosx_11_0_arm64.whl Linux (CUDA) ------------ @@ -114,26 +114,26 @@ Suppose you want to install the following wheel: .. code-block:: bash - https://huggingface.co/csukuangfj/kaldifeat/resolve/main/ubuntu-cuda/kaldifeat-1.25.4.dev20240210+cuda12.1.torch2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + https://huggingface.co/csukuangfj/kaldifeat/resolve/main/ubuntu-cuda/kaldifeat-1.25.4.dev20240725+cuda12.4.torch2.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl you can use one of the following methods: .. code-block:: bash # method 1 - pip install torch==2.2.0+cu121 -f https://download.pytorch.org/whl/torch_stable.html - pip install kaldifeat==1.25.4.dev20240210+cuda12.1.torch2.2.0 -f https://csukuangfj.github.io/kaldifeat/cuda.html + pip install torch==2.4.0+cu124 -f https://download.pytorch.org/whl/torch/ + pip install kaldifeat==1.25.4.dev20240725+cuda12.4.torch2.4.0 -f https://csukuangfj.github.io/kaldifeat/cuda.html # For users from China # 中国国内用户,如果访问不了 huggingface, 请使用 - # pip install kaldifeat==1.25.4.dev20240210+cuda12.1.torch2.2.0 -f https://csukuangfj.github.io/kaldifeat/cuda-cn.html + # pip install kaldifeat==1.25.4.dev20240725+cuda12.4.torch2.4.0 -f https://csukuangfj.github.io/kaldifeat/cuda-cn.html # method 2 - pip install torch==2.2.0+cu121 -f https://download.pytorch.org/whl/torch_stable.html - wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/ubuntu-cuda/kaldifeat-1.25.4.dev20240210+cuda12.1.torch2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + pip install torch==2.4.0+cu124 -f https://download.pytorch.org/whl/torch/ + wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/ubuntu-cuda/kaldifeat-1.25.4.dev20240725+cuda12.4.torch2.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl # For users from China # 中国国内用户,如果访问不了 huggingface, 请使用 - # wget https://hf-mirror.com/csukuangfj/kaldifeat/resolve/main/ubuntu-cuda/kaldifeat-1.25.4.dev20240210+cuda12.1.torch2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + # wget https://hf-mirror.com/csukuangfj/kaldifeat/resolve/main/ubuntu-cuda/kaldifeat-1.25.4.dev20240725+cuda12.4.torch2.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pip install ./kaldifeat-1.25.4.dev20240210+cuda12.1.torch2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + pip install ./kaldifeat-1.25.4.dev20240725+cuda12.4.torch2.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl diff --git a/scripts/github_actions/build-ubuntu-cpu.sh b/scripts/github_actions/build-ubuntu-cpu.sh index 752e104..1b07111 100755 --- a/scripts/github_actions/build-ubuntu-cpu.sh +++ b/scripts/github_actions/build-ubuntu-cpu.sh @@ -57,7 +57,8 @@ python3 -m pip install wheel twine typing_extensions python3 -m pip install bs4 requests tqdm auditwheel echo "Installing torch" -python3 -m pip install -qq torch==$TORCH_VERSION+cpu -f https://download.pytorch.org/whl/torch_stable.html +python3 -m pip install -qq torch==$TORCH_VERSION+cpu -f https://download.pytorch.org/whl/torch_stable.html || \ +python3 -m pip install -qq torch==$TORCH_VERSION+cpu -f https://download.pytorch.org/whl/torch/ rm -rf ~/.cache/pip yum clean all diff --git a/scripts/github_actions/generate_build_matrix.py b/scripts/github_actions/generate_build_matrix.py index d2e8392..a22510f 100755 --- a/scripts/github_actions/generate_build_matrix.py +++ b/scripts/github_actions/generate_build_matrix.py @@ -207,10 +207,16 @@ def generate_build_matrix(enable_cuda, for_windows, for_macos, test_only_latest_ if not for_windows else ["11.8.0", "12.1.0"], }, + "2.4.0": { + "python-version": ["3.8", "3.9", "3.10", "3.11", "3.12"], + "cuda": ["11.8", "12.1", "12.4"] # default 12.1 + if not for_windows + else ["11.8.0", "12.1.0", "12.4.0"], + }, # https://github.com/Jimver/cuda-toolkit/blob/master/src/links/windows-links.ts } if test_only_latest_torch: - latest = "2.3.1" + latest = "2.4.0" matrix = {latest: matrix[latest]} if for_windows or for_macos: @@ -246,15 +252,20 @@ def generate_build_matrix(enable_cuda, for_windows, for_macos, test_only_latest_ for p in python_versions: if p in excluded_python_versions: continue - if for_macos and p in ["3.8", "3.9"]: - # macOS arm64 in github actions does not support python 3.8 or 3.9 - continue if for_windows: p = "cp" + "".join(p.split(".")) ans.append({"torch": torch, "python-version": p}) elif for_macos: ans.append({"torch": torch, "python-version": p}) + elif version_ge(torch, "2.4.0"): + ans.append( + { + "torch": torch, + "python-version": p, + "image": "pytorch/manylinux-builder:cpu-2.4", + } + ) elif version_ge(torch, "2.2.0"): ans.append( { diff --git a/scripts/github_actions/install_cuda.sh b/scripts/github_actions/install_cuda.sh index 3d47f4c..3a4f527 100755 --- a/scripts/github_actions/install_cuda.sh +++ b/scripts/github_actions/install_cuda.sh @@ -55,6 +55,9 @@ case "$cuda" in 12.1) url=https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.run ;; + 12.4) + url=https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run + ;; *) echo "Unknown cuda version: $cuda" exit 1 diff --git a/scripts/github_actions/install_cudnn.sh b/scripts/github_actions/install_cudnn.sh index 527e9a7..12c5553 100755 --- a/scripts/github_actions/install_cudnn.sh +++ b/scripts/github_actions/install_cudnn.sh @@ -48,6 +48,9 @@ case $cuda in 12.1) filename=cudnn-linux-x86_64-8.9.5.29_cuda12-archive.tar.xz ;; + 12.4) + filename=cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz + ;; *) echo "Unsupported cuda version: $cuda" exit 1 diff --git a/scripts/github_actions/install_torch.sh b/scripts/github_actions/install_torch.sh index 298456b..84e9edd 100755 --- a/scripts/github_actions/install_torch.sh +++ b/scripts/github_actions/install_torch.sh @@ -14,6 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -x + if [ x"$TORCH_VERSION" != x"" ] && [ x"$CUDA_VERSION" != x"" ]; then torch=$TORCH_VERSION cuda=$CUDA_VERSION @@ -211,6 +213,23 @@ case ${torch} in ;; esac ;; + 2.4.*) + case ${cuda} in + 11.8) + package="torch==${torch}+cu118" + # https://download.pytorch.org/whl/nightly/torch/ + url=https://download.pytorch.org/whl/torch/ + ;; + 12.1) + package="torch==${torch}+cu121" + url=https://download.pytorch.org/whl/torch/ + ;; + 12.4) + package="torch==${torch}+cu124" + url=https://download.pytorch.org/whl/torch/ + ;; + esac + ;; *) echo "Unsupported PyTorch version: ${torch}" exit 1