Skip to content

[Optimization] merge_allreduce#7039

Merged
ckl117 merged 3 commits intoPaddlePaddle:developfrom
fxyfxy777:merge_allreduce
Apr 2, 2026
Merged

[Optimization] merge_allreduce#7039
ckl117 merged 3 commits intoPaddlePaddle:developfrom
fxyfxy777:merge_allreduce

Conversation

@fxyfxy777
Copy link
Copy Markdown
Contributor

@fxyfxy777 fxyfxy777 commented Mar 27, 2026

Motivation

💡 If this PR is a Cherry Pick, the PR title needs to follow the format by adding the [Cherry-Pick] label at the very beginning and appending the original PR ID at the end. For example, [Cherry-Pick][CI] Add check trigger and logic(#5191)

💡 如若此PR是Cherry Pick,PR标题需遵循格式,在最开始加上[Cherry-Pick]标签,以及最后面加上原PR ID,例如[Cherry-Pick][CI] Add check trigger and logic(#5191)

Modifications

将普通专家和共享专家在计算ffn后各自的allreduce合并为一个allreduce

Usage or Command

Accuracy Tests

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Mar 27, 2026

Thanks for your contribution!

# In all other modes (EP, EP+attn-TP, no parallelism) each branch handles
# its own reduction internally (reduce_results default=True), so we must
# NOT add an extra all-reduce here.
self._pure_tp = self.use_tp and not self.use_ep
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个变量应该叫 self.merge_ffn_tp 是不是更好点

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

这个变量应该叫 self.merge_ffn_tp 是不是更好点

是的,更容易理解一些

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@91c832f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
fastdeploy/model_executor/models/glm4_moe.py 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #7039   +/-   ##
==========================================
  Coverage           ?   73.73%           
==========================================
  Files              ?      376           
  Lines              ?    52853           
  Branches           ?     8240           
==========================================
  Hits               ?    38969           
  Misses             ?    11177           
  Partials           ?     2707           
Flag Coverage Δ
GPU 73.73% <20.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fxyfxy777 fxyfxy777 changed the title [Draft] merge_allreduce [Optimization] merge_allreduce Apr 1, 2026
ckl117
ckl117 previously approved these changes Apr 1, 2026
@ckl117 ckl117 merged commit 9f3b3ce into PaddlePaddle:develop Apr 2, 2026
68 of 74 checks passed
Copilot AI pushed a commit that referenced this pull request Apr 17, 2026
Co-authored-by: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com>
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.

5 participants