Skip to content

Commit

Permalink
Basic flashinfer 0.2 support
Browse files Browse the repository at this point in the history
This change does not use any of the new features yet, but makes
some small compatibility changes.
  • Loading branch information
danieldk committed Dec 22, 2024
1 parent 23bc38b commit f4e510b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
inputs.nixpkgs.follows = "tgi-nix/nixpkgs";
};
nix-filter.url = "github:numtide/nix-filter";
tgi-nix.url = "github:huggingface/text-generation-inference-nix";
tgi-nix.url = "github:huggingface/text-generation-inference-nix/flashinfer-v0.2";
nixpkgs.follows = "tgi-nix/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
Expand Down
4 changes: 3 additions & 1 deletion server/Makefile-flashinfer
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
install-flashinfer:
pip install flashinfer==0.1.6 -i https://flashinfer.ai/whl/cu124/torch2.4
# Avoid: Could not find a version that satisfies the requirement fsspec (from torch).
pip install fsspec
pip install flashinfer==0.2.0 -i https://flashinfer.ai/whl/cu124/torch2.4
6 changes: 3 additions & 3 deletions server/text_generation_server/layers/attention/flashinfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def use_prefill_with_paged_kv_state(
head_dim=head_size,
q_data_type=dtype,
page_size=page_size,
window_left=window_left,
window_left=-1 if window_left is None else window_left,
)
yield
finally:
Expand Down Expand Up @@ -139,7 +139,7 @@ def use_prefill_state(
num_kv_heads=num_kv_heads,
head_dim=head_size,
q_data_type=dtype,
window_left=window_left,
window_left=-1 if window_left is None else window_left,
)
yield
finally:
Expand Down Expand Up @@ -243,7 +243,7 @@ def use_decode_state(
page_size=page_size,
data_type=kv_cache_dtype,
q_data_type=dtype,
window_left=window_left,
window_left=-1 if window_left is None else window_left,
)
yield
finally:
Expand Down

0 comments on commit f4e510b

Please sign in to comment.