-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
single_query_cached_kv_attention
kernel (#3)
- Loading branch information
1 parent
cbf8779
commit 0deacbc
Showing
12 changed files
with
2,140 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <torch/extension.h> | ||
|
||
void single_query_cached_kv_attention( | ||
torch::Tensor& out, | ||
torch::Tensor& query, | ||
torch::Tensor& key_cache, | ||
torch::Tensor& value_cache, | ||
float scale, | ||
torch::Tensor& block_tables, | ||
torch::Tensor& context_lens, | ||
int block_size, | ||
int max_context_len); | ||
|
||
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { | ||
m.def( | ||
"single_query_cached_kv_attention", | ||
&single_query_cached_kv_attention, | ||
"Compute the attention between an input query and the cached key/value tensors"); | ||
} |
Oops, something went wrong.