Skip to content

Commit 0c20d4d

Browse files
committed
[GR-15253] run micro-native benchmarks with cPython as well
PullRequest: graalpython/491
2 parents daadac4 + fa6481b commit 0c20d4d

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
overlay: "627f30447cbecc2e4f5d16553cbfc6b669396c5d",
2+
overlay: "bf72da98b99c9f367e7d749e12d189e3405c6853",
33

44
// ======================================================================================================
55
//

mx.graalpython/mx_graalpython.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
from mx_gate import Task
4343
from mx_graalpython_bench_param import PATH_MESO, BENCHMARKS
4444
from mx_graalpython_benchmark import PythonBenchmarkSuite, python_vm_registry, CPythonVm, PyPyVm, GraalPythonVm, \
45-
CONFIGURATION_DEFAULT, CONFIG_EXPERIMENTAL_SPLITTING, CONFIGURATION_SANDBOXED
45+
CONFIGURATION_DEFAULT, CONFIG_EXPERIMENTAL_SPLITTING, CONFIGURATION_SANDBOXED, CONFIGURATION_NATIVE
4646

4747
SUITE = mx.suite('graalpython')
4848
SUITE_COMPILER = mx.suite("compiler", fatalIfMissing=False)
@@ -903,10 +903,14 @@ def import_python_sources(args):
903903
# post init
904904
#
905905
# ----------------------------------------------------------------------------------------------------------------------
906-
907906
def _register_vms(namespace):
908-
python_vm_registry.add_vm(CPythonVm(CONFIGURATION_DEFAULT), SUITE)
909-
python_vm_registry.add_vm(PyPyVm(CONFIGURATION_DEFAULT), SUITE)
907+
# cpython
908+
python_vm_registry.add_vm(CPythonVm(config_name=CONFIGURATION_DEFAULT), SUITE)
909+
910+
# pypy
911+
python_vm_registry.add_vm(PyPyVm(config_name=CONFIGURATION_DEFAULT), SUITE)
912+
913+
# graalpython
910914
python_vm_registry.add_vm(GraalPythonVm(config_name=CONFIGURATION_DEFAULT), SUITE, 10)
911915
python_vm_registry.add_vm(GraalPythonVm(config_name=CONFIG_EXPERIMENTAL_SPLITTING, extra_vm_args=[
912916
'-Dgraal.TruffleExperimentalSplitting=true',
@@ -915,6 +919,9 @@ def _register_vms(namespace):
915919
python_vm_registry.add_vm(GraalPythonVm(config_name=CONFIGURATION_SANDBOXED, extra_polyglot_args=[
916920
'--llvm.sandboxed',
917921
]), SUITE, 10)
922+
python_vm_registry.add_vm(GraalPythonVm(config_name=CONFIGURATION_NATIVE, extra_polyglot_args=[
923+
"--llvm.sandboxed=false"
924+
]), SUITE, 10)
918925

919926

920927
def _register_bench_suites(namespace):
@@ -934,7 +941,6 @@ def python_coverage(args):
934941
mx.command_function("jacocoreport")(["--omit-excluded", "--format=html"])
935942

936943

937-
938944
# ----------------------------------------------------------------------------------------------------------------------
939945
#
940946
# register the suite commands (if any)

mx.graalpython/mx_graalpython_benchmark.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@
5050
VM_NAME_GRAALPYTHON = "graalpython"
5151
VM_NAME_CPYTHON = "cpython"
5252
VM_NAME_PYPY = "pypy"
53+
VM_NAME_GRAALPYTHON_SVM = "graalpython-svm"
5354
GROUP_GRAAL = "Graal"
5455
SUBGROUP_GRAAL_PYTHON = "graalpython"
5556
PYTHON_VM_REGISTRY_NAME = "Python"
5657
CONFIGURATION_DEFAULT = "default"
58+
CONFIGURATION_NATIVE = "native"
5759
CONFIG_EXPERIMENTAL_SPLITTING = "experimental_splitting"
5860
CONFIGURATION_SANDBOXED = "sandboxed"
5961

@@ -223,7 +225,6 @@ def run(self, cwd, args):
223225
else:
224226
extra_polyglot_args += ["--experimental-options"]
225227

226-
227228
vm_args = mx.get_runtime_jvm_args(dists, cp_suffix=self._cp_suffix, cp_prefix=self._cp_prefix)
228229
if isinstance(self._extra_vm_args, list):
229230
vm_args += self._extra_vm_args
@@ -232,7 +233,12 @@ def run(self, cwd, args):
232233
"com.oracle.graal.python.shell.GraalPythonMain"
233234
]
234235
cmd = truffle_options + vm_args + extra_polyglot_args + args
235-
return self.host_vm().run(cwd, cmd)
236+
237+
host_vm = self.host_vm()
238+
if hasattr(host_vm, 'run_lang'):
239+
return host_vm.run_lang('graalpython', extra_polyglot_args + args, cwd)
240+
else:
241+
return host_vm.run(cwd, cmd)
236242

237243
def name(self):
238244
return VM_NAME_GRAALPYTHON

0 commit comments

Comments
 (0)