Skip to content

Commit

Permalink
adding fp32 strict and tf32x3 benchmarks for gemm
Browse files Browse the repository at this point in the history
Summary:
TSIA

draft diff while I move this to its own op

Reviewed By: danzimm

Differential Revision: D64781204

fbshipit-source-id: c3ddd956230c1e4c8166867f03b5a28e8d6586e9
  • Loading branch information
adamomainz authored and facebook-github-bot committed Oct 23, 2024
1 parent 405ba75 commit 036012f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions torchbenchmark/operators/gemm/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,24 @@ def triton_ops_matmul(self, a, b, bias) -> Callable:
return lambda: kernels.matmul(a, b)
return lambda: kernels.matmul(a, b) + bias

@register_benchmark(enabled=False, ci=False)
def triton_ops_with_tf32x23(self, a, b, bias) -> Callable:
input_precision = None
if self.dtype == torch.float32:
input_precision = "tf32x3"
if bias is None:
return lambda: kernels.matmul(a, b, None, input_precision)
return lambda: kernels.matmul(a, b, None, input_precision) + bias

@register_benchmark(enabled=False, ci=False)
def triton_ops_with_fp32_strict(self, a, b, bias) -> Callable:
input_precision = None
if self.dtype == torch.float32:
input_precision = "ieee"
if bias is None:
return lambda: kernels.matmul(a, b, self.dtype, input_precision)
return lambda: kernels.matmul(a, b, self.dtype, input_precision) + bias

@register_benchmark(baseline=True)
def aten_matmul(self, a, b, bias) -> Callable:
if not bias == None:
Expand Down

0 comments on commit 036012f

Please sign in to comment.