Skip to content

Commit 6d751e5

Browse files
committed
Expose doc breakpoint in cfg
Signed-off-by: Davis Wertheimer <[email protected]>
1 parent c9f2bdb commit 6d751e5

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

fms_fsdp/config/training.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class train_config:
2929
logical_shards: int = 1024
3030
num_workers: int = 1
3131
doc_cutoff: int = 1_000_000
32+
doc_breakpoint: int = 65_536
3233

3334
# fsdp policies
3435
sharding_strategy: str = "hsdp"

fms_fsdp/utils/dataloader_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import torch
2+
from math import ceil
23

34
from fms_fsdp.utils.dataset_utils import (
45
ArrowHandler,
@@ -104,6 +105,7 @@ def get_data_loader(cfg, rank, world_size):
104105
bos_token=cfg.bos_token,
105106
strip_tokens=set(droplist),
106107
min_length=3,
108+
max_consecutive_chunks=ceil(cfg.doc_breakpoint/1024),
107109
seed=cfg.seed,
108110
)
109111
# Add rescaling/resharding

0 commit comments

Comments
 (0)