Skip to content

Commit 331827e

Browse files
committed
Skip currently failing numpy/pandas benchmarks
1 parent f8daf5d commit 331827e

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

mx.graalpython/mx_graalpython_python_benchmarks.py

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,30 @@
7272
# "bench_ufunc",
7373
]
7474

75+
SKIPPED_NUMPY_BENCHMARKS = [
76+
"bench_core.CountNonzero.time_count_nonzero(3, 1000000, <class 'str'>)", # Times out
77+
"bench_core.CountNonzero.time_count_nonzero_axis(3, 1000000, <class 'str'>)", # Times out
78+
"bench_core.CountNonzero.time_count_nonzero_multi_axis(3, 1000000, <class 'str'>)", # Times out
79+
"bench_linalg.LinalgSmallArrays.time_det_small_array", # TODO fails with numpy.linalg.LinAlgError
80+
]
81+
7582
DEFAULT_PANDAS_BENCHMARKS = [
7683
"reshape",
7784
"replace"
7885
]
7986

87+
SKIPPED_PANDAS_BENCHMARKS = [
88+
"replace.ReplaceDict.time_replace_series", # Times out
89+
"replace.ReplaceList.time_replace_list", # OOM, WIP msimacek
90+
"replace.ReplaceList.time_replace_list_one_match", # OOM, WIP msimacek
91+
"reshape.Crosstab.time_crosstab_normalize_margins", # Times out
92+
"reshape.Cut.peakmem_cut_interval", # Times out
93+
"reshape.Cut.time_cut_interval", # Times out
94+
"reshape.GetDummies.time_get_dummies_1d_sparse", # Times out
95+
"reshape.PivotTable.time_pivot_table_margins", # Times out
96+
"reshape.WideToLong.time_wide_to_long_big", # Times out
97+
]
98+
8099
DEFAULT_PYPERFORMANCE_BENCHMARKS = [
81100
# "2to3",
82101
# "chameleon",
@@ -173,6 +192,14 @@
173192
]
174193

175194

195+
def create_asv_benchmark_selection(benchmarks, skipped=()):
196+
regex = '|'.join(benchmarks)
197+
if not skipped:
198+
return regex
199+
negative_lookaheads = [re.escape(skip) + (r'\b' if not skip.endswith(')') else '') for skip in skipped]
200+
return '^(?!' + '|'.join(negative_lookaheads) + ')(' + regex + ')'
201+
202+
176203
class PyPerfJsonRule(mx_benchmark.Rule):
177204
"""Parses a JSON file produced by PyPerf and creates a measurement result."""
178205

@@ -731,10 +758,8 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
731758
[join(workdir, vm_venv, "bin", "asv"), "machine", "--yes"], cwd=benchdir
732759
)
733760

734-
if benchmarks:
735-
bms = ["-b", "|".join(benchmarks)]
736-
else:
737-
bms = ["-b", "|".join(DEFAULT_NUMPY_BENCHMARKS)]
761+
if not benchmarks:
762+
benchmarks = DEFAULT_NUMPY_BENCHMARKS
738763
retcode = mx.run(
739764
[
740765
join(workdir, vm_venv, "bin", "asv"),
@@ -745,7 +770,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
745770
"--python=same",
746771
"--set-commit-hash",
747772
self.VERSION,
748-
*bms,
773+
"-b", create_asv_benchmark_selection(benchmarks, skipped=SKIPPED_NUMPY_BENCHMARKS),
749774
],
750775
cwd=benchdir,
751776
nonZeroIsFatal=False,
@@ -860,10 +885,8 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
860885
[join(workdir, vm_venv, "bin", "asv"), "machine", "--yes"], cwd=benchdir
861886
)
862887

863-
if benchmarks:
864-
bms = ["-b", "|".join(benchmarks)]
865-
else:
866-
bms = ["-b", "|".join(DEFAULT_PANDAS_BENCHMARKS)]
888+
if not benchmarks:
889+
benchmarks = DEFAULT_PANDAS_BENCHMARKS
867890
retcode = mx.run(
868891
[
869892
join(workdir, vm_venv, "bin", "asv"),
@@ -874,7 +897,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
874897
"--python=same",
875898
"--set-commit-hash",
876899
self.VERSION_TAG,
877-
*bms,
900+
"-b", create_asv_benchmark_selection(benchmarks, skipped=SKIPPED_PANDAS_BENCHMARKS),
878901
],
879902
cwd=benchdir,
880903
nonZeroIsFatal=False,

0 commit comments

Comments
 (0)