[Graph Optimization][BugFix][CI] Fix 0size bug && add unitest#5495
Merged
DrRyanHuang merged 5 commits intoPaddlePaddle:developfrom Dec 11, 2025
Merged
Conversation
|
Thanks for your contribution! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5495 +/- ##
==========================================
Coverage ? 60.27%
==========================================
Files ? 329
Lines ? 41116
Branches ? 6261
==========================================
Hits ? 24784
Misses ? 14443
Partials ? 1889
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:
|
SigureMo
previously approved these changes
Dec 10, 2025
EmmonsCurse
approved these changes
Dec 11, 2025
This was referenced Dec 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
#5078 导致所有 SOT+CUDAGraph 模型启动失败:
FastDeploy/fastdeploy/model_executor/layers/embeddings.py
Lines 302 to 303 in 3bdd54e
上面的
.shape[0] == 0会引入一个memcpy_h2d操作,导致 CUDAGraph 无法启动目前可通过
forward_meta.is_zero_size规避Caution
当前PR只是一个临时解决方案,当输入真的是 0 size 的时候,SOT会重新组网,虽然不会打断,但会存在两张整图
由于我们之前做过约束,仅允许存在一张图,FastDeploy 会直接报错退出
由于目前非 EP 场景不存在 0 size输入,而SOT也没有开始适配EP场景,所以目前无需担心
后续需要分布式算子支持0size输入,之后再移除 ForwardMeta 中的 is_zero_size
Modifications
添加单测添加到 base 的 yaml 中了test_EB_Lite_sot_servingtest_EB_VL_Lite_sot_serving启动参数,graph_opt_level = 2SOT => CINNForwardMeta添加is_zero_sizeUsage or Command
Accuracy Tests
NO NEED
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.