[Cherry-Pick][RL] Add clear_graph_opt_backend for glm4_mtp (#7378)#7443
Conversation
|
Thanks for your contribution! |
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 AI Code Review |
2026-04-16 21:15 CST
📋 Review 摘要
PR 概述:为 Glm4MTPForCausalLM 模型添加 clear_grpah_opt_backend 方法,用于清理 CUDA Graph 优化后端,Cherry-Pick 自 #7378。
变更范围:model_executor/models/glm4_mtp.py
影响面 Tag:Models Graph Optimization
📝 PR 规范检查
PR 描述中 Motivation 和 Modifications 部分为空,建议补充。
描述建议(可直接复制):
Motivation: Cherry-Pick from #7378. 为 GLM4 MTP 模型补充
clear_grpah_opt_backend方法,使其支持 CUDA Graph 的清理与重捕获,与其他模型(qwen3、deepseek_v3、glm4_moe 等)保持一致。Modifications: 在
Glm4MTPForCausalLM类中新增clear_grpah_opt_backend方法,调用内部self.model的同名方法完成清理。
问题
未发现阻塞性问题。
总体评价
变更内容简洁、符合项目现有模式。新增的 clear_grpah_opt_backend 方法实现与 qwen3、deepseek_v3、glm4_moe、ernie4_5_moe 等模型完全一致,底层调用的是 decorator.py 中 @support_graph_optimization 装饰器注入的同名方法。代码无误,可正常合入。
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/2.5 #7443 +/- ##
==============================================
Coverage ? 68.97%
==============================================
Files ? 390
Lines ? 54389
Branches ? 8579
==============================================
Hits ? 37513
Misses ? 14182
Partials ? 2694
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:
|
43a657a
into
PaddlePaddle:release/2.5
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.