You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by an...@apache.org on 2023/01/09 17:56:33 UTC

[tvm] branch main updated: [Fix,Roofline] Fix roofline handling of multiple peak flops (#13716)

This is an automated email from the ASF dual-hosted git repository.

andrewzhaoluo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new ce7d8c691a [Fix,Roofline] Fix roofline handling of multiple peak flops (#13716)
ce7d8c691a is described below

commit ce7d8c691a081667d3c2f58b8ea3f2afd2628a5e
Author: Tristan Konolige <tk...@octoml.ai>
AuthorDate: Mon Jan 9 09:56:27 2023 -0800

    [Fix,Roofline] Fix roofline handling of multiple peak flops (#13716)
    
    In the switch to multiple possible peakflops measurement, the logic to
    add all of them was skipped. Instead only the last was added.
---
 python/tvm/utils/roofline/__init__.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/python/tvm/utils/roofline/__init__.py b/python/tvm/utils/roofline/__init__.py
index 67cf1133ff..67d80eb052 100644
--- a/python/tvm/utils/roofline/__init__.py
+++ b/python/tvm/utils/roofline/__init__.py
@@ -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:
@@ -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
@@ -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)