[Graph Optimization] remove static_op_get_block_shape_and_split_kv_block from cudagraph - #6081
Merged
Jiang-Jia-Jun merged 6 commits intoJan 20, 2026
Conversation
|
Thanks for your contribution! |
SigureMo
previously approved these changes
Jan 18, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6081 +/- ##
==========================================
Coverage ? 67.42%
==========================================
Files ? 350
Lines ? 45323
Branches ? 6968
==========================================
Hits ? 30561
Misses ? 12527
Partials ? 2235
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
Jan 18, 2026
Collaborator
Author
Traceback (most recent call last):
File "/workspace/FastDeploy/tests/distributed/chunked_moe.py", line 185, in test_case
self.run_model_runner()
File "/workspace/FastDeploy/tests/distributed/chunked_moe.py", line 156, in run_model_runner
self.model_runner.initialize_forward_meta()
File "/workspace/FastDeploy/fastdeploy/worker/gpu_model_runner.py", line 1593, in initialize_forward_meta
if self.graph_opt_config.graph_opt_level > 0 and not self.graph_opt_config.full_cuda_graph:
AttributeError: 'GPUModelRunner' object has no attribute 'graph_opt_config' |
SigureMo
reviewed
Jan 18, 2026
DrRyanHuang
force-pushed
the
sot/cudagraph/rm_static_op_get_block_shape_and_split_kv_block
branch
from
January 18, 2026 17:18
775492d to
fbc5f31
Compare
DrRyanHuang
commented
Jan 19, 2026
| raise NotImplementedError("Only supported attr of quant_max_bound in ['127', '448'].") | ||
| else: | ||
| res = paddle.empty([token_nums, q_num_heads * head_dims], dtype=D_type) | ||
| res = paddle.zeros([token_nums, q_num_heads * head_dims], dtype=D_type) |
Collaborator
Author
There was a problem hiding this comment.
Jiang-Jia-Jun
approved these changes
Jan 20, 2026
DrRyanHuang
deleted the
sot/cudagraph/rm_static_op_get_block_shape_and_split_kv_block
branch
January 20, 2026 06:05
5 tasks
chang-wenbin
pushed a commit
to chang-wenbin/FastDeploy
that referenced
this pull request
Mar 2, 2026
…ock from cudagraph (PaddlePaddle#6081) * rm static_op_get_block_shape_and_split_kv_block from cudagraph * update max_capture_shape * fallback: zeros -> empty to avoid coverage check * check graph_opt_config exists * add max_capture_shape_dy2st && full_cuda_graph: false -> true in 28B vl test * add use_cudagraph flag to control step_use_cudagraph
xiaoguoguo626807
pushed a commit
to xiaoguoguo626807/FastDeploy
that referenced
this pull request
May 7, 2026
…ock from cudagraph (PaddlePaddle#6081) * rm static_op_get_block_shape_and_split_kv_block from cudagraph * update max_capture_shape * fallback: zeros -> empty to avoid coverage check * check graph_opt_config exists * add max_capture_shape_dy2st && full_cuda_graph: false -> true in 28B vl test * add use_cudagraph flag to control step_use_cudagraph
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
由于
step_use_cudagraph的控制,动态图+CUDAGraph 只在 Decode 的时候开启 CUDAGraph(代码如下),而 SOT 动转静也是一样的,纯 Prefill + Prefill+Decode混合Batch 都跑在了纯动态图。因此本PR打开开关,当是动转静且子图切分模式时,step_use_cudagraph始终为TrueFastDeploy/fastdeploy/worker/gpu_model_runner.py
Lines 1582 to 1590 in 0e0eaa1
但此时出现了精度问题,纯 Prefill + Prefill+Decode混合Batch 存在精度问题
是
get_block_shape_and_split_kv_block这个算子存在 prefill 与 decode 不统一的情况,所以在子图切分的时候,也要把这个算子从 CUDAGraph 中移出去FastDeploy/custom_ops/gpu_ops/append_attn/get_block_shape_and_split_kv_block.cu
Lines 313 to 315 in 0e0eaa1
FastDeploy/custom_ops/gpu_ops/append_attn/get_block_shape_and_split_kv_block.cu
Lines 388 to 390 in 0e0eaa1
Modifications
step_use_cudagraph始终为Trueget_block_shape_and_split_kv_block添加到FLAGS_cuda_graph_blacklist中Usage 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.