Skip to content

Conversation

@SlightwindSec
Copy link
Contributor

What this PR does / why we need it?

This PR improves Prefill performance by making two key optimizations:

Optimizing alltoall communication: The previous implementation involved one all_to_all_single call followed by three all_to_all calls. This has been refactored to use three all_to_all_single calls instead, with a fixed communication buffer to eliminate an extra communication step. This change not only simplifies the communication pattern but also leverages the better performance of all_to_all_single.

While there might be minor precision trade-offs, the choice of the coefficient 2 is an empirically sound value that maintains accuracy even when expert ID distribution is imbalanced.

In testing with DeepSeek-V3, the model was able to handle 3584-token inputs with significantly improved Prefill throughput and no regression in dialog quality.

Does this PR introduce any user-facing change?

No, this PR does not introduce any user-facing changes.

How was this patch tested?

  • Verified correct generation behavior with DeepSeek-V3 model.
  • Prefill performance was benchmarked with 3584-token inputs, showing noticeable speed improvements.
  • Ensured that output quality remains consistent under typical workloads.

Signed-off-by: SlightwindSec <slightwindsec@gmail.com>
Signed-off-by: SlightwindSec <slightwindsec@gmail.com>
@github-actions
Copy link

github-actions bot commented Jun 5, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@SlightwindSec SlightwindSec deleted the all2all branch October 13, 2025 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant