Repository navigation
fix(python): commit streaming worker checkpoints on consumption - #4023
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
Addressed in 921e71e. The revision enforces scheduling-safe multi-worker checkpoints, rejects persistent worker reuse, fails checkpointing closed after unreturned batches, preserves complete-cycle skip behavior, and scopes transport authorization to the checkpoint-aware iterator. |
|
Addressed in abe6916. The revision makes scheduling-boundary checks rank-local, turns collate-originated StopIteration into an invalidating batch failure, and preserves subclass iteration through an identity-scoped transport context. |
|
Addressed in 6cd8ba7. The revision removes ambient transport authorization, rejects custom iteration that cannot produce exact snapshots, and invalidates checkpointing for every non-exhaustion BaseException. |
|
Addressed in 282a8a4. The consumer iterator now invalidates checkpointing when validation, parent commit, or the final return path fails after a fetched batch, with a regression covering interruption after commit. |
# Conflicts: # python/python/lancedb/streaming.py
|
Docs PR opened: https://github.com/lancedb/docs/pull/336 Documented the new StreamingDataLoader for safe multi-worker checkpointing and merge_state_dicts for resuming training across changed world sizes. |
Summary
StreamingDataLoader, which transports worker snapshots with prefetched batches and commits them to the parent dataset only when the trainer receives each batchDataLoaderhas started, with guidance to use the consumer-aware loaderRoot cause
PyTorch runs
StreamingDataset.__iter__in private worker-process copies, while callers invokestate_dict()on the parent dataset. Sharing producer counters would still be incorrect because DataLoader prefetch can advance workers beyond batches returned to the trainer.Validation
uv run --extra tests pytest python/tests/test_elastic_dataloader.py -q(154 passed)uv run --project python --extra tests --extra dev ruff format .uv run --project python --extra tests --extra dev ruff check .cd docs && PYTHONPATH=. ../python/.venv/bin/mkdocs buildFixes #3967