Skip to content

Commit e77bb19

Browse files
committed
ci: add support for GraalPython SVM images to run the benchmarks
1 parent 83a6900 commit e77bb19

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: "97552c096f46421199616c1381754986aed40d07",
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)
@@ -870,10 +870,14 @@ def import_python_sources(args):
870870
# post init
871871
#
872872
# ----------------------------------------------------------------------------------------------------------------------
873-
874873
def _register_vms(namespace):
875-
python_vm_registry.add_vm(CPythonVm(CONFIGURATION_DEFAULT), SUITE)
876-
python_vm_registry.add_vm(PyPyVm(CONFIGURATION_DEFAULT), SUITE)
874+
# cpython
875+
python_vm_registry.add_vm(CPythonVm(config_name=CONFIGURATION_DEFAULT), SUITE)
876+
877+
# pypy
878+
python_vm_registry.add_vm(PyPyVm(config_name=CONFIGURATION_DEFAULT), SUITE)
879+
880+
# graalpython
877881
python_vm_registry.add_vm(GraalPythonVm(config_name=CONFIGURATION_DEFAULT), SUITE, 10)
878882
python_vm_registry.add_vm(GraalPythonVm(config_name=CONFIG_EXPERIMENTAL_SPLITTING, extra_vm_args=[
879883
'-Dgraal.TruffleExperimentalSplitting=true',
@@ -882,6 +886,9 @@ def _register_vms(namespace):
882886
python_vm_registry.add_vm(GraalPythonVm(config_name=CONFIGURATION_SANDBOXED, extra_polyglot_args=[
883887
'--llvm.sandboxed',
884888
]), SUITE, 10)
889+
python_vm_registry.add_vm(GraalPythonVm(config_name=CONFIGURATION_NATIVE, extra_polyglot_args=[
890+
"--llvm.sandboxed=false"
891+
]), SUITE, 10)
885892

886893

887894
def _register_bench_suites(namespace):
@@ -901,7 +908,6 @@ def python_coverage(args):
901908
mx.command_function("jacocoreport")(["--omit-excluded", "--format=html"])
902909

903910

904-
905911
# ----------------------------------------------------------------------------------------------------------------------
906912
#
907913
# 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)