Skip to content

Conversation

@bdbowyer
Copy link

This PR adds the op_gflops, op_gbytes and grid_size metrics to the addmm operator as proposed new metrics. If these metrics are acceptable, I can raise PRs to add metrics for the other operators.

Adds the op_gflops, op_gbytes and grid_size metrics to the addmm operator

Signed-off-by: Bryan Bowyer <[email protected]>
@meta-cla meta-cla bot added the cla signed label Sep 19, 2025
def op_gflops(
self, fn_name: str, example_inputs: Any, metrics: BenchmarkOperatorMetrics
) -> float:
"""Report the raw number of GFLOPS (not GFLOPS/sec) for the addmm operation."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be redundant to the flops() metric?

self, fn_name: str, example_inputs: Any, metrics: BenchmarkOperatorMetrics
) -> float:
"""Report the raw number of gigabytes of I/O (not GB/sec) for the addmm operation."""
a, mat1, mat2 = example_inputs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can directly call self.flops(fn_name, example_inputs, metrics) to get the flops, then multiply it by a.element_size().

Copy link
Contributor

@xuzhao9 xuzhao9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. Sorry that I somehow missed reviewing this.
Can you help address the inline comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants