-
Notifications
You must be signed in to change notification settings - Fork 42
Nemo-run Processor for TopIPL training #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
89c7400
Ipl processors
nune-tadevosyan b9471e3
remove
nune-tadevosyan b4dc91c
some commits
nune-tadevosyan abc2240
IPL Processors
nune-tadevosyan bfdc49c
IPL Processors
nune-tadevosyan aae3a02
IPL Processors
nune-tadevosyan 125699a
Remove unneseccary files
nune-tadevosyan f5227e1
IPL dependencies
nune-tadevosyan c4ed0ca
Small changes
nune-tadevosyan e99bbae
Small changes
nune-tadevosyan fd64c04
Small changes
nune-tadevosyan 26c7fb8
Config changes
nune-tadevosyan d0e4180
Config place change
nune-tadevosyan 7920663
Moving configs
nune-tadevosyan d5fe869
Readme file
nune-tadevosyan c6e0cbc
Fix test
nune-tadevosyan 96bef79
Update nemo_run_config.yaml
nune-tadevosyan 3c4bda2
Update nemo_run_config.yaml
nune-tadevosyan 4a12139
Adding copyrights
nune-tadevosyan a40f89c
Adding imports from main
nune-tadevosyan 38a09d6
Merge remote-tracking branch 'origin/main' into sdp_ipl
nune-tadevosyan 87d7912
Adding copyrights
nune-tadevosyan 9bceadf
Doc update
nune-tadevosyan c6ea89c
Doc update
nune-tadevosyan d2c61ff
Doc update
nune-tadevosyan 8f303d1
Update config
nune-tadevosyan ecfdaf4
Update nemo_run_config.yaml
nune-tadevosyan 39c8221
Update ipl.txt
nune-tadevosyan 4f6c355
update
nune-tadevosyan a78eb23
Merge branch 'main' of github.com:NVIDIA/NeMo-speech-data-processor i…
nune-tadevosyan 9cbac0f
Small change
nune-tadevosyan 0b4a9d6
small update
nune-tadevosyan 6cb8b40
forse jiwer
Jorjeous 77b64f2
attempt 1 to fix certificates
Jorjeous a559483
attempt 2 to fix cert
Jorjeous 3a92ee2
small change
nune-tadevosyan 9e07c9b
Merge branch 'sdp_ipl' of github.com:NVIDIA/NeMo-speech-data-processo…
nune-tadevosyan c8ba85a
Doc changes
nune-tadevosyan 4392ef2
Doc changes
nune-tadevosyan b5a0637
Merge branch 'main' into sdp_ipl
Jorjeous File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| documentation: | | ||
| TopIPL | ||
| ###### | ||
|
|
||
| This config is used to run the `TopIPL: Iterative Pseudo-Labeling for ASR <https://arxiv.org/abs/2506.07659>`_ training algorithm using NeMo-Run. | ||
|
|
||
| TopIPL is a **semi-supervised training method** for automatic speech recognition (ASR) that iteratively alternates between model training and pseudo-label generation for unlabeled data. It uses a **top-N checkpoint averaging strategy** to create a strong teacher model and maintains a **dynamic cache** of pseudo-labels throughout the process. | ||
|
|
||
| The pipeline is implemented as a processor compatible with the `nemo_run` framework. It generates an output manifest containing updated labels based on pseudo-labeling iterations. | ||
|
|
||
| This config performs the following steps: | ||
|
|
||
| 1. Runs training and inference commands using NeMo-Run. | ||
| 2. Periodically stops training to generate pseudo-labels with a top-N checkpoint ensemble. | ||
| 3. Maintains a dynamic cache of pseudo-labels for unlabeled data. | ||
| 4. Produces a new output manifest after each iteration. | ||
|
|
||
| **Required arguments** | ||
|
|
||
| - **output_manifest_file**: path where the final manifest with pseudo-labels will be saved. | ||
| - **nemo_run_config**: YAML config file specifying the training, inference, and IPL parameters. | ||
|
|
||
| **Training config requirements** | ||
|
|
||
| Your training config must include the following setting to enable IPL: | ||
|
|
||
| .. code-block:: yaml | ||
|
|
||
| exp_manager: | ||
| create_ipl_epoch_stopper_callback: True | ||
|
|
||
| If you're not using Lhotse, also include: | ||
|
|
||
| .. code-block:: yaml | ||
|
|
||
| ipl_epoch_stopper_callback_params: | ||
| stop_every_n_epochs: 2 | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - nemo_run | ||
| - ``pip install -r ipl.txt`` | ||
|
|
||
| processors_to_run: all | ||
|
|
||
| processors: | ||
| - _target_: sdp.processors.IPL.nemo_run_processor.NemoRunIPLProcessor | ||
| config_path: ./nemo_run_config.yaml | ||
| output_manifest_file: ??? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # The script to be run. | ||
| script: # Script path to run relative to directory | ||
| script_config: # Training config file for the script. ipl_epoch_stopper_callback should be provided in the config | ||
| inference_config: # Inference config file of unlabeled data for transcribe_speech_parallel | ||
|
|
||
| exp_name: null # populated by exp_manager.name if not provided | ||
| results_dir: # Where to store the results of the run | ||
|
|
||
| # Path to the local NeMo repository. This is used to locate scripts and configs from NeMo. | ||
| # To set this up: | ||
| # 1. Clone the NeMo repository: | ||
| # git clone https://github.com/NVIDIA/NeMo.git /your/desired/path/to/nemo | ||
| # 2. Set the path here: | ||
| # Make sure this path is valid and NeMo is up to date if you're using its scripts. | ||
| nemo_directory: # Nemo directory path | ||
| do_average: # Boolean value indicating whether to do average of checkpoints for pseudo-label generation | ||
| p_cache: # Probability with which update pseudo-labeled set | ||
| num_ipl_epochs: # How many epochs do pseudo-labeling | ||
|
|
||
| # Optional arguments | ||
| num_runs: | ||
| num_gpus: | ||
| num_tasks_per_node: | ||
| max_runtime: # Specify for clusters | ||
|
|
||
| ######################################################################################################################## | ||
|
|
||
| executor: slurm # or local | ||
|
|
||
| USER: | ||
|
|
||
| # Fields for cluster run | ||
| ssh_tunnel: | ||
| host: | ||
| # ------------------------------- Fill this up! ------------------------------- | ||
| user: "${USER}" # your username; or resolved from ${USER} environment variable ; or can be null which resolved from ${USER} environment variable | ||
| job_dir: "" # Job directory to keep created files | ||
| identity: "" | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
| account: | ||
| partition: | ||
| job_name_prefix: | ||
|
|
||
| containers: | ||
| asr: # Container image | ||
|
|
||
|
|
||
| env_vars: | ||
| - 'TOKENIZERS_PARALLELISM=' | ||
| - 'AIS_ENDPOINT=' | ||
| - 'LHOTSE_AUDIO_DURATION_MISMATCH_TOLERANCE=' | ||
| - 'TORCH_CUDNN_V8_API_ENABLED=' | ||
| - 'PYTORCH_CUDA_ALLOC_CONF=' | ||
| - 'HYDRA_FULL_ERROR=1' | ||
|
|
||
| required_env_vars: | ||
| - 'HF_TOKEN=' | ||
| - 'WANDB_KEY=' | ||
|
|
||
| mounts: | ||
| # Replace with your own paths in your cluster config | ||
| - /path/to/mount:/where/to/mount/ | ||
|
|
||
| timeouts: | ||
| partition_name: # Specify time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| nemo_run | ||
karpnv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Nemo repository path is also required, it is used to locate scripts and configs from NeMo. | ||
| # | ||
| # To set this up: | ||
| # 1. Clone the NeMo repository: | ||
| # git clone https://github.com/NVIDIA/NeMo.git /your/desired/path/to/nemo | ||
| # 2. Set the path in nemo_run_config.yaml: | ||
| # nemo_directory: /your/desired/path/to/nemo | ||
| # | ||
| # Make sure this path is valid and NeMo is up to date if you're using its scripts. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # 🧠 TopIPL: Iterative Pseudo-Labeling for ASR | ||
|
|
||
| TopIPL is an **iterative pseudo-labeling algorithm** designed for training ASR models using both labeled and unlabeled data. It maintains a **dynamic pseudo-label cache** and leverages **top-N averaged checkpoints** as a teacher model to generate high-quality pseudo-labels across training iterations. | ||
|
|
||
| ## 📦 Contents | ||
|
|
||
| - `NemoRunIPLProcessor` — Command generator and job submitter for IPL runs, compatible with local and cluster environments. | ||
| - `nemo_run_config.yaml` — Main configuration file. Users should define all required paths and parameters here. | ||
|
|
||
| ## 🚀 Getting Started | ||
|
|
||
| TopIPL runs like any other processor in the `nemo_run` framework. To use it, you must pass: | ||
|
|
||
| - `output_manifest_file`: Path where the resulting manifest will be saved. | ||
| - `nemo_run_config`: YAML file containing IPL setup, training/inference configs, and NeMo-Run settings. | ||
|
|
||
| ### 🔧 Training Config Requirements | ||
|
|
||
| Your training config must: | ||
|
|
||
| ```yaml | ||
| exp_manager: | ||
| create_ipl_epoch_stopper_callback: True | ||
| ``` | ||
| If you're not using Lhotse, also include: | ||
|
|
||
| ```yaml | ||
| ipl_epoch_stopper_callback_params: | ||
| stop_every_n_epochs: 2 | ||
|
|
||
| ``` | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| Before using TopIPL, make sure the following are set up: | ||
|
|
||
| - Clone the NeMo repository: | ||
| ```bash | ||
| git clone https://github.com/NVIDIA/NeMo.git /your/desired/path/to/nemo | ||
|
|
||
| - Set the path to NeMo in your `nemo_run_config.yaml`: `nemo_directory: /your/desired/path/to/nemo` | ||
| - `pip install -r requirements/ipl.txt` | ||
|
|
||
| ### Running the Code | ||
|
|
||
| ```bash | ||
| python main.py --config-path=/path/to/directory/config --config-name=config.yaml |
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have descriptions in YAML files. Add it to this YAML file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Descriptions are mostly about datasets and processors
We added a README for the same purpose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done