From 6e87bb80853ffabbfd494e167399a0e3ab34d24c Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Sat, 4 Jun 2022 11:58:18 +0800 Subject: [PATCH] Update readme. --- .../nightly-tests-ubuntu-conda-cpu.yml | 4 -- .../nightly-tests-ubuntu-conda-cuda.yml | 4 -- .../nightly-tests-ubuntu-pip-cuda.yml | 2 +- .../nightly-tests-windows-pip-cuda.yml | 4 -- .github/workflows/run-tests-ubuntu-cuda.yml | 4 +- .github/workflows/run-tests-windows-cuda.yml | 5 +- README.md | 70 +++++++++++++++---- doc/source/images/README.md | 8 +++ doc/source/images/os-green.svg | 1 + doc/source/images/os.svg | 1 - 10 files changed, 69 insertions(+), 34 deletions(-) create mode 100644 doc/source/images/README.md create mode 100644 doc/source/images/os-green.svg delete mode 100644 doc/source/images/os.svg diff --git a/.github/workflows/nightly-tests-ubuntu-conda-cpu.yml b/.github/workflows/nightly-tests-ubuntu-conda-cpu.yml index 7d47131..d5e7689 100644 --- a/.github/workflows/nightly-tests-ubuntu-conda-cpu.yml +++ b/.github/workflows/nightly-tests-ubuntu-conda-cpu.yml @@ -17,10 +17,6 @@ name: Nightly tests ubuntu conda cpu on: - push: - branches: - - nightly-test-2 - schedule: # minute (0-59) # hour (0-23) diff --git a/.github/workflows/nightly-tests-ubuntu-conda-cuda.yml b/.github/workflows/nightly-tests-ubuntu-conda-cuda.yml index 521bbdd..eb5fda0 100644 --- a/.github/workflows/nightly-tests-ubuntu-conda-cuda.yml +++ b/.github/workflows/nightly-tests-ubuntu-conda-cuda.yml @@ -17,10 +17,6 @@ name: Nightly tests ubuntu conda cuda on: - push: - branches: - - nightly-test-2 - schedule: # minute (0-59) # hour (0-23) diff --git a/.github/workflows/nightly-tests-ubuntu-pip-cuda.yml b/.github/workflows/nightly-tests-ubuntu-pip-cuda.yml index 300b834..b39b9d6 100644 --- a/.github/workflows/nightly-tests-ubuntu-pip-cuda.yml +++ b/.github/workflows/nightly-tests-ubuntu-pip-cuda.yml @@ -48,7 +48,7 @@ jobs: needs: generate_build_matrix runs-on: ubuntu-18.04 strategy: - fail-fast: true + fail-fast: false matrix: ${{ fromJson(needs.generate_build_matrix.outputs.matrix) }} diff --git a/.github/workflows/nightly-tests-windows-pip-cuda.yml b/.github/workflows/nightly-tests-windows-pip-cuda.yml index d3241a6..10ca353 100644 --- a/.github/workflows/nightly-tests-windows-pip-cuda.yml +++ b/.github/workflows/nightly-tests-windows-pip-cuda.yml @@ -17,10 +17,6 @@ name: Nightly tests windows pip cuda on: - push: - branches: - - nightly-test - schedule: # minute (0-59) # hour (0-23) diff --git a/.github/workflows/run-tests-ubuntu-cuda.yml b/.github/workflows/run-tests-ubuntu-cuda.yml index d6a6972..51251b5 100644 --- a/.github/workflows/run-tests-ubuntu-cuda.yml +++ b/.github/workflows/run-tests-ubuntu-cuda.yml @@ -39,8 +39,8 @@ jobs: id: set-matrix run: | # outputting for debugging purposes - python scripts/github_actions/generate_build_matrix.py --enable-cuda - MATRIX=$(python scripts/github_actions/generate_build_matrix.py --enable-cuda) + python scripts/github_actions/generate_build_matrix.py --enable-cuda --test-only-latest-torch + MATRIX=$(python scripts/github_actions/generate_build_matrix.py --enable-cuda --test-only-latest-torch) echo "::set-output name=matrix::${MATRIX}" run_tests_ubuntu_cuda: diff --git a/.github/workflows/run-tests-windows-cuda.yml b/.github/workflows/run-tests-windows-cuda.yml index cbb98de..6d04dd5 100644 --- a/.github/workflows/run-tests-windows-cuda.yml +++ b/.github/workflows/run-tests-windows-cuda.yml @@ -20,7 +20,6 @@ name: Run tests windows cuda on: push: branches: - - nightly-test - master pull_request: @@ -41,8 +40,8 @@ jobs: id: set-matrix run: | # outputting for debugging purposes - python scripts/github_actions/generate_build_matrix.py --enable-cuda --for-windows - MATRIX=$(python scripts/github_actions/generate_build_matrix.py --enable-cuda --for-windows) + python scripts/github_actions/generate_build_matrix.py --enable-cuda --for-windows --test-only-latest-torch + MATRIX=$(python scripts/github_actions/generate_build_matrix.py --enable-cuda --for-windows --test-only-latest-torch) echo "::set-output name=matrix::${MATRIX}" run_tests_windows_cuda: diff --git a/README.md b/README.md index 170c0e7..9513b14 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # kaldifeat
- + @@ -268,15 +268,22 @@ See . See . +## sherpa + +[sherpa](https://github.com/k2-fsa/sherpa) uses kaldifeat for streaming feature +extraction. + +See + # Installation -## From conda (Only for Linux + CUDA) +## From conda (Only for Linux) Supported versions of Python, PyTorch, and CUDA toolkit are listed below: -[![Supported Python versions](/doc/source/images/python-3.6_3.7_3.8-blue.svg)](/doc/source/images/python-3.6_3.7_3.8-blue.svg) -[![Supported PyTorch versions](/doc/source/images/pytorch-1.6.0_1.7.0_1.7.1_1.8.0_1.8.1_1.9.0-green.svg)](/doc/source/images/pytorch-1.6.0_1.7.0_1.7.1_1.8.0_1.8.1_1.9.0-green.svg) -[![Supported CUDA versions](/doc/source/images/cuda-10.1_10.2_11.0_11.1-orange.svg)](/doc/source/images/cuda-10.1_10.2_11.0_11.1-orange.svg) +[![Supported Python versions](/doc/source/images/python_ge_3.6-blue.svg)](/doc/source/images/python_ge_3.6-blue.svg) +[![Supported PyTorch versions](/doc/source/images/pytorch_ge_1.5.0-green.svg)](/doc/source/images/pytorch_ge_1.5.0-green.svg) +[![Supported CUDA versions](/doc/source/images/cuda_ge_10.1-orange.svg)](/doc/source/images/cuda_ge_10.1-orange.svg) ```bash conda install -c kaldifeat -c pytorch -c conda-forge kaldifeat python=3.8 cudatoolkit=11.1 pytorch=1.8.1 @@ -284,11 +291,17 @@ conda install -c kaldifeat -c pytorch -c conda-forge kaldifeat python=3.8 cudato You can select the supported Python version, CUDA toolkit version and PyTorch version as you wish. -**Note:** If you want a CPU only version or want to install `kaldifeat` on other operating systems, -e.g., macOS, please use `pip install` or compile `kaldifeat` from source. +To install a CPU version, use + +```bash +conda install -c kaldifeat -c pytorch cpuonly kaldifeat python=3.8 pytorch=1.8.1 +``` -## From PyPi with pip +**Note:** If you want to install `kaldifeat` on macOS or Windows, please +use either `pip install -v kaldifeat` or compile `kaldifeat` from source. + +## From PyPi with pip (Support Linux/macOS/Windows) You need to install PyTorch and CMake first. CMake 3.11 is known to work. Other CMake versions may also work. @@ -298,7 +311,7 @@ PyTorch 1.6.0 and above are known to work. Other PyTorch versions may also work. pip install -v kaldifeat ``` -## From source +## From source (Support Linux/macOS/Windows) The following are the commands to compile `kaldifeat` from source. We assume that you have installed `CMake` and PyTorch. @@ -321,14 +334,41 @@ python3 -c "import kaldifeat; print(kaldifeat.__version__)" ### How to install a CUDA version -There are two approaches: +You need to first install a CUDA version of PyTorch and then install `kaldifeat`. - - (1) Install using `conda`. It always installs a CUDA version of kaldifeat. - - (2) Install a CUDA version of PyTorch and then install kaldifeat from source - or use `pip install kaldifeat`. +**Note**: You can use a CUDA version of kaldifeat on machines with no GPUs. ### How to install a CPU-only version -You have to first install a CPU-only version of PyTorch and then install kaldifeat -from source or use `pip install kaldifeat`. +You need to first install a CPU version of PyTorch and then install `kaldifeat`. + +### How to fix `Caffe2: Cannot find cuDNN library` + +``` + Your installed Caffe2 version uses cuDNN but I cannot find the cuDNN + libraries. Please set the proper cuDNN prefixes and / or install cuDNN. +``` + +This error happens when you want to install a CUDA version of kaldifeat +by `pip install kaldifeat` or from source. + +You need to first install cuDNN. Assume you have installed cuDNN to the +path `/path/to/cudnn`. You can fix the error by the following commands. + +(1) Fix for installation using `pip install` + +```bash +export KALDIFEAT_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DCUDNN_LIBRARY_PATH=/path/to/cudnn/lib/libcudnn.so -DCUDNN_INCLUDE_PATH=/path/to/cudnn/include" +pip install --verbose kaldifeat +``` + +(2) Fix for installation from source + +```bash +mkdir /some/path +git clone https://github.com/csukuangfj/kaldifeat.git +cd kaldifeat +export KALDIFEAT_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DCUDNN_LIBRARY_PATH=/path/to/cudnn/lib/libcudnn.so -DCUDNN_INCLUDE_PATH=/path/to/cudnn/include" +python setup.py install +``` diff --git a/doc/source/images/README.md b/doc/source/images/README.md new file mode 100644 index 0000000..542998b --- /dev/null +++ b/doc/source/images/README.md @@ -0,0 +1,8 @@ +## File description + + is used to create the following files: + +- ./os.svg +- ./python_ge_3.6-blue.svg +- ./cuda_ge_10.1-orange.svg +- ./pytorch_ge_1.5.0-green.svg diff --git a/doc/source/images/os-green.svg b/doc/source/images/os-green.svg new file mode 100644 index 0000000..b78017a --- /dev/null +++ b/doc/source/images/os-green.svg @@ -0,0 +1 @@ +os: Linux | macOS | WindowsosLinux | macOS | Windows diff --git a/doc/source/images/os.svg b/doc/source/images/os.svg deleted file mode 100644 index 314bf44..0000000 --- a/doc/source/images/os.svg +++ /dev/null @@ -1 +0,0 @@ -OS: Linux | macOSOSLinux | macOS