From cc5eaf7c81bab4c4f3ff9ecd0c4e4b8745764c5a Mon Sep 17 00:00:00 2001 From: Bert Maher Date: Fri, 9 Aug 2024 07:17:42 -0700 Subject: [PATCH] Allow omitting the "Bias" column in data table (#2412) Summary: Pull Request resolved: https://github.com/pytorch/benchmark/pull/2412 Reviewed By: xuzhao9, sijiac Differential Revision: D60964532 Pulled By: bertmaher fbshipit-source-id: a6e73173478026179c1be51c73676b7e463aa028 --- torchbenchmark/operators/gemm/data_io.py | 2 +- torchbenchmark/operators/gemm/operator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/torchbenchmark/operators/gemm/data_io.py b/torchbenchmark/operators/gemm/data_io.py index ae6d6c614d..3754530fed 100644 --- a/torchbenchmark/operators/gemm/data_io.py +++ b/torchbenchmark/operators/gemm/data_io.py @@ -28,7 +28,7 @@ def read_shapes_from_csv(csv_path: str) -> List[List[int]]: reader = csv.DictReader(f) for row in reader: shape = [ - int(row[f]) if row[f] else None + int(row.get(f)) if row.get(f) else None for f in ("M", "N", "K", "Bias") ] shapes.append(shape) diff --git a/torchbenchmark/operators/gemm/operator.py b/torchbenchmark/operators/gemm/operator.py index dd82e22bf6..1958c8acb5 100644 --- a/torchbenchmark/operators/gemm/operator.py +++ b/torchbenchmark/operators/gemm/operator.py @@ -140,7 +140,7 @@ def triton_tma_persistent_cached_matmul(self, a, b, bias) -> Callable: def triton_ops_matmul(self, a, b, bias) -> Callable: if bias is None: return lambda: kernels.matmul(a, b) - return lambda: kernels.matmul(a, b, bias) + return lambda: kernels.matmul(a, b) + bias @register_benchmark(baseline=True) def aten_matmul(self, a, b, bias) -> Callable: