Repository navigation
[JAX] Fix EP=1 case in TE MoEBlock - #3725
jberchtold-nvidia wants to merge 1 commit into
Conversation
Signed-off-by: Jeremy Berchtold <jberchtold@nvidia.com>
[Medium impact] The change reaches JAX expert-parallel MoE partitioning and its test setup. The fully replicated Findings
SummaryThe PR allows an omitted singleton
Reviews (1) · Last reviewed commit: "Fix EP=1 case in TE MoEBlock" · Reviewed by Greptile |
| if ep_axis not in elts: | ||
| return False, ep_axis, outer_axes | ||
| # JAX canonicalizes size-one mesh axes out of PartitionSpec. | ||
| if get_ep_config().ep_size != 1: | ||
| return False, ep_axis, outer_axes |
There was a problem hiding this comment.
With ep=1, no dp_resource or fsdp_resource, and another mesh axis spanning multiple devices, MoE assigns the batch only to ep. Once JAX removes that singleton axis, _leading_axis_ok still rejects the fully replicated spec: a leading None fails the allowed-axis check, and an empty spec fails the length check. Dispatch then raises NotImplementedError, so this valid EP=1 case still cannot compile.
Allow fully replicated leading dimensions when ep_size == 1 and add a regression test without a retained outer axis.
Description
Please include a brief summary of the changes, relevant motivation and context.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: