[`distributed`] Support HSDP with expert parallelism (#50293)
Support HSDP with expert parallelism
With dp_replicate_size > 1, shard the token-dispatch experts on the 2-D
(dp_replicate, efsdp) mesh, like the dense modules on (dp_replicate, fsdp), so their
gradients are also all-reduced across replicas, and divide them by dp_size: the
replicas add dp_replicate_size times more batches. This is what torchtitan does.
Remove the check that refused dp_replicate_size > 1 with ep_size > 1.