FusedDispatch and FusedCombine use default config
Currently, FusedDispatch and FusedCombine use default config, which limit performance. Is it possible to allow user-defined configurations? For example, by reading a config file to set the chunk size accordingly. fused_a2a.py
Are there specific configurations you want to use? The only one currently supported is --moe-deepep-num-sms which sets the number of SMs.
We welcome contributions from the community! Feel free to create a PR to support this.
Hiii @Phlip79 , I would like to work on this
@DhineshPonnarasan What arguments do you feel are missing? Which impact do you expect they will have? Do you have a proper setup to run experiments and check the performance?
Hiii @asolergi-nv , For now I was mainly thinking of exposing chunk_size (along with the existing num_sms) since those seem to have the most direct impact on how the fused A2A runs. I didn’t want to introduce too many parameters upfront without clearly understanding their effect, but I’m open to adding more if there are specific ones you think would be useful.
In terms of impact, my expectation is that chunk_size would affect how work is partitioned during the all-to-all, which could influence communication/computation overlap depending on the workload (token distribution, number of experts, etc.). Not expecting universal gains more about enabling tuning.
I haven’t run a full set of experiments yet I wanted to first validate that this direction makes sense. Next step from my side would be to run some sweeps (chunk size / num_sms) and compare against the default.
If there’s a preferred setup or specific benchmarks you’d like me to use, I’m happy to follow that. I can put together results and open a PR with that included.
Hi @asolergi-nv , @Phlip79
I have implemented the configuration infrastructure and would like to open a PR. Here's what's included:
FusedA2AConfigdataclass (chunk_size,num_sms) resolved once invalidate_argswith precedence:--moe-a2a-num-smsCLI >MOE_A2A_NUM_SMSenv > JSON/YAML config file > defaults.num_smsis fully functional — wired throughTransformerConfig→MoETokenDispatcher→_DeepepManager, unifying the two previously inconsistent SM-count sources.chunk_sizeis accepted and stored inFusedA2AConfigbut not yet applied at the kernel level — I could not find achunk_sizeparameter inBuffer.dispatch()orBuffer.get_dispatch_layout()in the current DeepEP API. Is this something you'd want me to investigate further or should I open the PR fornum_smsnow and treatchunk_sizeas a reserved parameter pending DeepEP support?.- 27 unit + integration tests covering precedence rules, fail-fast validation, and full data-flow.
Happy to run num_sms sweeps if you can point me to a benchmark script or preferred model config.
What arguments do you feel are missing? Which impact do you expect they will have? Do you have a proper setup to run experiments and check the performance?
@dadadada-147 can you comment on this? Our experience show most of the performance tuning is about setting setting SMs which is already available.
@DhineshPonnarasan In intranode and internode, deep_ep accept a config parameter : deepep config which is defined at config.hpp . At present, DeepEP relies on hard-coded configuration values, but the optimal settings are hardware-dependent and differ for each specific chip:hardcode config
Hi @dadadada-147, thanks for pointing this out!
I have implemented this based on your links. Here's what was done:
- Added
_build_deepep_config()which takes the hardware-tunedBuffer.get_dispatch_config()/Buffer.get_combine_config()baseline and overrides only the fields the user explicitly sets. chunk_sizemaps toConfig.num_max_nvl_chunked_send_tokensand is now fully wired end-to-end:--moe-a2a-chunk-sizeCLI /MOE_A2A_CHUNK_SIZEenv / JSON+YAML config file →FusedA2AConfig.chunk_size→_build_deepep_config()→buffer.dispatch(config=...)/buffer.combine(config=...).- All RDMA and buffer-size params are preserved from the hardware default — only the user-specified fields are overridden.
- 27 tests pass.
If this looks good, I’m ready to open a PR.
Hi @dadadada-147, thanks for pointing this out!
I have implemented this based on your links. Here's what was done:
- Added
_build_deepep_config()which takes the hardware-tunedBuffer.get_dispatch_config()/Buffer.get_combine_config()baseline and overrides only the fields the user explicitly sets.chunk_sizemaps toConfig.num_max_nvl_chunked_send_tokensand is now fully wired end-to-end:--moe-a2a-chunk-sizeCLI /MOE_A2A_CHUNK_SIZEenv / JSON+YAML config file →FusedA2AConfig.chunk_size→_build_deepep_config()→buffer.dispatch(config=...)/buffer.combine(config=...).- All RDMA and buffer-size params are preserved from the hardware default — only the user-specified fields are overridden.
- 27 tests pass.
If this looks good, I’m ready to open a PR.
Looks great! Feel free to submit a PR.
Hi @dadadada-147,
I have opened PR #5230 for this issue.
The implementation adds configurable DeepEP settings for fused A2A dispatch/combine, including support for overriding chunk_size while preserving the existing hardware-tuned defaults when no overrides are provided.
Thanks again for the DeepEP references and guidance.