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

[Fix,Roofline] Fix roofline handling of multiple peak flops #13716

Merged
merged 1 commit into from
Jan 9, 2023
Merged
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: 5 additions & 5 deletions python/tvm/utils/roofline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def roofline_from_existing(
if isinstance(prim, tir.PrimFunc) and "hash" in prim.attrs.keys()
}

new_configuration = dict(report.configuration.items())
new_calls = []
for call in report.calls:
if "Hash" in call.keys() and call["Hash"] in all_features:
Expand All @@ -159,6 +160,10 @@ def roofline_from_existing(
loaded_bytes, peak_bandwidth, bandwidth_name = registry.estimate_peak_bandwidth(
prim, features, target, dev, remote
)
new_configuration[f"Estimated Peak FLOP/s ({flops_name})"] = profiling.Ratio(peak_flops)
new_configuration[
f"Estimated Peak Bandwidth ({bandwidth_name}, byte/second)"
] = profiling.Ratio(peak_bandwidth)
ridge_point = peak_flops / peak_bandwidth

runtime = call["Duration (us)"].microseconds * 1e-6
Expand All @@ -180,11 +185,6 @@ def roofline_from_existing(
new_calls.append(call)
else:
new_calls.append(call)
new_configuration = dict(report.configuration.items())
new_configuration[f"Estimated Peak FLOP/s ({flops_name})"] = profiling.Ratio(peak_flops)
new_configuration[
f"Estimated Peak Bandwidth ({bandwidth_name}, byte/second)"
] = profiling.Ratio(peak_bandwidth)
return profiling.Report(new_calls, report.device_metrics, new_configuration)


Expand Down