2024-09-13 19:01:11 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <torch/all.h>
|
|
|
|
|
|
2025-04-21 22:46:22 -05:00
|
|
|
torch::Tensor LLMM1(at::Tensor& in_a, at::Tensor& in_b,
|
|
|
|
|
const int64_t rows_per_block);
|
|
|
|
|
|
2025-09-23 11:31:45 -07:00
|
|
|
torch::Tensor wvSplitK(const at::Tensor& in_a, const at::Tensor& in_b,
|
2025-09-24 16:56:21 -07:00
|
|
|
const std::optional<at::Tensor>& in_bias,
|
2025-04-21 22:46:22 -05:00
|
|
|
const int64_t CuCount);
|
|
|
|
|
|
2026-01-16 09:45:04 -08:00
|
|
|
torch::Tensor wvSplitKrc(const at::Tensor& in_a, const at::Tensor& in_b,
|
|
|
|
|
const std::optional<at::Tensor>& in_bias,
|
|
|
|
|
const int64_t CuCount);
|
|
|
|
|
|
2025-09-23 11:31:45 -07:00
|
|
|
void wvSplitKQ(const at::Tensor& in_a, const at::Tensor& in_b,
|
2025-09-24 16:56:21 -07:00
|
|
|
const std::optional<at::Tensor>& in_bias, at::Tensor& out_c,
|
2025-09-23 11:31:45 -07:00
|
|
|
const at::Tensor& scale_a, const at::Tensor& scale_b,
|
|
|
|
|
const int64_t CuCount);
|
2025-04-21 22:46:22 -05:00
|
|
|
|
2025-05-07 10:12:35 -04:00
|
|
|
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,
|
2025-08-09 01:15:06 -05:00
|
|
|
torch::Tensor& block_tables, torch::Tensor& seq_lens,
|
2025-05-07 10:12:35 -04:00
|
|
|
const std::optional<torch::Tensor>& query_start_loc, int64_t block_size,
|
2025-08-09 01:15:06 -05:00
|
|
|
int64_t max_seq_len, const std::optional<torch::Tensor>& alibi_slopes,
|
2025-05-07 10:12:35 -04:00
|
|
|
const std::string& kv_cache_dtype, torch::Tensor& k_scale,
|
2025-09-15 10:43:26 -04:00
|
|
|
torch::Tensor& v_scale, const std::optional<torch::Tensor>& fp8_out_scale,
|
|
|
|
|
const std::string& mfma_type);
|