Update readme.

This commit is contained in:
Fangjun Kuang 2022-06-04 11:58:18 +08:00
parent 7563aba767
commit 6e87bb8085
10 changed files with 69 additions and 34 deletions

View File

@ -17,10 +17,6 @@
name: Nightly tests ubuntu conda cpu name: Nightly tests ubuntu conda cpu
on: on:
push:
branches:
- nightly-test-2
schedule: schedule:
# minute (0-59) # minute (0-59)
# hour (0-23) # hour (0-23)

View File

@ -17,10 +17,6 @@
name: Nightly tests ubuntu conda cuda name: Nightly tests ubuntu conda cuda
on: on:
push:
branches:
- nightly-test-2
schedule: schedule:
# minute (0-59) # minute (0-59)
# hour (0-23) # hour (0-23)

View File

@ -48,7 +48,7 @@ jobs:
needs: generate_build_matrix needs: generate_build_matrix
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
strategy: strategy:
fail-fast: true fail-fast: false
matrix: matrix:
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }} ${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}

View File

@ -17,10 +17,6 @@
name: Nightly tests windows pip cuda name: Nightly tests windows pip cuda
on: on:
push:
branches:
- nightly-test
schedule: schedule:
# minute (0-59) # minute (0-59)
# hour (0-23) # hour (0-23)

View File

@ -39,8 +39,8 @@ jobs:
id: set-matrix id: set-matrix
run: | run: |
# outputting for debugging purposes # outputting for debugging purposes
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) MATRIX=$(python scripts/github_actions/generate_build_matrix.py --enable-cuda --test-only-latest-torch)
echo "::set-output name=matrix::${MATRIX}" echo "::set-output name=matrix::${MATRIX}"
run_tests_ubuntu_cuda: run_tests_ubuntu_cuda:

View File

@ -20,7 +20,6 @@ name: Run tests windows cuda
on: on:
push: push:
branches: branches:
- nightly-test
- master - master
pull_request: pull_request:
@ -41,8 +40,8 @@ jobs:
id: set-matrix id: set-matrix
run: | run: |
# outputting for debugging purposes # outputting for debugging purposes
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) MATRIX=$(python scripts/github_actions/generate_build_matrix.py --enable-cuda --for-windows --test-only-latest-torch)
echo "::set-output name=matrix::${MATRIX}" echo "::set-output name=matrix::${MATRIX}"
run_tests_windows_cuda: run_tests_windows_cuda:

View File

@ -1,7 +1,7 @@
# kaldifeat # kaldifeat
<div align="center"> <div align="center">
<img src="/doc/source/images/os.svg"> <img src="/doc/source/images/os-green.svg">
<img src="/doc/source/images/python_ge_3.6-blue.svg"> <img src="/doc/source/images/python_ge_3.6-blue.svg">
<img src="/doc/source/images/pytorch_ge_1.5.0-green.svg"> <img src="/doc/source/images/pytorch_ge_1.5.0-green.svg">
<img src="/doc/source/images/cuda_ge_10.1-orange.svg"> <img src="/doc/source/images/cuda_ge_10.1-orange.svg">
@ -268,15 +268,22 @@ See <https://github.com/k2-fsa/k2/blob/v2.0-pre/k2/torch/csrc/features.cu>.
See <https://github.com/lhotse-speech/lhotse/blob/master/lhotse/features/kaldifeat.py>. See <https://github.com/lhotse-speech/lhotse/blob/master/lhotse/features/kaldifeat.py>.
## sherpa
[sherpa](https://github.com/k2-fsa/sherpa) uses kaldifeat for streaming feature
extraction.
See <https://github.com/k2-fsa/sherpa/blob/master/sherpa/bin/pruned_stateless_emformer_rnnt2/decode.py>
# Installation # Installation
## From conda (Only for Linux + CUDA) ## From conda (Only for Linux)
Supported versions of Python, PyTorch, and CUDA toolkit are listed below: 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 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-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 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-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 CUDA versions](/doc/source/images/cuda_ge_10.1-orange.svg)](/doc/source/images/cuda_ge_10.1-orange.svg)
```bash ```bash
conda install -c kaldifeat -c pytorch -c conda-forge kaldifeat python=3.8 cudatoolkit=11.1 pytorch=1.8.1 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. 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, To install a CPU version, use
e.g., macOS, please use `pip install` or compile `kaldifeat` from source.
```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. You need to install PyTorch and CMake first.
CMake 3.11 is known to work. Other CMake versions may also work. 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 pip install -v kaldifeat
``` ```
## From source ## From source (Support Linux/macOS/Windows)
The following are the commands to compile `kaldifeat` from source. The following are the commands to compile `kaldifeat` from source.
We assume that you have installed `CMake` and PyTorch. 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 ### 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. **Note**: You can use a CUDA version of kaldifeat on machines with no GPUs.
- (2) Install a CUDA version of PyTorch and then install kaldifeat from source
or use `pip install kaldifeat`.
### How to install a CPU-only version ### How to install a CPU-only version
You have to first install a CPU-only version of PyTorch and then install kaldifeat You need to first install a CPU version of PyTorch and then install `kaldifeat`.
from source or use `pip 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
```

View File

@ -0,0 +1,8 @@
## File description
<https://shields.io/> 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

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="176" height="20" role="img" aria-label="os: Linux | macOS | Windows"><title>os: Linux | macOS | Windows</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="176" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="23" height="20" fill="#555"/><rect x="23" width="153" height="20" fill="#97ca00"/><rect width="176" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="125" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="130">os</text><text x="125" y="140" transform="scale(.1)" fill="#fff" textLength="130">os</text><text aria-hidden="true" x="985" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="1430">Linux | macOS | Windows</text><text x="985" y="140" transform="scale(.1)" fill="#fff" textLength="1430">Linux | macOS | Windows</text></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="118" height="20" role="img" aria-label="OS: Linux | macOS"><title>OS: Linux | macOS</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="118" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="27" height="20" fill="#555"/><rect x="27" width="91" height="20" fill="#4c1"/><rect width="118" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="145" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="170">OS</text><text x="145" y="140" transform="scale(.1)" fill="#fff" textLength="170">OS</text><text aria-hidden="true" x="715" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="810">Linux | macOS</text><text x="715" y="140" transform="scale(.1)" fill="#fff" textLength="810">Linux | macOS</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB