-
Notifications
You must be signed in to change notification settings - Fork 735
[OP][Optimization] Remove ENABLE_PREFILL template parameter in multi_query_append_attention_warp1_4_kernel #7201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
zhoutianzi666
merged 13 commits into
PaddlePaddle:develop
from
zhoutianzi666:remove_enable_prefill
Apr 7, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bdb65c8
add nvtx
zhoutianzi666 e6473f3
add nvtx
zhoutianzi666 7b515c4
add nvtx
zhoutianzi666 6bd9af8
add nvtx
zhoutianzi666 8f7e6a5
add nvtx
zhoutianzi666 f4728b1
add nvtx
zhoutianzi666 4150355
add nvtx
zhoutianzi666 f922a0d
add nvtx
zhoutianzi666 67f5031
add nvtx
zhoutianzi666 bdab175
add nvtx
zhoutianzi666 844c20f
add nvtx
zhoutianzi666 3e3e619
add nvtx
zhoutianzi666 e247034
add nvtx
zhoutianzi666 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,6 +146,8 @@ def __init__( | |
| self.causal: bool = getattr(fd_config.model_config, "causal", True) | ||
| self.speculative_method = fd_config.speculative_config.method | ||
| self.speculate_max_draft_token_num: int = fd_config.speculative_config.num_speculative_tokens | ||
| if self.speculative_method is None: | ||
| self.speculate_max_draft_token_num = 0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 建议 建议添加注释说明此设置的目的 这个修改确保非 speculative 模式下 # When not using speculative decoding, set to 0. The CUDA kernel will
# receive (speculate_max_draft_token_num + 1) = 1, which matches the
# simplified memory layout after removing ENABLE_PREFILL branches.
if self.speculative_method is None:
self.speculate_max_draft_token_num = 0 |
||
| self.keep_pd_step_flag: bool = fd_config.speculative_config.model_type == "mtp" | ||
| self.num_layers_draft_model: int = int(fd_config.speculative_config.method == SpecMethod.MTP) | ||
|
|
||
|
|
||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ 疑问 只有
multi_query_append_attention_warp1_4_kernel删除了ENABLE_PREFILL模板参数注意到
multiquery_attention_c4_impl.cuh和multiquery_attention_c8_impl.cuh中仍然保留了ENABLE_PREFILL参数。这是否是有意为之(分阶段重构),还是遗漏?如果是有意为之,建议在 PR 描述中说明原因。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
分阶段重构