[Cherry-Pick][BugFix] Fix import compatibility for paddlefleet.ops and paddlefleet_ops(#7873)#7874
Conversation
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 Paddle-CI-Agent | pr_review |
2026-05-21 12:01:33
📋 Review 摘要
PR 概述:Cherry-Pick 修复因 paddlefleet 包名变更导致的 EP / FP8 加载失败 Bug,兼容新旧两种包路径。
变更范围:fastdeploy/model_executor/layers/moe/ep.py、fastdeploy/model_executor/layers/quantization/fp8_utils.py
影响面 Tag:[OP] [Quantization]
问题
| 级别 | 文件 | 概述 |
|---|---|---|
| 🟡 建议 | ep.py |
裸 except: 会吞掉 SystemExit/KeyboardInterrupt,建议改为 except ImportError: |
| 🟡 建议 | fp8_utils.py |
同上,load_deep_gemm 中裸 except: 建议改为 except ImportError: |
| 📝 PR 规范 | — | 标题缺少官方 Tag;描述体必填段落均为空 |
ep.py(
load_deep_ep内层 try/except,新增行约第 48 行)与 fp8_utils.py(load_deep_gemm内层 try/except,新增行约第 50 行)存在裸except:捕获问题;根据 checklist §C"异常处理吞掉异常"表层信号项触发。
📝 PR 规范检查
存在两处问题:① 标题格式缺少官方 Tag(Cherry-Pick 格式要求 [Cherry-Pick][Tag]);② PR 描述中 Motivation / Modifications / Usage or Command / Accuracy Tests 四个必填段落均为空或仅占位符。
标题建议(可直接复制):
[Cherry-Pick][BugFix] Fix ce bug because of paddlefleet_ops(#7873)
PR 描述建议(可直接复制):
## Motivation
兼容 paddlefleet 包路径的两种形式(`paddlefleet.ops.deep_ep` / `paddlefleet_ops.deep_ep` 和 `paddlefleet.ops.deep_gemm` / `paddlefleet_ops.deep_gemm`),修复因 PaddleFleet 包名变更导致的 EP 和 DeepGEMM 加载失败问题。
## Modifications
- `fastdeploy/model_executor/layers/moe/ep.py`:删除模块级别无效的 `try_import(["paddlefleet.ops"])`;`load_deep_ep` 中优先尝试 `import paddlefleet.ops.deep_ep`,失败则回退到 `import paddlefleet_ops.deep_ep`。
- `fastdeploy/model_executor/layers/quantization/fp8_utils.py`:`try_import` 参数增加 `"paddlefleet_ops"` 备选包;`load_deep_gemm` 中优先尝试 `import paddlefleet.ops.deep_gemm`,失败则回退到 `import paddlefleet_ops.deep_gemm`。
## Usage or Command
N/A
## Accuracy Tests
N/A
## Checklist
- [x] 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.
- [x] 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.
- [x] 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.总体评价
兼容性修复思路正确,try_import 双包名传参和内层 try/except 回退均能实现新旧路径兼容。建议将两处裸 except: 收窄为 except ImportError:,并补全 PR 描述中的必填段落。
CI报告基于以下代码生成(30分钟更新一次): 1 任务总览极简 PR,本次仅修改
2 任务状态汇总日志列说明:失败任务直接使用 CI 工具生成的日志链接;运行中任务使用 Job 链接。 2.1 Required任务 : 9/10 通过
2.2 可选任务 — 22/26 通过
3 失败详情(仅 required)无 required 失败任务。按策略,本次未对 optional 失败任务做深度分析。 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/2.6 #7874 +/- ##
==============================================
Coverage ? 72.34%
==============================================
Files ? 381
Lines ? 54225
Branches ? 8473
==============================================
Hits ? 39227
Misses ? 12233
Partials ? 2765
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:
|
Motivation
Modifications
Usage or Command
Accuracy Tests
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.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.