Training speed ups: +10-15% tokens/second/gpu#29
Merged
achalddave merged 8 commits intomainfrom Oct 12, 2023
Merged
Conversation
sagadre
reviewed
Oct 10, 2023
sagadre
reviewed
Oct 10, 2023
Collaborator
|
maybe attach a training curve / eval perplexity for some small scale experiments (e.g., 87m params, 1.7B tokens), just to make sure there is no degradation in performance? |
achalddave
commented
Oct 12, 2023
Collaborator
Author
|
Some results on the 160m param scale (this is with the earlier initialization from mosaic and bias in the mlps). At least low precision layer norm and fused cross-entropy have basically no effect on train loss / val ppl, while giving us a good speedup. Unclear if gelu and float16 reduce are affecting convergence, we will test at 1b next. |
This was referenced Oct 13, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR provides 3 changes to improve the tokens/second/gpu for open_lm. Each change is guarded by a flag that is off by default, since these changes likely affect model convergence and downstream accuracy. We can enable them once we train large enough models with these changes.
Below, I'm quoting rough improvements in tokens/second/gpu for a 7b model, batch size 16, 2048 token length on a machine with 8 80gb A100s.
These tests were done with
xformers==0.0.19andtorch==2.0.0+cu117. Further upgrading toxformers==0.0.22(+200t/s/g) andtorch==2.0.1+cu118(+100t/s/g) gets us to about 4000 tokens/second/gpu on one node.Next steps: Multi-node. With the above changes, our 2 node performance is at ~3700 t/s/g, but this goes up to ~3840 t/s/g when we double the batch size to 32. Can we close the gap to 4k? Might be hard since we don't have the same EFA as mosaic reports here: https://github.com/mosaicml/llm-foundry/tree/main/scripts/train/benchmarking#a100-80gb-with-1600-gbps-node-node-interconnect-roce
Closes #22 #27