Skip to content

Commit 195e60b

Browse files
author
Tristan Konolige
authored
[FIX,ROOFLINE] Handle mismatched compiled and TIR hash (#12219)
Fix a bug where roofline analysis would crash if the provided tir functions do no match the profiling report.
1 parent cfefa90 commit 195e60b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/tvm/utils/roofline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def roofline_from_existing(
370370

371371
new_calls = []
372372
for call in report.calls:
373-
if "Hash" in call.keys():
373+
if "Hash" in call.keys() and call["Hash"] in all_features:
374374
_, features = all_features[call["Hash"]]
375375

376376
flops = np.sum(features["float_addsub"] + features["float_mul"] + features["float_mad"])
@@ -440,7 +440,7 @@ def roofline_analysis(
440440
Parameters
441441
----------
442442
mod : IRModule
443-
Uncompiled input module>
443+
Uncompiled input module
444444
445445
params : Dict[str, nd.NDArray]
446446

0 commit comments

Comments
 (0)