Skip to content

Commit 49c7303

Browse files
committed
Ensure every polybench datapoint has the engine.config property
1 parent 24cf5d5 commit 49c7303

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

truffle/mx.truffle/mx_polybench/model.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -439,13 +439,18 @@ def createCommandLineArgs(self, benchmarks, bmSuiteArgs):
439439
polybench_args = ["--path=" + resolved_benchmark.absolute_path] + self.runArgs(bmSuiteArgs)
440440
return vm_args + [PolybenchBenchmarkSuite.POLYBENCH_MAIN] + polybench_args
441441

442+
def runAndReturnStdOut(self, benchmarks, bmSuiteArgs):
443+
"""Delegates to the super implementation then injects engine.config into every datapoint."""
444+
ret_code, out, dims = super().runAndReturnStdOut(benchmarks, bmSuiteArgs)
445+
dims["engine.config"] = self._get_mode(bmSuiteArgs)
446+
return ret_code, out, dims
447+
442448
def rules(self, output, benchmarks, bmSuiteArgs):
443449
metric_name = PolybenchBenchmarkSuite._get_metric_name(output)
444450
if metric_name is None:
445451
return []
446452
rules = []
447453
benchmark_name = benchmarks[0]
448-
mode = self._get_mode(bmSuiteArgs)
449454
if metric_name == "time":
450455
# For metric "time", two metrics are reported:
451456
# - "warmup" (per-iteration data for "warmup" and "run" iterations)
@@ -462,7 +467,6 @@ def rules(self, output, benchmarks, bmSuiteArgs):
462467
"metric.type": "numeric",
463468
"metric.score-function": "id",
464469
"metric.iteration": ("$iteration", int),
465-
"engine.config": mode,
466470
},
467471
),
468472
ExcludeWarmupRule(
@@ -476,7 +480,6 @@ def rules(self, output, benchmarks, bmSuiteArgs):
476480
"metric.type": "numeric",
477481
"metric.score-function": "id",
478482
"metric.iteration": ("<iteration>", int),
479-
"engine.config": mode,
480483
},
481484
startPattern=r"::: Running :::",
482485
),
@@ -494,7 +497,6 @@ def rules(self, output, benchmarks, bmSuiteArgs):
494497
"metric.type": "numeric",
495498
"metric.score-function": "id",
496499
"metric.iteration": ("<iteration>", int),
497-
"engine.config": mode,
498500
},
499501
startPattern=r"::: Running :::",
500502
)
@@ -512,7 +514,6 @@ def rules(self, output, benchmarks, bmSuiteArgs):
512514
"metric.type": "numeric",
513515
"metric.score-function": "id",
514516
"metric.iteration": 0,
515-
"engine.config": mode,
516517
},
517518
)
518519
]
@@ -531,7 +532,6 @@ def rules(self, output, benchmarks, bmSuiteArgs):
531532
"metric.score-function": "id",
532533
"metric.better": "lower",
533534
"metric.iteration": 0,
534-
"engine.config": mode,
535535
},
536536
),
537537
mx_benchmark.StdOutRule(
@@ -545,7 +545,6 @@ def rules(self, output, benchmarks, bmSuiteArgs):
545545
"metric.score-function": "id",
546546
"metric.better": "lower",
547547
"metric.iteration": 0,
548-
"engine.config": mode,
549548
},
550549
),
551550
]

0 commit comments

Comments
 (0)