Skip to content

feat(audio): align ASR scoring and support explicit Ray launches - #1539

Open
vmendelev wants to merge 2 commits into
mainfrom
task/speechlm-rl-main
Open

vmendelev wants to merge 2 commits into
mainfrom
task/speechlm-rl-main

Conversation

@vmendelev

@vmendelev vmendelev commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Number expansion can introduce accents and punctuation after text cleaning, so numeric references and equivalent spoken words can receive different scores. Apply the same cleaning after expansion and add regression coverage.

Add an opt-in CER whitespace policy for mixed Chinese/Latin transcripts: han_adjacent removes spacing beside Han characters while preserving Latin word boundaries. The existing default remains keep. The companion GSPO reward uses this option for Mandarin ASR.

Expose the existing NeMo-Run Ray launcher through ns run_cmd --with_ray and --ray_template. Forward declared environment variables into head/worker containers, support an explicit Ray executable and per-container package setup script, and remove the template's in-place modification of installed Ray source. Ordinary run-command behavior remains unchanged.

Validation: the latest focused scoring/launcher suite passed 22 tests. Prior branch validation also covered dependency isolation and rendered shell syntax; repository-pinned formatting/lint checks passed. Documentation covers scoring modes and launcher configuration. No new cluster launch is claimed for this PR.

The scoring and launcher changes can be reviewed independently of the model repositories. The GSPO WER-only reward does not require Skills, and training can use an independently configured Ray cluster.

Companion PRs

Summary by CodeRabbit

  • New Features
    • Added optional CER whitespace handling: keep whitespace unchanged, remove all whitespace, or remove whitespace adjacent to Han characters while preserving other word boundaries.
    • Added support for running a command once on the Ray head in a multi-node Slurm allocation, with configurable Ray execution and optional container setup scripts.
  • Bug Fixes
    • Improved multilingual speech-text comparison by applying consistent cleanup after number expansion, including punctuation and diacritic normalization.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA-NeMo/Skills/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: e837246f-7d2d-4bf3-884c-7f994d5770ad
📥 Commits

Reviewing files that changed from the base of the PR and between bcf059a and 5ea1990.

📒 Files selected for processing: 9
  • docs/evaluation/speech-audio.md
  • docs/pipelines/run-cmd.md
  • nemo_skills/evaluation/evaluator/audio.py
  • nemo_skills/evaluation/evaluator/cer_whitespace.py
  • nemo_skills/pipeline/nemo_rl/ray_templates/nemo_skills_sandbox_ray.sub.j2
  • nemo_skills/pipeline/run_cmd.py
  • tests/test_cer_whitespace.py
  • tests/test_multilingual_number_normalization.py
  • tests/test_run_cmd_ray.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Walkthrough

The changes update multilingual number normalization and add whitespace options to CER evaluation. They also add Ray execution options to run_cmd and update the Slurm Ray template to configure head and worker containers.

Changes: Multilingual audio evaluation

Layer / File(s) Summary
Clean expanded numbers
nemo_skills/evaluation/evaluator/audio.py, tests/test_multilingual_number_normalization.py
The multilingual normalizer now applies cleaning after number expansion. Tests cover number expansion against spoken forms and normalization idempotence across five languages.
Add CER whitespace modes
nemo_skills/evaluation/evaluator/cer_whitespace.py, nemo_skills/evaluation/evaluator/audio.py, tests/test_cer_whitespace.py, docs/evaluation/speech-audio.md
CER evaluation adds keep, all, and han_adjacent whitespace modes. Tests cover the modes and the compound-normalization constraint. Documentation describes the options and their defaults.

Ray command execution on Slurm

Layer / File(s) Summary
Forward Ray options through run_cmd
nemo_skills/pipeline/run_cmd.py, tests/test_run_cmd_ray.py, docs/pipelines/run-cmd.md
run_cmd accepts with_ray and ray_template and forwards both to add_task. Tests and documentation cover the options and command usage.
Configure Slurm Ray containers
nemo_skills/pipeline/nemo_rl/ray_templates/nemo_skills_sandbox_ray.sub.j2, tests/test_run_cmd_ray.py, docs/pipelines/run-cmd.md
The template forwards configured environment variable names to head and worker containers, runs optional setup scripts before Ray startup, and uses the configured Ray executable. Tests check the rendered template and its Bash syntax.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant run_cmd
  participant add_task
  participant SlurmRayTemplate
  participant RayContainers
  Caller->>run_cmd: Pass with_ray and ray_template
  run_cmd->>add_task: Forward Ray options
  add_task->>SlurmRayTemplate: Configure task template
  SlurmRayTemplate->>RayContainers: Launch head and worker containers
  RayContainers->>RayContainers: Run optional setup script before Ray startup
Loading
Merge Risk: ⚪ Minimal · up to 5ea19

No actionable issue is established for the current change. The Ray template’s upstream environment-entry format remains unverified, but there is no demonstrated failure to block merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 6 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes both primary changes: ASR scoring alignment and explicit Ray launches. It is concise and specific.
Full details: Docstring Coverage

Explanation

Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 6 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant