Skip to content

Latest commit

 

History

History

pytorch

FastPitch

FastPitch for mel-spectrogram generation based on the fastpitch project, optimised for Graphcore's IPU.

Framework Domain Model Datasets Tasks Training Inference Reference
PyTorch Speech FastPitch LJ-Speech mel-spectrogram generation


Min. 16 IPU (POD16) required

FastPitch: Parallel Text-to-speech with Pitch Prediction

Instructions summary

  1. Install and enable the Poplar SDK (see Poplar SDK setup)

  2. Install the system and Python requirements (see Environment setup)

  3. Download the LJ-Speech dataset (See Dataset setup)

Poplar SDK setup

To check if your Poplar SDK has already been enabled, run:

 echo $POPLAR_SDK_ENABLED

If no path is provided, then follow these steps:

  1. Navigate to your Poplar SDK root directory

  2. Enable the Poplar SDK with:

cd poplar-<OS version>-<SDK version>-<hash>
. enable.sh
  1. Additionally, enable PopART with:
cd popart-<OS version>-<SDK version>-<hash>
. enable.sh

More detailed instructions on setting up your Poplar environment are available in the Poplar quick start guide.

Environment setup

To prepare your environment, follow these steps:

  1. Create and activate a Python3 virtual environment:
python3 -m venv <venv name>
source <venv path>/bin/activate
  1. Navigate to this examples root directory

  2. Install the Python requirements

pip3 install -r requirements.txt

More detailed instructions on setting up your PyTorch environment are available in the PyTorch quick start guide.

Dataset setup

Download the LJ-Speech dataset from the source or using the scripts provided:

bash scripts/download_dataset.sh

And preprocess the dataset using:

bash scripts/download_tacotron2.sh
bash scripts/prepare_dataset.sh

This may take a long time (about 10 hours) because it uses tacotron2 on CPU to do duration prediction.

Disk space required: 2.6GB

.
├──
 directories, file

Running and benchmarking

To run a tested and optimised configuration and to reproduce the performance shown on our performance results page, use the examples_utils module (installed automatically as part of the environment setup) to run one or more benchmarks. The benchmarks are provided in the benchmarks.yml file in this example's root directory.

For example:

python3 -m examples_utils benchmark --spec <path to benchmarks.yml file>

Or to run a specific benchmark in the benchmarks.yml file provided:

python3 -m examples_utils benchmark --spec <path to benchmarks.yml file> --benchmark <name of benchmark>

For more information on using the examples-utils benchmarking module, please refer to the README.

License

The example in this directory is licensed under the Apache License, Version 2.0. See the LICENSE file in this directory. This license applies to the following files:

  • dataset.py
  • ipu_config.py
  • pipeline_base_model.py
  • pics/loss_curve.jpeg
  • platform/FastPitch_FP32_2IPU.sh
  • README.md
  • tests/test_layers.py
  • tests/unit_tester.py

The other files come from the original FastPitch repository which is licensed under the 3-clause BSD license. The license from that repository is reproduced here as ORIGINAL-FASTPITCH-LICENSE. Some of the files in the common/text subdirectory are based on content from https://github.com/keithito/tacotron which is licensed under the MIT license. See the LICENSE file in that subdirectory for details.