[Bugfix] Fix the issue when the FI Attention operator is used in graph mode with eagle enabled#6932
[Bugfix] Fix the issue when the FI Attention operator is used in graph mode with eagle enabled#6932chenxi-hh wants to merge 4 commits intovllm-project:mainfrom
Conversation
…h mode with eagle enabled Signed-off-by: chenxi-hh <chen464822955@163.com>
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses and resolves a critical bug affecting the FI Attention operator when it is utilized in graph mode with the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a fix for an issue with the FI Attention operator in graph mode when Eagle speculative decoding is enabled. The main change is the addition of a _pad_attention_seq_params function to pad attention parameters, ensuring static shapes for graph execution. My review identifies a logical simplification in this new function where a branch of code is unreachable, and I've provided a suggestion to improve its clarity and maintainability.
| if interpolated and interpolated[-1] < runtime_shape: | ||
| interpolated.append(runtime_shape) | ||
| elif not interpolated and last_val < runtime_shape: | ||
| interpolated = [runtime_shape] |
There was a problem hiding this comment.
The logic for ensuring runtime_shape is in the interpolated list can be simplified. The elif not interpolated branch is unreachable because the outer else block (line 350) is only entered if last_val < runtime_shape, which guarantees that range(...) will produce a non-empty list. Also, since interpolated will never be empty, the check interpolated and ... is redundant.
| if interpolated and interpolated[-1] < runtime_shape: | |
| interpolated.append(runtime_shape) | |
| elif not interpolated and last_val < runtime_shape: | |
| interpolated = [runtime_shape] | |
| if interpolated[-1] < runtime_shape: | |
| interpolated.append(runtime_shape) |
| return attn_metadata | ||
|
|
||
|
|
||
| def _pad_attention_seq_params( |
There was a problem hiding this comment.
Please don't add another padding function while we already have pad_query_start_loc_for_fia, better check why it's not working now, I assume it has something to do with vllm-project/vllm#34043 .
…h mode with eagle enabled Signed-off-by: chenxi-hh <chen464822955@163.com>
…h mode with eagle enabled Signed-off-by: chenxi-hh <chen464822955@163.com>
Fix the issue when the FI Attention operator is used in graph mode with eagle enabled
E29999[PID: 65928] 2026-03-03-05:08:21.205.139 (E29999): [InitOpInfoLib][InitOpKernel] Inconsistent format size [1] and data type size [2]![FUNC:InitUnknownFormatAndDtype][FILE:op_kernel_info_constructor.cc][LINE:959]
When layout is TND, queryT(8) must be equal to the last element of actualSequenceLengthQ(7)[FUNC:CheckFAISeqlenDataInTND][FILE:fused_infer_attention_score_tiling.cpp][LINE:942]