Skip to content

[V0.9.1] torchair_graph bugfix when chunked_prefill is true #1748

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
merged 2 commits into from
Jul 16, 2025

Conversation

fems14
Copy link
Contributor

@fems14 fems14 commented Jul 11, 2025

What this PR does / why we need it?

when torchair_graph and chunked_prefill are both true, save the decode kv_cache.

Does this PR introduce any user-facing change?

How was this patch tested?

Signed-off-by: fems14 <1804143737@qq.com>
@fems14 fems14 changed the title torchair_graph bugfix when chunked_prefill is true [V0.9.1] torchair_graph bugfix when chunked_prefill is true Jul 11, 2025
Signed-off-by: SlightwindSec <slightwindsec@gmail.com>
num_tokens, self.num_kv_heads, -1),
value=prefill_k_pe,
key_cache=kv_cache[0],
value_cache=kv_cache[1],
slot_indices=slots)

if kv_cache[0].numel(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you solve this problem for good, and remove all those redundant reshape_and_cache operation, merge all the code path into one. All the rope_k and nope_k are supposed to be reshape and cached into the kv_cache right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When the graph mode (without chunked prefill) is enabled, the reshapeAndCache path is not taken; instead, the fusion operator is used. The code for this part, including the entire file (mla_v1), has already been refactored by someone. It has been evaluated and is no longer on the current branch, but it will be merged into the main branch later.

Copy link
Collaborator

Choose a reason for hiding this comment

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

fine

@ganyi1996ppo ganyi1996ppo merged commit f4d4c0a into vllm-project:v0.9.1-dev Jul 16, 2025
16 checks passed
@Yikun Yikun added the no-test label Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants