[11b/n] Migrate Machete kernels to torch stable ABI (#45304)
Signed-off-by: Chris Leonard <chleonar@redhat.com> Signed-off-by: Shengqi Chen <harry-chen@outlook.com> Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
This commit is contained in:
co-authored by
Shengqi Chen
parent
a37b4a940e
commit
a014dddbaa
@@ -34,6 +34,39 @@ STABLE_TORCH_LIBRARY_FRAGMENT(_C, ops) {
|
||||
// TODO: Remove this once ROCm upgrade to torch 2.11.
|
||||
ops.def("get_cuda_view_from_cpu_tensor(Tensor cpu_tensor) -> Tensor");
|
||||
|
||||
// Machete (Dense) Optimized Mixed Precision GEMM for Hopper.
|
||||
ops.def(
|
||||
"machete_supported_schedules("
|
||||
" ScalarType a_type,"
|
||||
" int b_type,"
|
||||
" ScalarType? maybe_group_scales_type,"
|
||||
" ScalarType? maybe_group_zeros_type,"
|
||||
" ScalarType? maybe_channel_scales_type,"
|
||||
" ScalarType? maybe_token_scales_type,"
|
||||
" ScalarType? maybe_out_type"
|
||||
") -> str[]");
|
||||
ops.def(
|
||||
"machete_mm("
|
||||
" Tensor A,"
|
||||
" Tensor B,"
|
||||
" int b_type,"
|
||||
" ScalarType? out_type,"
|
||||
" Tensor? group_scales,"
|
||||
" Tensor? group_zeros,"
|
||||
" int? group_size,"
|
||||
" Tensor? channel_scales,"
|
||||
" Tensor? token_scales,"
|
||||
" str? schedule"
|
||||
") -> Tensor");
|
||||
ops.def(
|
||||
"machete_prepack_B("
|
||||
" Tensor B,"
|
||||
" ScalarType a_type,"
|
||||
" int b_type,"
|
||||
" ScalarType? group_scales_type"
|
||||
") -> Tensor");
|
||||
// conditionally compiled so impl registration is in source file
|
||||
|
||||
// Marlin GEMM
|
||||
ops.def(
|
||||
"marlin_gemm(Tensor a, Tensor? c_or_none, Tensor b_q_weight, "
|
||||
|
||||
Reference in New Issue
Block a user