WaveCut's picture
Add optional INT8 AR KV cache with measured runtime profiles
c7a8520 verified
Raw History Blame Contribute Delete
672 Bytes
#include <torch/library.h>
#include "registration.h"
#include "torch_binding.h"
TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) {
ops.def("split_k_attention(Tensor! out, Tensor! partial, Tensor! stats, Tensor q, Tensor k, Tensor v, Tensor kscale, Tensor vscale, Tensor lengths, int partitions) -> ()");
ops.impl("split_k_attention", torch::kCUDA, &split_k_attention);
ops.def("qkv_int8_decode(Tensor! q, Tensor! keys, Tensor! values, Tensor! kscale, Tensor! vscale, Tensor x, Tensor qw, Tensor kw, Tensor cos, Tensor sin, Tensor positions, float eps) -> ()");
ops.impl("qkv_int8_decode", torch::kCUDA, &qkv_int8_decode);
}
REGISTER_EXTENSION(TORCH_EXTENSION_NAME)