[Performance] Move apply_w8a8_block_fp8_linear to an op class (#24666)

Signed-off-by: ElizaWszola <ewszola@redhat.com>
Signed-off-by: ElizaWszola <elizaw.9289@gmail.com>
Signed-off-by: Luka Govedič <lgovedic@redhat.com>
Signed-off-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
Co-authored-by: Michael Goin <mgoin64@gmail.com>
Co-authored-by: Luka Govedič <lgovedic@redhat.com>
This commit is contained in:
ElizaWszola
2025-09-23 12:03:10 -07:00
committed by GitHub
co-authored by Luka Govedič Michael Goin Luka Govedič
parent 8c1c81a3de
commit 63400259d0
14 changed files with 341 additions and 201 deletions
@@ -43,7 +43,7 @@ def prepare_block_fp8_matmul_inputs(
return M, N, K, C
def w8a8_block_fp8_matmul_deepgemm(
def w8a8_deepgemm_block_scaled_mm(
A: torch.Tensor,
B: torch.Tensor,
As: torch.Tensor,
@@ -59,7 +59,7 @@ def w8a8_block_fp8_matmul_deepgemm(
return C
def w8a8_block_fp8_matmul_deepgemm_fake(
def w8a8_deepgemm_block_scaled_mm_fake(
A: torch.Tensor,
B: torch.Tensor,
As: torch.Tensor,
@@ -73,9 +73,9 @@ def w8a8_block_fp8_matmul_deepgemm_fake(
direct_register_custom_op(
op_name="w8a8_block_fp8_matmul_deepgemm",
op_func=w8a8_block_fp8_matmul_deepgemm,
op_name="w8a8_deepgemm_block_scaled_mm",
op_func=w8a8_deepgemm_block_scaled_mm,
mutates_args=[],
fake_impl=w8a8_block_fp8_matmul_deepgemm_fake,
fake_impl=w8a8_deepgemm_block_scaled_mm_fake,
dispatch_key=current_platform.dispatch_key,
)