Skip to content

Commit

Permalink
Feat: Add multi-ec40-beam
Browse files Browse the repository at this point in the history
  • Loading branch information
speedcell4 committed Sep 24, 2024
1 parent 1bd70ca commit 1a75c89
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions torchglyph/data/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,12 @@ def new(cls, data_sources: Tuple[Dataset, ...],
assert len(data_sources) > 0

loaders = []
for index, (data_source, collate_fn, batch_size, sharding, drop_last, section_size, sortish_key) in enumerate(zip(
data_sources,
unpack(collate_fn),
unpack(batch_size),
unpack(sharding),
unpack(drop_last),
unpack(section_size),
unpack(sortish_key),
)):
for index, (data_source, collate_fn, batch_size, sharding, drop_last, section_size, sortish_key) in enumerate(
zip(data_sources, unpack(collate_fn), unpack(batch_size),
unpack(sharding), unpack(drop_last), unpack(section_size), unpack(sortish_key))):
training = index == 0
if sharding:
data_source = data_source.select(range(get_rank(), len(data_source), get_world_size()))
data_source = data_source.shard(num_shards=get_world_size(), index=get_rank())

sampler = SortishSampler(
data_source=data_source,
Expand Down

0 comments on commit 1a75c89

Please sign in to comment.