Skip to content
Merged
Show file tree
Hide file tree
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 Jan 27, 2026
9b6c33c
style: Fix ruff linting issues in ALM pipeline
mohammadaaftabv Jan 27, 2026
8f180b2
fix: Add bounds check for curr_idx in ALMDataBuilderStage
mohammadaaftabv Jan 29, 2026
06fa9f2
Address PR review comments for ALM stages
mohammadaaftabv Feb 7, 2026
19bd812
Fix sample data paths in README customization examples
mohammadaaftabv Feb 7, 2026
861a1a7
Ensure stable output schema in ALMDataOverlapStage when all windows f…
mohammadaaftabv Feb 7, 2026
2a3dfbe
Address all PR review comments for ALM stages
mohammadaaftabv Feb 19, 2026
508be7d
Add ALMManifestReaderStage for EmptyTask-based pipeline
mohammadaaftabv Feb 22, 2026
23b7ccb
fix: Use configurable min_bandwidth instead of hardcoded 8000 in _rec…
mohammadaaftabv Feb 23, 2026
6297cd3
Fix ALM pipeline README, overlap stage, and benchmarking
mohammadaaftabv Feb 24, 2026
0fca91c
Address all PR #1419 review comments
mohammadaaftabv Feb 24, 2026
f7e8f94
Update README install instructions: uv sync as primary method
mohammadaaftabv Feb 24, 2026
129ba8d
Add testing docs to README, manifest reader/writer tests, and benchma…
mohammadaaftabv Feb 25, 2026
ff3b612
Enable Slack notifications in benchmark configuration
mohammadaaftabv Feb 25, 2026
b39fd3c
Refactor ALMManifestReader into CompositeStage with FilePartitioningS…
mohammadaaftabv Feb 26, 2026
3747e48
Fix all ruff linting errors: type annotations, sorted __all__, noqa s…
mohammadaaftabv Feb 26, 2026
16a7785
Restore alm_manifest_reader.py lost during rebase
mohammadaaftabv Feb 26, 2026
2d127ab
Add directory-based manifest discovery tests and README docs
mohammadaaftabv Feb 26, 2026
4fadab6
Fix ruff errors, add directory discovery tests and README example
mohammadaaftabv Feb 26, 2026
3dfd12a
Add storage_options, blocksize, fix benchmark, update results
mohammadaaftabv Feb 26, 2026
3f9381f
Ensure consistent output schema when entry has no windows
mohammadaaftabv Feb 27, 2026
17aa0af
Fix repeat-factor to multiply entries after reading, not file paths
mohammadaaftabv Mar 3, 2026
662b8dc
Fix ruff errors, merge upstream/main, address greptile review comments
mohammadaaftabv Mar 3, 2026
b9acff3
Make soundfile import lazy in common.py to fix CI Ray worker failures
mohammadaaftabv Mar 3, 2026
7c85523
Fix CI Ray worker soundfile error by pre-initializing Ray client
mohammadaaftabv Mar 5, 2026
64a0281
Fix CI soundfile error: lazy import in common.py, fix mock path in te…
mohammadaaftabv Mar 5, 2026
111827a
Restore deleted multimodal benchmark entries in nightly-benchmark.yaml
mohammadaaftabv Mar 9, 2026
8f6b28c
Fix _stage_perf shared reference bug in 1:many fan-out stages
mohammadaaftabv Mar 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,4 @@ data/
# macOS Files
.DS_Store
AGENTS.md
alm_output/
156 changes: 156 additions & 0 deletions benchmarking/ALM_BENCHMARK.md
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 |
1 change: 1 addition & 0 deletions benchmarking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ Your script **must** write three JSON/pickle files to the `--benchmark-results-p
### Reference Implementations

See existing scripts in `scripts/` for complete examples:
- `alm_pipeline_benchmark.py` - ALM audio pipeline benchmark ([detailed docs](ALM_BENCHMARK.md))
- `domain_classification_benchmark.py` - Domain classification with model inference
- `embedding_generation_benchmark.py` - Embedding generation benchmark
- `removal_benchmark.py` - Data removal operations benchmark
Expand Down
29 changes: 29 additions & 0 deletions benchmarking/nightly-benchmark.yaml
Comment thread
mohammadaaftabv marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -769,3 +769,32 @@ entries:
num_cpus: 64
num_gpus: 0
enable_object_spilling: false

- name: alm_pipeline_xenna
enabled: true
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
timeout_s: 600
sink_data: []
ray:
num_cpus: 8
num_gpus: 0
enable_object_spilling: false
requirements:
- metric: is_success
exact_value: true
- metric: total_builder_windows
min_value: 1
- metric: total_filtered_windows
min_value: 1
Loading
Loading