@@ -461,11 +461,48 @@ def createCommandLineArgs(self, benchmarks, bmSuiteArgs):
461
461
return vm_args + [PolybenchBenchmarkSuite .POLYBENCH_MAIN ] + polybench_args
462
462
463
463
def runAndReturnStdOut (self , benchmarks , bmSuiteArgs ):
464
- """Delegates to the super implementation then injects engine.config into every datapoint."""
465
464
ret_code , out , dims = super ().runAndReturnStdOut (benchmarks , bmSuiteArgs )
466
- dims ["engine.config" ] = self ._get_mode (bmSuiteArgs )
465
+ host_vm_config = self ._infer_host_vm_config (bmSuiteArgs , dims )
466
+ guest_vm , guest_vm_config = self ._infer_guest_vm_info (benchmarks , bmSuiteArgs )
467
+ dims .update (
468
+ {
469
+ "host-vm-config" : host_vm_config ,
470
+ "guest-vm" : guest_vm ,
471
+ "guest-vm-config" : guest_vm_config ,
472
+ }
473
+ )
467
474
return ret_code , out , dims
468
475
476
+ def _infer_host_vm_config (self , bm_suite_args , dims ):
477
+ edition = dims .get ("platform.graalvm-edition" , "unknown" ).lower ()
478
+ if edition not in ["ce" , "ee" ] or not dims .get ("platform.prebuilt-vm" , False ):
479
+ raise ValueError (f"Polybench should only run with a prebuilt GraalVM. Dimensions found: { dims } " )
480
+
481
+ if self .is_native_mode (bm_suite_args ):
482
+ # patch ce/ee suffix
483
+ existing_config = dims ["host-vm-config" ]
484
+ existing_edition = existing_config .split ("-" )[- 1 ]
485
+ if existing_edition in ["ce" , "ee" ]:
486
+ assert (
487
+ existing_edition == edition
488
+ ), f"Existing host-vm-config { existing_config } conflicts with GraalVM edition { edition } "
489
+ return existing_config
490
+ return dims ["host-vm-config" ] + "-" + edition
491
+ else :
492
+ # assume config used when building a GraalVM distribution
493
+ return "graal-enterprise-libgraal-pgo" if edition == "ee" else "graal-core-libgraal"
494
+
495
+ def _infer_guest_vm_info (self , benchmarks , bm_suite_args ) -> Tuple [str , str ]:
496
+ resolved_benchmark = self ._resolve_current_benchmark (benchmarks )
497
+ guest_vm = "-" .join (sorted (resolved_benchmark .suite .languages ))
498
+ if "--engine.Compilation=false" in self .runArgs (
499
+ bm_suite_args
500
+ ) or "-Dpolyglot.engine.Compilation=false" in self .vmArgs (bm_suite_args ):
501
+ guest_vm_config = "interpreter"
502
+ else :
503
+ guest_vm_config = "default"
504
+ return guest_vm , guest_vm_config
505
+
469
506
def rules (self , output , benchmarks , bmSuiteArgs ):
470
507
metric_name = PolybenchBenchmarkSuite ._get_metric_name (output )
471
508
if metric_name is None :
@@ -586,14 +623,6 @@ def _get_metric_name(bench_output) -> Optional[str]:
586
623
)
587
624
return metric_name
588
625
589
- def _get_mode (self , bmSuiteArgs ):
590
- """Determines the "mode" to report in benchmark data points."""
591
- if "--engine.Compilation=false" in self .runArgs (
592
- bmSuiteArgs
593
- ) or "-Dpolyglot.engine.Compilation=false" in self .vmArgs (bmSuiteArgs ):
594
- return "interpreter"
595
- return "standard"
596
-
597
626
598
627
class ExcludeWarmupRule (mx_benchmark .StdOutRule ):
599
628
"""Rule that behaves as the StdOutRule, but skips input until a certain pattern."""
0 commit comments