Skip to content

fix(rnnt): prevent deadlock in multi-GPU validation when validation batch is split - #16315

Open
mayuriphad wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
mayuriphad:fix-rnnt-validation-deadlock
Open

mayuriphad wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
mayuriphad:fix-rnnt-validation-deadlock

Conversation

@mayuriphad

Copy link
Copy Markdown

Fixes #16003

What & Why
When \ use_loss_wer=True\ and \�alidation_ds.batch_size > joint.fused_batch_size, \RNNTJoint.forward\ splits the validation batch into micro-batches and accumulates WER using \self.wer.update()\ and \self.wer.compute().

Previously, the _to_sync\ flag was only overridden to \False\ during training (\if self.training:). During validation, this meant \self.wer.compute()\ attempted to synchronize across GPUs for every sub-batch. Since different ranks can receive different global batch portions and split them into a different number of sub-batches, the synchronization counts would mismatch and cause NCCL watchdogs to hang in a deadlock.

How it was fixed
This patch unconditionally un-sets the _to_sync\ flag before \update()\ and \compute()\ inside the \ orward()\ sub-batch loop (not just during training), and restores it after. The sub-batch loop calculates local \wer_num\ and \wer_denom\ and simply returns them to the caller. The global sync across ranks will then be safely deferred to the outer Lightning validation epoch end loop where batch splits don't affect sync counts.

…validation steps to prevent deadlocks

Signed-off-by: mayuriphad <mayuriphad656@gmail.com>
Copilot AI lite review requested due to automatic review settings September 28, 2026 18:38
@copy-pr-bot

copy-pr-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the ASR label Sep 28, 2026
@mayuriphad
mayuriphad force-pushed the fix-rnnt-validation-deadlock branch from 965da02 to e8ce9e8 Compare September 28, 2026 19:01
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Sep 30, 2026

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

ASR community-request waiting-on-maintainers Waiting on maintainers to respond

3 participants