Repository navigation
Add use_te_comm_gemm_overlap: integrates TransformerEngine collective GEMMs for tensor sequence parallelism - #4307
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
gobbleturk
left a comment
There was a problem hiding this comment.
Can we include a test with the collective matmul enabled? In train_tests.py I think
49ef8cb to
393dee4
Compare
| def test_gpu_te_fp8_delayedscaling(self): | ||
| train_main(TrainTests.CONFIGS["te_fp8_delayedscaling"] + ["attention=dot_product"]) | ||
|
|
||
| @pytest.mark.skip(reason="No runner with GPU arch >= 89 is available") |
There was a problem hiding this comment.
this test is getting skipped for two different reasons lol, unfortunately this feature is not protected by our CI
eab9d7e
into
AI-Hypercomputer:main
Description
This PR integrates the necessary changes for enabling TransformerEngine's collective GEMM API for MLP layers as well as adding a configurable flag (
use_te_comm_gemm_overlap, defaults to false) to enable it.Collective GEMMs are useful because they allow for fine-grained overlap of communication and computation of distributed GEMM computations, reducing the distributed GEMM latency and improving overall E2E step time when working with tensor sequence parallelism.
Enabling the flag requires the usage of tensor sequence parallelism, running on single-rank-per-GPU, and enabling a Transformer Engine quantization recipe.
It works by telling TransformerEngine which type of collective will be performed for specific parts of the MLP. Up-projections require all-gathers, and down projections require reduce-scatters under tensor sequence parallelism. Overall benefit is reduced exposed communication time for large distributed GEMMs.
The change is primarily in
quantizations.pyin which we also determine the type of collective the dense layer is performing if it is in the MLP.Tests
Validated that enabling the collective GEMMs introduces them via profiling and looking at HLOs. Loss curves stay close when disabling/enabling collective GEMMs.
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.