Skip to content

Commit

Permalink
Merge pull request #387 from kan-bayashi/feature/vq-vae
Browse files Browse the repository at this point in the history
  • Loading branch information
kan-bayashi authored Jan 10, 2023
2 parents 42cf694 + 3e3aef5 commit fdfb04d
Show file tree
Hide file tree
Showing 108 changed files with 7,188 additions and 550 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
- name: ShellCheck
run: |
export PATH=shellcheck-stable:$PATH
# not to check the script copied from kaldi
find egs -name "*.sh" | grep -v path.sh | while read line; do shellcheck -x --shell=bash -P $(dirname $line) ${line}; done
- name: Black & Flake8
run: |
Expand Down Expand Up @@ -96,3 +97,42 @@ jobs:
with:
name: artifacts-${{ matrix.config }}
path: egs/yesno/voc1

integration_vq:
runs-on: ubuntu-20.04
strategy:
max-parallel: 10
matrix:
python-version: [3.7]
pytorch-version: [1.9]
config:
- "melgan_vae.v3.debug.yaml"
- "conditioned_melgan_vae.v3.debug.yaml"
- "local_conditioned_melgan_vae.v3.debug.yaml"
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-pip-
- name: Install dependencies
run: |
sudo apt-get install libsndfile-dev jq
# make python env
cd tools; make CUDA_VERSION="" PYTHON=python${{ matrix.python-version }} PYTORCH_VERSION=${{ matrix.pytorch-version }}
source venv/bin/activate
pip install pyreaper
- name: Integration
run: |
cd egs/yesno/vq1 && ./run.sh --conf conf/${{ matrix.config }}
- uses: actions/upload-artifact@v1
if: failure()
with:
name: artifacts-${{ matrix.config }}
path: egs/yesno/voc1
2 changes: 1 addition & 1 deletion egs/arctic/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/csd/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/csmsc/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/cvss_c/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/jnas/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/jsss/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/jsut/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/kiritan/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/kising/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/kss/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/libritts/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/ljspeech/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/natsume/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/no7singing/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/ofuton_p_utagoe_db/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/oniku_kurumi_utagoe_db/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/opencpop/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/pjs/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/speech_commands/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/talromur/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/template_multi_spk/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
2 changes: 1 addition & 1 deletion egs/template_single_spk/voc1/path.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cuda related
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"

# path related
Expand Down
91 changes: 91 additions & 0 deletions egs/vctk/hubert_voc1/cmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# ====== About run.pl, queue.pl, slurm.pl, and ssh.pl ======
# Usage: <cmd>.pl [options] JOB=1:<nj> <log> <command...>
# e.g.
# run.pl --mem 4G JOB=1:10 echo.JOB.log echo JOB
#
# Options:
# --time <time>: Limit the maximum time to execute.
# --mem <mem>: Limit the maximum memory usage.
# -–max-jobs-run <njob>: Limit the number parallel jobs. This is ignored for non-array jobs.
# --num-threads <ngpu>: Specify the number of CPU core.
# --gpu <ngpu>: Specify the number of GPU devices.
# --config: Change the configuration file from default.
#
# "JOB=1:10" is used for "array jobs" and it can control the number of parallel jobs.
# The left string of "=", i.e. "JOB", is replaced by <N>(Nth job) in the command and the log file name,
# e.g. "echo JOB" is changed to "echo 3" for the 3rd job and "echo 8" for 8th job respectively.
# Note that the number must start with a positive number, so you can't use "JOB=0:10" for example.
#
# run.pl, queue.pl, slurm.pl, and ssh.pl have unified interface, not depending on its backend.
# These options are mapping to specific options for each backend and
# it is configured by "conf/queue.conf" and "conf/slurm.conf" by default.
# If jobs failed, your configuration might be wrong for your environment.
#
#
# The official documentaion for run.pl, queue.pl, slurm.pl, and ssh.pl:
# "Parallelization in Kaldi": http://kaldi-asr.org/doc/queue.html
# =========================================================~


# Select the backend used by run.sh from "local", "stdout", "sge", "slurm", or "ssh"
cmd_backend="local"

# Local machine, without any Job scheduling system
if [ "${cmd_backend}" = local ]; then

# The other usage
export train_cmd="utils/run.pl"
# Used for "*_train.py": "--gpu" is appended optionally by run.sh
export cuda_cmd="utils/run.pl"
# Used for "*_recog.py"
export decode_cmd="utils/run.pl"

# Local machine, without any Job scheduling system
elif [ "${cmd_backend}" = stdout ]; then

# The other usage
export train_cmd="utils/stdout.pl"
# Used for "*_train.py": "--gpu" is appended optionally by run.sh
export cuda_cmd="utils/stdout.pl"
# Used for "*_recog.py"
export decode_cmd="utils/stdout.pl"

# "qsub" (SGE, Torque, PBS, etc.)
elif [ "${cmd_backend}" = sge ]; then
# The default setting is written in conf/queue.conf.
# You must change "-q g.q" for the "queue" for your environment.
# To know the "queue" names, type "qhost -q"
# Note that to use "--gpu *", you have to setup "complex_value" for the system scheduler.

export train_cmd="utils/queue.pl"
export cuda_cmd="utils/queue.pl"
export decode_cmd="utils/queue.pl"

# "sbatch" (Slurm)
elif [ "${cmd_backend}" = slurm ]; then
# The default setting is written in conf/slurm.conf.
# You must change "-p cpu" and "-p gpu" for the "partion" for your environment.
# To know the "partion" names, type "sinfo".
# You can use "--gpu * " by defualt for slurm and it is interpreted as "--gres gpu:*"
# The devices are allocated exclusively using "${CUDA_VISIBLE_DEVICES}".

export train_cmd="utils/slurm.pl"
export cuda_cmd="utils/slurm.pl"
export decode_cmd="utils/slurm.pl"

elif [ "${cmd_backend}" = ssh ]; then
# You have to create ".queue/machines" to specify the host to execute jobs.
# e.g. .queue/machines
# host1
# host2
# host3
# Assuming you can login them without any password, i.e. You have to set ssh keys.

export train_cmd="utils/ssh.pl"
export cuda_cmd="utils/ssh.pl"
export decode_cmd="utils/ssh.pl"

else
echo "$0: Error: Unknown cmd_backend=${cmd_backend}" 1>&2
return 1
fi
Loading

0 comments on commit fdfb04d

Please sign in to comment.