Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

streaming multipack for pretraining dataset #959

Merged
Prev Previous commit
Next Next commit
fix the collator to be the max length for multipack pretraining
  • Loading branch information
winglian committed Jan 5, 2024
commit 7c3be2ef5ea918106b64e0b762bc161859c327d4
5 changes: 4 additions & 1 deletion src/axolotl/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,10 @@ def encode_pretraining(
def load_pretraining_dataset(path, tokenizer, cfg, name=None, max_tokens=2048, seed=42):
if cfg.sample_packing:
collate_fn = PretrainingBatchSamplerDataCollatorForSeq2Seq(
tokenizer, return_tensors="pt", padding=True, pad_to_multiple_of=max_tokens
tokenizer,
return_tensors="pt",
padding=True,
pad_to_multiple_of=max_tokens * cfg.micro_batch_size,
)
encode = functools.partial(
encode_packed_pretraining,
Expand Down
Loading