Skip to content

Commit 3a805e5

Browse files
committed
Fix Bytecode DSL checking in heap benchmarks
1 parent 9340707 commit 3a805e5

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

graalpython/com.oracle.graal.python.benchmarks/python/heap/import-a-lot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@
5959
import tomllib
6060
import argparse
6161
import subprocess
62+
import sys
63+
64+
# We log the bytecode DSL flag only in this benchamark, because we do not want to influence
65+
# the other benchmarks by importing the sys module. Other benchmarks will print a warning
66+
# that bytecode DSL flag could not be verified
67+
if getattr(getattr(sys, "implementation", None), "name", None) == "graalpy":
68+
print(f"### using bytecode DSL interpreter: {__graalpython__.is_bytecode_dsl_interpreter}")
6269

6370
# Sleep a bit to shake out weakref callbacks and get more measurement samples
6471
for i in range(30):

mx.graalpython/mx_graalpython_benchmark.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,9 @@ def is_bytecode_dsl_config(self):
418418
return bool(self._extra_vm_args and '--vm.Dpython.EnableBytecodeDSLInterpreter=true' in self._extra_vm_args)
419419

420420
def _validate_output(self, code, out, dims):
421+
if "using bytecode DSL interpreter:" not in out:
422+
print(f"BENCHMARK WARNING: could not verify whether running on bytecode DSL or not (expected for heap benchmarks)")
423+
return code, out, dims
421424
is_bytecode_dsl_config = self.is_bytecode_dsl_config()
422425
if code == 0 and not f"using bytecode DSL interpreter: {is_bytecode_dsl_config}" in out:
423426
print(f"ERROR: host VM config does not match what the the harness reported. "

0 commit comments

Comments
 (0)