Skip to content

[Cherry-Pick][RL] Add clear_graph_opt_backend for glm4_mtp (#7378)#7443

Merged
Jiang-Jia-Jun merged 1 commit intoPaddlePaddle:release/2.5from
Deleter-D:2.5_glm_mtp_clear_graph
Apr 17, 2026
Merged

[Cherry-Pick][RL] Add clear_graph_opt_backend for glm4_mtp (#7378)#7443
Jiang-Jia-Jun merged 1 commit intoPaddlePaddle:release/2.5from
Deleter-D:2.5_glm_mtp_clear_graph

Conversation

@Deleter-D
Copy link
Copy Markdown
Collaborator

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

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 Apr 16, 2026

Thanks for your contribution!

Copy link
Copy Markdown

@PaddlePaddle-bot PaddlePaddle-bot left a comment

Choose a reason for hiding this comment

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

🤖 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
影响面 TagModels Graph Optimization

📝 PR 规范检查

PR 描述中 MotivationModifications 部分为空,建议补充。

描述建议(可直接复制):

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 方法实现与 qwen3deepseek_v3glm4_moeernie4_5_moe 等模型完全一致,底层调用的是 decorator.py@support_graph_optimization 装饰器注入的同名方法。代码无误,可正常合入。

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release/2.5@12e4fff). Learn more about missing BASE report.

Files with missing lines Patch % Lines
fastdeploy/model_executor/models/glm4_mtp.py 50.00% 1 Missing ⚠️
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           
Flag Coverage Δ
GPU 68.97% <50.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.

@Jiang-Jia-Jun Jiang-Jia-Jun merged commit 43a657a into PaddlePaddle:release/2.5 Apr 17, 2026
32 of 37 checks passed
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.

4 participants