Skip to content

Commit

Permalink
Update on "enable data loading for data parallel training"
Browse files Browse the repository at this point in the history
Tested that data loading now have the expected behavior:
- different dp ranks get different data
- different tp ranks within the same dp rank get the same data 


[ghstack-poisoned]
  • Loading branch information
tianyu-l committed Feb 8, 2024
1 parent b920b23 commit f8a6e76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torchtrain/datasets/alpaca.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def __iter__(self):

for idx, sample in enumerate(self.data_iterator):
# select samples to pack in a round-robin fashion
# TODO: This is a temporary solution for small datasets like Alpaca.
# For larger datasets we need to use a more scalable approach.
if idx % self.world_size != self.rank:
continue
sample_text = sample["text"]
Expand Down

0 comments on commit f8a6e76

Please sign in to comment.