From 1868136b403502463797bffd3f58e11dd08685da Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Mon, 24 Jul 2023 09:46:44 +0800 Subject: [PATCH] Fix ci (#73) --- .github/workflows/build-doc.yml | 2 + doc/requirements.txt | 2 +- doc/source/installation/from_wheels.rst | 92 +++++++++++++++++++ doc/source/installation/index.rst | 2 +- doc/source/usage/fbank_options.rst | 1 - .../github_actions/generate_build_matrix.py | 12 ++- 6 files changed, 105 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-doc.yml b/.github/workflows/build-doc.yml index 869b5c4..3bb1e13 100644 --- a/.github/workflows/build-doc.yml +++ b/.github/workflows/build-doc.yml @@ -52,6 +52,8 @@ jobs: cd doc python3 -m pip install -r ./requirements.txt make html + cp source/cpu.html build/html/ + cp source/cuda.html build/html/ touch build/html/.nojekyll - name: Deploy diff --git a/doc/requirements.txt b/doc/requirements.txt index 9d9bf4b..9c0114d 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ dataclasses recommonmark -sphinx +sphinx<7.0 sphinx-autodoc-typehints sphinx_rtd_theme sphinxcontrib-bibtex diff --git a/doc/source/installation/from_wheels.rst b/doc/source/installation/from_wheels.rst index a019a95..491fcf1 100644 --- a/doc/source/installation/from_wheels.rst +++ b/doc/source/installation/from_wheels.rst @@ -5,3 +5,95 @@ You can find pre-compiled wheels at - CPU wheels: ``_ - CUDA wheels: ``_ + +We give a few examples below to show you how to install `kaldifeat`_ from +pre-compiled wheels. + +Linux (CPU) +----------- + +Suppose you want to install the following wheel: + +.. code-block:: bash + + https://huggingface.co/csukuangfj/kaldifeat/resolve/main/macos/kaldifeat-1.24.dev20230722+cpu.torch2.0.1-cp311-cp311-macosx_10_9_x86_64.whl + +you can use one of the following methods: + +.. code-block:: bash + + # method 1 + pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch_stable.html + pip install kaldifeat==1.24.dev20230722+cpu.torch2.0.1 -f https://csukuangfj.github.io/kaldifeat/cpu.html + + # method 2 + pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch_stable.html + wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/macos/kaldifeat-1.24.dev20230722+cpu.torch2.0.1-cp311-cp311-macosx_10_9_x86_64.whl + pip install ./kaldifeat-1.24.dev20230722+cpu.torch2.0.1-cp311-cp311-macosx_10_9_x86_64.whl + + +Windows (CPU) +-------------- + +Suppose you want to install the following wheel: + +.. code-block:: bash + + https://huggingface.co/csukuangfj/kaldifeat/resolve/main/windows-cpu/kaldifeat-1.24.dev20230722+cpu.torch2.0.1-cp311-cp311-win_amd64.whl + +you can use one of the following methods: + +.. code-block:: bash + + # method 1 + pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch_stable.html + pip install kaldifeat==1.24.dev20230722+cpu.torch2.0.1 -f https://csukuangfj.github.io/kaldifeat/cpu.html + + # method 2 + pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch_stable.html + wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/windows-cpu/kaldifeat-1.24.dev20230722+cpu.torch2.0.1-cp311-cp311-win_amd64.whl + pip install ./kaldifeat-1.24.dev20230722+cpu.torch2.0.1-cp311-cp311-win_amd64.whl + +macOS (CPU) +----------- + +Suppose you want to install the following wheel: + +.. code-block:: bash + + https://huggingface.co/csukuangfj/kaldifeat/resolve/main/macos/kaldifeat-1.24.dev20230722+cpu.torch2.0.1-cp311-cp311-macosx_10_9_x86_64.whl + +you can use one of the following methods: + +.. code-block:: bash + + # method 1 + pip install torch==2.0.1 + pip install kaldifeat==1.24.dev20230722+cpu.torch2.0.1 -f https://csukuangfj.github.io/kaldifeat/cpu.html + + # method 2 + pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch_stable.html + wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/macos/kaldifeat-1.24.dev20230722+cpu.torch2.0.1-cp311-cp311-macosx_10_9_x86_64.whl + pip install ./kaldifeat-1.24.dev20230722+cpu.torch2.0.1-cp311-cp311-macosx_10_9_x86_64.whl + +Linux (CUDA) +------------ + +Suppose you want to install the following wheel: + +.. code-block:: bash + + https://huggingface.co/csukuangfj/kaldifeat/resolve/main/ubuntu-cuda/kaldifeat-1.24.dev20230722+cuda11.8.torch2.0.1-cp311-cp311-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.0.1+cu118 -f https://download.pytorch.org/whl/torch_stable.html + pip install kaldifeat==1.24.dev20230722+cuda11.8.torch2.0.1 -f https://csukuangfj.github.io/kaldifeat/cuda.html + + # method 2 + pip install torch==2.0.1+cu118 -f https://download.pytorch.org/whl/torch_stable.html + wget https://huggingface.co/csukuangfj/kaldifeat/resolve/main/ubuntu-cuda/kaldifeat-1.24.dev20230722+cuda11.8.torch2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + pip install ./kaldifeat-1.24.dev20230722+cuda11.8.torch2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl diff --git a/doc/source/installation/index.rst b/doc/source/installation/index.rst index 248d9f3..7d31707 100644 --- a/doc/source/installation/index.rst +++ b/doc/source/installation/index.rst @@ -2,7 +2,7 @@ Installation ============ .. toctree:: - :maxdepth: 2 + :maxdepth: 3 ./from_wheels.rst ./from_source.rst diff --git a/doc/source/usage/fbank_options.rst b/doc/source/usage/fbank_options.rst index d9adc2d..c30c3e9 100644 --- a/doc/source/usage/fbank_options.rst +++ b/doc/source/usage/fbank_options.rst @@ -10,7 +10,6 @@ The following code shows how to construct an instance of `kaldifeat.FbankOptions .. literalinclude:: ./code/fbank_options-1.txt :caption: Usage of `kaldifeat.FbankOptions`_ :emphasize-lines: 6,8,22,37 - :language: python Note that we reuse the same option name with `compute-fbank-feats`_ from `Kaldi`_: diff --git a/scripts/github_actions/generate_build_matrix.py b/scripts/github_actions/generate_build_matrix.py index e135c57..93a3b86 100755 --- a/scripts/github_actions/generate_build_matrix.py +++ b/scripts/github_actions/generate_build_matrix.py @@ -131,15 +131,21 @@ def generate_build_matrix(enable_cuda, for_windows, for_macos, test_only_latest_ }, "1.13.1": { "python-version": ["3.7", "3.8", "3.9", "3.10", "3.11"], - "cuda": ["11.6", "11.7"], # default 11.7 + "cuda": ["11.6", "11.7"] # default 11.7 + if not for_windows + else ["11.6.2", "11.7.1"], }, "2.0.0": { "python-version": ["3.8", "3.9", "3.10", "3.11"], - "cuda": ["11.7", "11.8"], # default 11.7 + "cuda": ["11.7", "11.8"] # default 11.7 + if not for_windows + else ["11.7.1", "11.8.0"], }, "2.0.1": { "python-version": ["3.8", "3.9", "3.10", "3.11"], - "cuda": ["11.7", "11.8"], # default 11.7 + "cuda": ["11.7", "11.8"] # default 11.7 + if not for_windows + else ["11.7.1", "11.8.0"], }, } if test_only_latest_torch: