Skip to content

hack fake_gate#444

Draft
huangjiyi wants to merge 1 commit intoPaddlePaddle:developfrom
huangjiyi:hack_gate
Draft

hack fake_gate#444
huangjiyi wants to merge 1 commit intoPaddlePaddle:developfrom
huangjiyi:hack_gate

Conversation

@huangjiyi
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings January 21, 2026 12:32
@huangjiyi huangjiyi marked this pull request as draft January 21, 2026 12:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to add a forced load balancing mode for the MoE router by introducing a fake_balanced_routing method that provides deterministic routing distribution. However, the implementation has critical bugs that will break the code.

Changes:

  • Added fake_balanced_routing method to provide deterministic balanced expert routing
  • Commented out router weight initialization and related parameters
  • Modified gradient computation in fused all-to-all backward pass
  • Added conditional dispatch logic and commented out auxiliary loss computation

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.

File Description
src/paddlefleet/transformer/moe/moe_router.py Added fake_balanced_routing method and commented out weight initialization, breaking normal routing mode
src/paddlefleet/transformer/moe/moe_layer.py Added dispatch_overlap method and modified fusion_moe_forward to support new routing path; commented out aux loss
src/paddlefleet/transformer/moe/fused_a2a.py Changed gradient return to None for token probabilities, breaking backpropagation

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants