[Kernel][Hardware][Amd]Custom paged attention kernel for rocm (#8310)

This commit is contained in:
Charlie Fu
2024-09-13 17:01:11 -07:00
committed by GitHub
parent 851725202a
commit 1ef0d2efd0
8 changed files with 1371 additions and 16 deletions
+13
View File
@@ -0,0 +1,13 @@
#pragma once
#include <torch/all.h>
void paged_attention(torch::Tensor& out, torch::Tensor& exp_sums,
torch::Tensor& max_logits, torch::Tensor& tmp_out,
torch::Tensor& query, torch::Tensor& key_cache,
torch::Tensor& value_cache, int64_t num_kv_heads,
double scale, torch::Tensor& block_tables,
torch::Tensor& context_lens, int64_t block_size,
int64_t max_context_len,
const c10::optional<torch::Tensor>& alibi_slopes,
const std::string& kv_cache_dtype);