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

bugfix: backward compatibility #542

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions python/flashinfer/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ def plan(
pos_encoding_mode: str = "NONE",
window_left: int = -1,
logits_soft_cap: Optional[float] = None,
data_type: Optional[Union[str, torch.dtype]] = "float16",
q_data_type: Optional[Union[str, torch.dtype]] = "float16",
kv_data_type: Optional[Union[str, torch.dtype]] = None,
sm_scale: Optional[float] = None,
Expand Down Expand Up @@ -536,6 +537,9 @@ def plan(
kv_data_type : Optional[Union[str, torch.dtype]]
The data type of the key/value tensor. If None, will be set to
``q_data_type``. Defaults to ``None``.
data_type: Optional[Union[str, torch.dtype]]
The data type of both the query and key/value tensors. Defaults to torch.float16.
data_type is deprecated, please use q_data_type and kv_data_type instead.

Note
----
Expand Down Expand Up @@ -580,6 +584,10 @@ def plan(
qo_indptr = qo_indptr.to("cpu", non_blocking=True)
indptr = indptr.to("cpu", non_blocking=True)

if data_type is not None:
q_data_type = data_type
kv_data_type = data_type

q_data_type = canonicalize_torch_dtype(q_data_type)
if kv_data_type is None:
kv_data_type = q_data_type
Expand Down
2 changes: 1 addition & 1 deletion python/flashinfer/jit/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def gen_single_decode_cu(*args) -> Tuple[str, pathlib.Path]:
path,
get_single_decode_cu_str(*args),
)
return file_name, path
return uri, path


def get_batch_decode_cu_str(
Expand Down