Skip to content
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

flashinfer: switch to plan API #2904

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion server/text_generation_server/layers/attention/cuda.py
Original file line number Diff line number Diff line change
@@ -235,7 +235,6 @@ def attention(
paged_kv_cache=(kv_cache.key, kv_cache.value),
logits_soft_cap=softcap,
sm_scale=softmax_scale,
window_left=window_size_left,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this gone ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is already set by the context manager:

window_left=-1 if window_left is None else window_left,

window_left=-1 if window_left is None else window_left,

This is one of the arguments that is gone in the new run() API.

k_scale=kv_scales.key_scale_cpu if can_scale else 1.0,
v_scale=kv_scales.value_scale_cpu if can_scale else 1.0,
)
6 changes: 2 additions & 4 deletions server/text_generation_server/layers/attention/flashinfer.py
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ def use_prefill_with_paged_kv_state(

token = prefill_with_paged_kv_state.set(state)
try:
state.begin_forward(
state.plan(
qo_indptr=cu_seqlens,
paged_kv_indptr=indptr,
paged_kv_indices=block_tables,
@@ -99,7 +99,6 @@ def use_prefill_with_paged_kv_state(
)
yield
finally:
state.end_forward()
if token is not None:
prefill_with_paged_kv_state.reset(token)

@@ -200,7 +199,7 @@ def use_decode_state(
token = decode_state.set(state)

try:
state.begin_forward(
state.plan(
indptr=indptr,
indices=block_tables,
last_page_len=last_page_len,
@@ -214,6 +213,5 @@ def use_decode_state(
)
yield
finally:
state.end_forward()
if token is not None:
decode_state.reset(token)