Skip to content

Zhewei smart packing#327

Open
sfc-gh-zhyao wants to merge 3 commits into
mainfrom
zhewei-smart-packing
Open

Zhewei smart packing#327
sfc-gh-zhyao wants to merge 3 commits into
mainfrom
zhewei-smart-packing

Conversation

@sfc-gh-zhyao
Copy link
Copy Markdown
Contributor

No description provided.

@sfc-gh-zhyao
Copy link
Copy Markdown
Contributor Author

Same dataset with 32K max seq length ---
Previously:
Tokenizing messages (num_proc=16): 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6624/6624 [00:04<00:00, 1654.35 examples/s]
Saving the dataset (1/1 shards): 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6624/6624 [00:00<00:00, 66188.46 examples/s]
Filtering dataset by max length (num_proc=16): 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6624/6624 [00:01<00:00, 3423.66 examples/s]
Packing dataset (num_proc=16): 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6624/6624 [00:02<00:00, 3053.66 examples/s]
Saving the dataset (1/1 shards): 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 416/416 [00:00<00:00, 1872.14 examples/s]

After:
Saving the dataset (1/1 shards): 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 402/402 [00:00<00:00, 1792.24 examples/s]

402/416 = 0.966 ==> 3.4% training saving for this one. For 10M samples, the saving will be huge (testing now)

@sfc-gh-zhyao
Copy link
Copy Markdown
Contributor Author

For a 6.2M sample setting ---
Previously:
Saving the dataset (681/1545 shards): 44%|█████████████████████████████████████████████████████████████████▎ | 132114/299574 [09:36<43:34, 64.06 examples/s]

After:
Saving the dataset (1545/1545 shards): 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 283802/283802 [22:18<00:00, 212.00 examples/s]

==> 5.5% gains

@sfc-gh-zhyao
Copy link
Copy Markdown
Contributor Author

Same dataset with 32K max seq length --- Previously: Tokenizing messages (num_proc=16): 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6624/6624 [00:04<00:00, 1654.35 examples/s] Saving the dataset (1/1 shards): 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6624/6624 [00:00<00:00, 66188.46 examples/s] Filtering dataset by max length (num_proc=16): 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6624/6624 [00:01<00:00, 3423.66 examples/s] Packing dataset (num_proc=16): 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6624/6624 [00:02<00:00, 3053.66 examples/s] Saving the dataset (1/1 shards): 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 416/416 [00:00<00:00, 1872.14 examples/s]

After: Saving the dataset (1/1 shards): 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 402/402 [00:00<00:00, 1792.24 examples/s]

402/416 = 0.966 ==> 3.4% training saving for this one. For 10M samples, the saving will be huge (testing now)

@sfc-gh-zhyao
Copy link
Copy Markdown
Contributor Author

The testing for very large # samples is very costly. However, I see no issue to increase the batch_size = int(min(batch_size, 1e3)) to batch_size = int(min(batch_size, 1e4)) as 10K sample should be small enough which can further increase the efficiency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant