Skip to content

fix(ci): synchronous data loading for hanging t5 functional tests - #5241

Closed
Connor-XY wants to merge 1 commit into
NVIDIA:mainfrom
Connor-XY:yxu1/t5-dataloader-num-workers0
Closed

fix(ci): synchronous data loading for hanging t5 functional tests#5241
Connor-XY wants to merge 1 commit into
NVIDIA:mainfrom
Connor-XY:yxu1/t5-dataloader-num-workers0

Conversation

@Connor-XY

@Connor-XY Connor-XY commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

What

Set --num-workers: 0 (synchronous, in-process data loading) for the t5 functional tests that intermittently hang in CI:

  • t5_mcore_tp1_pp1_vp1
  • t5_mcore_tp1_pp1_vp1_resume_torch
  • t5_mcore_te_tp1_pp1_vp1_resume_torch

Why

These hang in CI with a finalize_model_grads all-reduce timeout — but the fault-handler dump shows the stuck rank's main thread parked in the input pipeline, not a collective:

pretrain_t5.py:148 get_batch -> rerun_state_machine.py __next__
 -> torch/utils/data/dataloader.py _try_get_data -> multiprocessing/queues.py:113 get  (blocked)

A dataloader worker stops delivering batches → that rank never enters the step's grad all-reduce → the ranks that did get data time out (600 s NCCL watchdog). Loss is healthy up to the hang (no NaN), so it's the data pipeline, not the model/comms.

build_pretraining_data_loader uses num_workers=2 + pin_memory=True + persistent_workers=True and sets no DataLoader(timeout=), so a stalled worker blocks forever. The same recipe runs clean on fast local storage → the trigger is the CI data mount / worker subprocess pipeline. --num-workers 0 removes that surface (no worker subprocesses, no pin-memory queue); test data is tiny so perf impact is nil.

Validation

Candidate fix — needs a CI run (Run functional tests); the stall doesn't reproduce on fast local storage. If it still hangs with num_workers=0 (now in the inline read), the trigger is raw mount I/O and the follow-up is a DataLoader(timeout=) in build_pretraining_data_loader + local data staging.

🤖 Generated with Claude Code

…5 functional tests

t5_mcore_tp1_pp1_vp1 (+ the two *_resume_torch variants) intermittently hang in
CI. The fault-handler dump shows the stuck rank's main thread parked in the input
pipeline, not a collective:

  pretrain_t5.py:148 get_batch -> rerun_state_machine.py __next__
   -> torch/utils/data/dataloader.py _try_get_data -> multiprocessing/queues.py:113 get  (blocked)

A dataloader worker fails to deliver the next batch, so that rank never enters the
step's gradient all-reduce; the ranks that did get their data then time out in
finalize_model_grads (600s NCCL watchdog) and the run aborts -- surfacing as a
misleading "collective timeout". Training is numerically healthy up to the hang
(no NaN). build_pretraining_data_loader uses num_workers=2 + pin_memory +
persistent_workers and sets no DataLoader timeout, so a stalled worker blocks
forever. The same recipe runs clean on fast local storage, so the trigger is the
CI data mount / worker pipeline, not the model.

--num-workers 0 loads batches in-process (no worker subprocesses, no pin-memory
queue, worker_init_fn skipped), removing the queue.get hang surface. Test data is
tiny so the perf impact is negligible.

Note: candidate fix to validate in CI (the stall does not reproduce on fast local
storage). If it still hangs with num_workers=0, the trigger is raw I/O on the data
mount and the follow-up is a DataLoader timeout + local data staging.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@copy-pr-bot

copy-pr-bot Bot commented Jun 9, 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.

@Connor-XY
Connor-XY marked this pull request as ready for review June 9, 2026 22:30
@Connor-XY

Copy link
Copy Markdown
Contributor Author

/ok to test 4d26abc

@Connor-XY

Copy link
Copy Markdown
Contributor Author

Superseded by #5253.

@Connor-XY Connor-XY closed this Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants