Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "macos-14", "windows-2022"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
exclude:
- { os: "windows-2022", python-version: "3.13" }
- { os: "macos-14", python-version: "3.12" }
- { os: "macos-14", python-version: "3.13" }
- { os: "windows-2022", python-version: "3.14" }

# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 60
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,7 @@ def _prepare_extras(requirements_dir: str = _PATH_REQUIRES, skip_files: tuple =
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
],
)
5 changes: 4 additions & 1 deletion src/litdata/streaming/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ def __init__(
self._num_samples_yielded_wrapper: dict[int, list[int]] = {}
self._num_cycles: dict[int, list[int]] = {}
self.rng_state: Optional[Any] = None
self._worker_idx = cycle(list(range(self.num_workers if self.num_workers > 0 else 1)))
self._worker_idx: Optional[Any] = None # Lazily initialized in __iter__
self._worker_idx_iter: Optional[Any] = None
self._latest_worker_idx = 0
self.restore = False
Expand Down Expand Up @@ -767,6 +767,9 @@ def load_state_dict(self, obj: dict[str, Any]) -> None:

# Used to restart on the next DataLoader worker from the previous run.
self._latest_worker_idx = obj["latest_worker_idx"] + 1
# Initialize _worker_idx if not already set (e.g., when loading state before first iteration)
if self._worker_idx is None:
self._worker_idx = cycle(list(range(self.num_workers if self.num_workers > 0 else 1)))
self._worker_idx_iter = iter(self._worker_idx)
for _ in range(self._latest_worker_idx):
next(self._worker_idx_iter)
Expand Down
Loading