-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize the
Trompt
example to reduce training time by ~30% (#477)
## Summary Reduces training time by 29% by: * removing unnecessary stream and D2H synchronisations * replacing `einsum` with `matmul` * making data copied async wrt host * using TF32 for matmuls ## Benchmark results Benchmarked the change using `jannis` dataset on `g6.4xlarge` that has a L4 GPU. To reproduce, run: ```console $ python examples/trompt.py --dataset jannis $ python examples/trompt.py --dataset jannis --compile ``` Average time per training step: | | master (`A`) | **this PR** (`B`) | `B/A` | |:-:|:-:|:-:|:-:| |eager|742.79 ms|**741.22** ms|0.99x| |compile|262.24 ms|**186.80** ms|0.71x| Average time per evaluation step: | | master (`A`) | **this PR** (`B`) | `B/A` | |:-:|:-:|:-:|:-:| |eager|303.76 ms|**302.73** ms|1.00x| |compile|58.75 ms|**56.27** ms|0.96x| --- Happy holidays! 🎄🧹
- Loading branch information
1 parent
17b5507
commit da158fb
Showing
2 changed files
with
56 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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