[DRAFT][JAX] Optimize MoE block - #3354
Conversation
…mm-custom-partition-rules
Signed-off-by: Jeremy Berchtold <jberchtold@nvidia.com>
Signed-off-by: Jeremy Berchtold <jberchtold@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: Jeremy Berchtold <jberchtold@nvidia.com>
Signed-off-by: Jeremy Berchtold <jberchtold@nvidia.com>
Signed-off-by: Jeremy Berchtold <jberchtold@nvidia.com>
Signed-off-by: Jeremy Berchtold <jberchtold@nvidia.com>
…mm-custom-partition-rules # Conflicts: # qa/L1_jax_distributed_unittest/test.sh
for more information, see https://pre-commit.ci
This reverts commit 1b783b9.
This reverts commit 294a8ec.
This reverts commit 97ba329. This is no longer necessary with "--xla_gpu_experimental_max_unroll_factor=8". The performance of the previous approach is fixed with the previous JAX code and this XLA flag
…oeblock-debug # Conflicts: # tests/jax/test_te_ep_moe.py # transformer_engine/jax/moe.py
Greptile SummaryThe PR substantially optimizes the JAX MoE path by combining FC1 projections, adding distributed grouped-quantize/GEMM partitioning, expanding EP diagnostics and receive-capacity handling, and adding distributed coverage. It also changes the exported Flax MoE parameter layout without checkpoint migration.
Confidence Score: 4/5The Flax MoE checkpoint incompatibility should be addressed before merging so existing parameter and optimizer states remain restorable. The changed module replaces two previously exported parameter leaves with a differently named, differently shaped leaf and provides no migration path, causing old checkpoints to fail when applied. Files Needing Attention: transformer_engine/jax/flax/moe.py Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Input tokens] --> B[Gate and top-k routing]
B --> C[EP prepare and dispatch]
C --> D[Grouped FC1 quantize and GEMM]
D --> E[Activation and grouped FC2 GEMM]
E --> F[EP combine]
F --> G[MoE output]
Reviews (1): Last reviewed commit: "[pre-commit.ci] auto fixes from pre-comm..." | Re-trigger Greptile |
9dd563e to
1c98135
Compare
b8f3816 to
da9ad94
Compare
8d5d1b8 to
0dbf8a5
Compare
072422b to
0645751
Compare
for more information, see https://pre-commit.ci
Description
Improves performance of the MoE block by exposing support for quantization, removal of unnecessary masking overheads, and support for less memory usage via a reduced receive capacity in TE EP
Type of change
Changes
jnp.wheremasking that wasn't required as TE EP and grouped GEMM are group-awareChecklist: