-
Notifications
You must be signed in to change notification settings - Fork 320
Add ALM Data Pipeline tutorial and stages #1419
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
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
aad7d1d
feat: Add ALM Data Pipeline tutorial and stages
mohammadaaftabv 9b6c33c
style: Fix ruff linting issues in ALM pipeline
mohammadaaftabv 8f180b2
fix: Add bounds check for curr_idx in ALMDataBuilderStage
mohammadaaftabv 06fa9f2
Address PR review comments for ALM stages
mohammadaaftabv 19bd812
Fix sample data paths in README customization examples
mohammadaaftabv 861a1a7
Ensure stable output schema in ALMDataOverlapStage when all windows f…
mohammadaaftabv 2a3dfbe
Address all PR review comments for ALM stages
mohammadaaftabv 508be7d
Add ALMManifestReaderStage for EmptyTask-based pipeline
mohammadaaftabv 23b7ccb
fix: Use configurable min_bandwidth instead of hardcoded 8000 in _rec…
mohammadaaftabv 6297cd3
Fix ALM pipeline README, overlap stage, and benchmarking
mohammadaaftabv 0fca91c
Address all PR #1419 review comments
mohammadaaftabv f7e8f94
Update README install instructions: uv sync as primary method
mohammadaaftabv 129ba8d
Add testing docs to README, manifest reader/writer tests, and benchma…
mohammadaaftabv ff3b612
Enable Slack notifications in benchmark configuration
mohammadaaftabv b39fd3c
Refactor ALMManifestReader into CompositeStage with FilePartitioningS…
mohammadaaftabv 3747e48
Fix all ruff linting errors: type annotations, sorted __all__, noqa s…
mohammadaaftabv 16a7785
Restore alm_manifest_reader.py lost during rebase
mohammadaaftabv 2d127ab
Add directory-based manifest discovery tests and README docs
mohammadaaftabv 4fadab6
Fix ruff errors, add directory discovery tests and README example
mohammadaaftabv 3dfd12a
Add storage_options, blocksize, fix benchmark, update results
mohammadaaftabv 3f9381f
Ensure consistent output schema when entry has no windows
mohammadaaftabv 17aa0af
Fix repeat-factor to multiply entries after reading, not file paths
mohammadaaftabv 662b8dc
Fix ruff errors, merge upstream/main, address greptile review comments
mohammadaaftabv b9acff3
Make soundfile import lazy in common.py to fix CI Ray worker failures
mohammadaaftabv 7c85523
Fix CI Ray worker soundfile error by pre-initializing Ray client
mohammadaaftabv 64a0281
Fix CI soundfile error: lazy import in common.py, fix mock path in te…
mohammadaaftabv 111827a
Restore deleted multimodal benchmark entries in nightly-benchmark.yaml
mohammadaaftabv 8f6b28c
Fix _stage_perf shared reference bug in 1:many fan-out stages
mohammadaaftabv 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -156,3 +156,4 @@ data/ | |
| # macOS Files | ||
| .DS_Store | ||
| AGENTS.md | ||
| alm_output/ | ||
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,156 @@ | ||
| # ALM Pipeline Benchmark | ||
|
|
||
| A dedicated benchmark for measuring the performance of the ALM (Audio Language Model) data curation pipeline. The benchmark script lives at `benchmarking/scripts/alm_pipeline_benchmark.py` and runs through the full NeMo Curator benchmarking framework (Docker + Ray cluster + result collection). | ||
|
|
||
| ## How It Works | ||
|
|
||
| The benchmark script: | ||
| 1. Loads a JSONL manifest (supports cloud paths via fsspec) | ||
| 2. Optionally multiplies entries with `--repeat-factor` for scale testing | ||
| 3. Builds a Pipeline with ALMDataBuilderStage + ALMDataOverlapStage | ||
| 4. Runs through XennaExecutor (or ray_data/ray_actors) | ||
| 5. Writes `params.json`, `metrics.json`, and `tasks.pkl` for the framework | ||
|
|
||
| ## Running Benchmarks | ||
|
|
||
| The benchmarking framework is designed to run inside Docker. The benchmarking image | ||
| installs additional dependencies (`GitPython`, `pynvml`, `rich`, `slack_sdk`, etc.) | ||
| that are not part of `nemo_curator` itself. This applies to all benchmarks in the | ||
| repository, not just ALM. | ||
|
|
||
| **Prerequisites:** | ||
| - Docker with NVIDIA container toolkit | ||
| - NeMo Curator repository checked out | ||
|
|
||
| **Step 1: Build the benchmarking Docker image (one-time):** | ||
|
|
||
| ```bash | ||
| cd /path/to/Curator | ||
| bash benchmarking/tools/build_docker.sh --tag-as-latest | ||
| ``` | ||
|
|
||
| **Step 2: Disable the Slack sink for local runs.** | ||
|
|
||
| The shared `benchmarking/nightly-benchmark.yaml` has the Slack sink enabled, which | ||
| requires valid `SLACK_BOT_TOKEN` and `SLACK_CHANNEL_ID` credentials (used in CI). | ||
| For local testing, temporarily disable it: | ||
|
|
||
| ```yaml | ||
| sinks: | ||
| - name: slack | ||
| enabled: false # <-- change from true to false | ||
| live_updates: true | ||
| channel_id: ${SLACK_CHANNEL_ID} | ||
| default_metrics: ["exec_time_s"] | ||
| ``` | ||
|
|
||
| **Step 3: Run the ALM benchmark:** | ||
|
|
||
| The `--config` flag reads parameters directly from the `alm_pipeline_xenna` | ||
| entry in `benchmarking/nightly-benchmark.yaml`: | ||
|
|
||
| ```bash | ||
| docker run --rm --net=host --shm-size=8g \ | ||
| -v $(pwd):/opt/Curator \ | ||
| --entrypoint bash nemo_curator_benchmarking:latest \ | ||
| -c "cd /opt/Curator && python benchmarking/scripts/alm_pipeline_benchmark.py \ | ||
| --config benchmarking/nightly-benchmark.yaml" | ||
| ``` | ||
|
|
||
| The ALM pipeline is CPU-only so no `--gpus` flag is needed. | ||
| For CI/nightly runs, the benchmark is invoked via `benchmarking/tools/run.sh` | ||
| using the `alm_pipeline_xenna` entry. See `benchmarking/README.md` for details. | ||
|
|
||
| > **Remember** to re-enable the Slack sink (`enabled: true`) before pushing. | ||
|
|
||
| ## Benchmark Configuration | ||
|
|
||
| The ALM benchmark entry is defined in `benchmarking/nightly-benchmark.yaml`: | ||
|
|
||
| ```yaml | ||
| entries: | ||
| - name: alm_pipeline_xenna | ||
| script: alm_pipeline_benchmark.py | ||
| args: >- | ||
| --benchmark-results-path={session_entry_dir} | ||
| --input-manifest={curator_repo_dir}/tests/fixtures/audio/alm/sample_input.jsonl | ||
| --executor=xenna | ||
| --target-window-duration=120.0 | ||
| --tolerance=0.1 | ||
| --min-sample-rate=16000 | ||
| --min-bandwidth=8000 | ||
| --min-speakers=2 | ||
| --max-speakers=5 | ||
| --overlap-percentage=50 | ||
| --repeat-factor=2000 | ||
| requirements: | ||
| - metric: is_success | ||
| exact_value: true | ||
| - metric: total_builder_windows | ||
| min_value: 1 | ||
| - metric: total_filtered_windows | ||
| min_value: 1 | ||
| ``` | ||
|
|
||
| ## CLI Arguments | ||
|
|
||
| | Argument | Default | Description | | ||
| |----------|---------|-------------| | ||
| | `--benchmark-results-path` | Required | Directory for output files | | ||
| | `--input-manifest` | Required | Path to JSONL manifest | | ||
| | `--executor` | `xenna` | `xenna`, `ray_data`, or `ray_actors` | | ||
| | `--repeat-factor` | `1` | Multiply manifest entries for scale testing | | ||
| | `--target-window-duration` | `120.0` | Target window duration (seconds) | | ||
| | `--tolerance` | `0.1` | Window duration tolerance fraction | | ||
| | `--min-sample-rate` | `16000` | Minimum audio sample rate | | ||
| | `--min-bandwidth` | `8000` | Minimum segment bandwidth | | ||
| | `--min-speakers` | `2` | Minimum speakers per window | | ||
| | `--max-speakers` | `5` | Maximum speakers per window | | ||
| | `--overlap-percentage` | `50` | Overlap filter percentage (0-100) | | ||
|
|
||
| ## Benchmark Results | ||
|
|
||
| Results from running on a single workstation: | ||
|
|
||
| **Machine specs:** | ||
| - CPU: Intel Core i9-9900KF @ 3.60GHz (8 cores / 16 threads) | ||
| - RAM: 32 GB | ||
| - GPU: NVIDIA GeForce RTX 3080 Ti 12 GB (not used by ALM stages) | ||
| - OS: Ubuntu 20.04, Linux 5.15 | ||
|
|
||
| **Small scale (5 entries, sample fixture):** | ||
|
|
||
| | Metric | Value | | ||
| |--------|-------| | ||
| | Input entries | 5 | | ||
| | Output entries | 5 | | ||
| | Builder windows | 181 | | ||
| | Filtered windows | 25 | | ||
| | Total filtered duration | 3,035.50s | | ||
| | Execution time | 14.25s | | ||
| | Throughput (entries/sec) | 0.35 | | ||
|
|
||
| **Large scale (10,000 entries, repeat-factor=2000):** | ||
|
|
||
| | Metric | Value | | ||
| |--------|-------| | ||
| | Input entries | 10,000 | | ||
| | Output entries | 10,000 | | ||
| | Builder windows | 362,000 | | ||
| | Filtered windows | 50,000 | | ||
| | Total filtered duration | 6,071,000s | | ||
| | Execution time | 110.75s | | ||
| | Throughput (entries/sec) | 90.29 | | ||
| | Throughput (windows/sec) | 3,268.49 | | ||
|
|
||
| The `repeat-factor` multiplies entries in-memory after reading (via `_RepeatEntriesStage`), so the manifest file is read only once. The pipeline scales well with XennaExecutor auto-allocating workers per stage via the CompositeStage reader (FilePartitioningStage + ALMManifestReaderStage). | ||
|
|
||
| ## Output Files | ||
|
|
||
| The benchmark produces three files in `--benchmark-results-path`: | ||
|
|
||
| | File | Description | | ||
| |------|-------------| | ||
| | `params.json` | All pipeline parameters for reproducibility | | ||
| | `metrics.json` | `is_success`, `time_taken_s`, `throughput_entries_per_sec`, `throughput_windows_per_sec`, window counts, durations | | ||
| | `tasks.pkl` | Pickled task objects for `TaskPerfUtils` aggregation | |
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
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.
Uh oh!
There was an error while loading. Please reload this page.