Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tritonbench] Report tflops by default for gemm; fix exception handling #2259

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions torchbenchmark/operators/gemm/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@


class Operator(BenchmarkOperator):
DEFAULT_METRICS = ["latency", "speedup", "accuracy"]
DEFAULT_METRICS = ["latency", "speedup", "accuracy", "tflops"]
DEFAULT_PRECISION = "fp16"

def __init__(self, mode: str, device: str, extra_args: Optional[List[str]] = None):
Expand Down Expand Up @@ -202,13 +202,7 @@ def get_input_iter(self) -> Generator:
def _get_accuracy(self, fn: Callable, baseline_fn: Callable) -> bool:
output = fn()
baseline_output = baseline_fn()
accuracy = True
try:
torch.testing.assert_close(output, baseline_output)
except Exception:
accuracy = False
finally:
return accuracy
return torch.allclose(output, baseline_output)

def plot(self):
@triton.testing.perf_report(
Expand Down
2 changes: 0 additions & 2 deletions torchbenchmark/util/triton_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,6 @@ def _init_extra_metrics() -> Dict[str, Any]:
metrics.extra_metrics[metric_name] = func(fn, self.example_inputs, metrics)
except torch.cuda.OutOfMemoryError:
metrics.error_msg = "CUDA OOM"
except RuntimeError as e:
metrics.error_msg = str(e)
return metrics

def get_peak_mem(
Expand Down
Loading