You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(python): StreamingDataset state_dict is stale with multi-process DataLoader workers #3967
When StreamingDataset uses a PyTorch DataLoader with num_workers > 0, iteration advances private dataset copies in worker processes. Calling state_dict() on the parent dataset therefore returns stale resume state.
Checkpoint configuration/provenance validation is now separated into #4018. This issue remains the worker-progress/consumer-commit problem: parent-visible state must not advance merely because workers prefetched rows the trainer has not consumed.
This looks like the same defect as #3751 ("StreamingDataset checkpointing doesn't work when num_workers > 0"), filed on July 31 — same root cause, described from the other end. #3751 states it concisely ("the samples consumed counters are process-local"), and this one contributes the reproduction and the concrete observed values, so they complement each other rather than conflict.
Worth linking them so the discussion does not fork: there is already root-cause analysis and a proposed approach in the comments on #3751.
One detail that may help whoever picks it up: the resume state read by state_dict() lives in plain instance attributes (_resume_offset, _resume_positions), but streaming.py already carries _worker_stats = RawArray(ctypes.c_int64, 8) for exactly this problem, with a comment noting it is picklable across the process boundary. The mechanism for crossing back to the parent is already in the file — it just is not what the checkpoint path reads from.
Activity
sarwarbhuiyan commentedon Aug 21, 2026
Checkpoint configuration/provenance validation is now separated into #4018. This issue remains the worker-progress/consumer-commit problem: parent-visible state must not advance merely because workers prefetched rows the trainer has not consumed.
brunosrz commentedon Aug 22, 2026
This looks like the same defect as #3751 ("StreamingDataset checkpointing doesn't work when num_workers > 0"), filed on July 31 — same root cause, described from the other end. #3751 states it concisely ("the samples consumed counters are process-local"), and this one contributes the reproduction and the concrete observed values, so they complement each other rather than conflict.
Worth linking them so the discussion does not fork: there is already root-cause analysis and a proposed approach in the comments on #3751.
One detail that may help whoever picks it up: the resume state read by
state_dict()lives in plain instance attributes (_resume_offset,_resume_positions), butstreaming.pyalready carries_worker_stats = RawArray(ctypes.c_int64, 8)for exactly this problem, with a comment noting it is picklable across the process boundary. The mechanism for crossing back to the parent is already in the file — it just is not what the checkpoint path reads from.Not claiming this, just flagging the duplicate.
fix(python): commit streaming worker checkpoints on consumption (lanc…