Skip to content
Closed
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
1 change: 1 addition & 0 deletions torchtitan/experiments/path/config_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ def _vit_dataloader_config(*, split: str) -> PathDataLoader.Config:
_dataloader_config(split=split, fps=SUPERCOMBO_FPS, plan_only=True),
dataset=os.path.join(XX_BASEDIR, dataset),
pipeline_dir=BASE_DIR_GT_10M,
deterministic_fidxs=True,
)


Expand Down
15 changes: 13 additions & 2 deletions torchtitan/experiments/path/dataset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

from __future__ import annotations

import os
Expand Down Expand Up @@ -26,6 +32,7 @@ class Config(BaseDataLoader.Config):
n_frames: int
rgb: bool
unvision: bool
deterministic_fidxs: bool = False

def __init__(
self,
Expand All @@ -41,11 +48,12 @@ def __init__(
**kwargs: Any,
) -> None:
del tokenizer, seq_len, snapshot_every_n_steps, kwargs
from gigashuffle import DataloaderConfig
from xx.training.lib.dataloader import DataLoader
from xx.training.path.config import DatasetConfig as XXPathDatasetConfig
from xx.training.path.dataloader import get_dataset

from gigashuffle import DataloaderConfig

self.config = config
self.local_batch_size = local_batch_size
self.dp_world_size = dp_world_size
Expand All @@ -72,6 +80,7 @@ def __init__(
n_frames=config.n_frames,
rgb=config.rgb,
unvision=config.unvision,
deterministic_fidxs=config.deterministic_fidxs,
)
dataset = get_dataset(config.dataset, xx_config, val, self.local_rank)
self.dataset = dataset
Expand All @@ -91,7 +100,9 @@ def __init__(
self.loader = DataLoader(dataset, loader_config)
self._iterator: Any | None = None

def __iter__(self) -> Iterator[tuple[dict[str, torch.Tensor], dict[str, torch.Tensor]]]:
def __iter__(
self,
) -> Iterator[tuple[dict[str, torch.Tensor], dict[str, torch.Tensor]]]:
iterator = iter(self.loader)
self._iterator = iterator
try:
Expand Down