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

Add openwebtext dataset for larger scale training without shuffling #130

Merged
merged 3 commits into from
Mar 12, 2024
Merged
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 torchtrain/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
"alpaca": build_hf_data_loader,
"minipile": build_hf_data_loader,
"c4": build_hf_data_loader,
"openwebtext": build_hf_data_loader,
}
15 changes: 13 additions & 2 deletions torchtrain/datasets/hf_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"alpaca": "tatsu-lab/alpaca",
"minipile": "JeanKaddour/minipile",
"c4": "allenai/c4",
"openwebtext": "Skylion007/openwebtext",
}


Expand All @@ -32,9 +33,10 @@ class HuggingFaceDataset(IterableDataset):
rank (int): rank of the current data parallel process
infinite (bool): whether to loop infinitely over the dataset

We currently support three datasets:
We currently support four datasets:
alpaca (52K training entries)
minipile (1M training entries)
minipile (1M training entries, amalgamated from other datasets)
openwebtext (1M training entries, same type of data for entire dataset)
c4 (177M training entries - this dataset is streamed due to the size)

>> Alpaca <<:
Expand Down Expand Up @@ -65,6 +67,15 @@ class HuggingFaceDataset(IterableDataset):
'timestamp': '2019-04-25T12:57:54Z'
}

>> OpenWebText <<:
OpenWeb crawl, English
Example:
{
'text': "Amazon has launched a new cheaper version of its Echo Dot voice-controlled device today.
The launch comes six months after Amazon first introduced two new Echo devices —
one of which was the $90 Echo Dot,..."
}

Example use (alpaca):
>>> alpaca_ds = HuggingFaceDataset(dataset_name="alpaca", dataset_path=None, tokenizer=tokenizer)
>>> for batch in Dataloader(alpaca_ds, batch_size=8):
Expand Down
2 changes: 1 addition & 1 deletion train_configs/llama_13b.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ compile = false
checkpoint_interval = 3600
checkpoint_interval_type = "steps"
checkpoint_folder = ""
dataset = "minipile"
dataset = "openwebtext"
2 changes: 1 addition & 1 deletion train_configs/llama_70b.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ compile = false
checkpoint_interval = 3600
checkpoint_interval_type = "steps"
checkpoint_folder = ""
dataset = "minipile"
dataset = "openwebtext"
Loading