-
Notifications
You must be signed in to change notification settings - Fork 693
[Intel HPU] fix memory fragmentation issue and fix moe all_reduce issue #5357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 addresses memory fragmentation and MoE (Mixture of Experts) all_reduce issues for Intel HPU by modifying warmup sequence ordering and consolidating MoE all_reduce logic.
Key Changes:
- Reversed warmup sequence iteration order (batch sizes and sequence lengths) to improve memory allocation patterns
- Moved HPU-specific MoE all_reduce logic from backend-specific files to common MoE layer for better maintainability
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
fastdeploy/worker/hpu_model_runner.py |
Reversed iteration order for prefill batches, prefill lengths, decode batches, and decode block numbers during warmup to reduce memory fragmentation |
fastdeploy/model_executor/layers/moe/moe.py |
Added platform-specific all_reduce handling for Intel HPU by importing tensor_model_parallel_all_reduce_custom and conditionally using it in the forward method |
fastdeploy/model_executor/layers/backends/intel_hpu/moe/fused_moe_hpu_backend.py |
Removed duplicate all_reduce calls and unused import, moving the logic to the common MoE layer |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5357 +/- ##
==========================================
Coverage ? 59.44%
==========================================
Files ? 325
Lines ? 40261
Branches ? 6093
==========================================
Hits ? 23934
Misses ? 14428
Partials ? 1899
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…fix moe all_reduce issue
5bc4f12 to
e707784
Compare
zoooo0820
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…fix moe all_reduce issue (PaddlePaddle#5357)
Motivation
Fix memory fragmentation issue and moe all_reduce issue
Modifications
update warmup sequence and moe all_reduce for HPU according to PR #5247
Usage or Command
no command usage change
Accuracy Tests
ERNIE-4.5-21B-A3B-Paddle
100%|██████████| 1319/1319 [09:16<00:00, 2.37it/s]
Accuracy: 0.917
Invalid: 0.001
Latency: 556.834 s
Checklist
[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]]pre-commitbefore commit.conducted by local tests
releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.