Skip to content

Commit 4179f73

Browse files
committed
[GR-74217][GR-73570] Update numpy and pandas versions in benchmarks.
PullRequest: graalpython/4587
2 parents 097e905 + f317c09 commit 4179f73

4 files changed

Lines changed: 45 additions & 10 deletions

File tree

ci.jsonnet

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
(import "ci/python-gate.libsonnet") +
66
(import "ci/python-bench.libsonnet") +
77
{
8-
overlay: "c004ac2843125f797eb9f9a28ae76b51952ad9d7",
8+
overlay: "40bd8048e1a6ba45494605955ffe748ae4db20be",
99
specVersion: "8",
1010
// Until buildbot issues around CI tiers are resolved, we cannot use them
1111
// tierConfig: self.tierConfig,
@@ -21,6 +21,7 @@
2121
GRAAL_ENTERPRISE_GIT: "",
2222
CI_OVERLAYS_GIT: "",
2323
BENCHMARK_CONFIG_GIT: "",
24+
NUMPY_REPO_GIT: "",
2425
PANDAS_REPO_GIT: "",
2526
PIP_EXTRA_INDEX_URL: "",
2627
WATCHDOG_GIT: "",

ci/python-bench.libsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
local environment(os, arch) = self.environment(os, arch) + {
9393
BENCH_RESULTS_FILE_PATH: "bench-results.json",
9494
PANDAS_REPO_URL: $.overlay_imports.PANDAS_REPO_GIT,
95+
NUMPY_REPO_URL: $.overlay_imports.NUMPY_REPO_GIT,
9596
} + if $.overlay_imports.PIP_EXTRA_INDEX_URL != "" then {
9697
PIP_EXTRA_INDEX_URL: $.overlay_imports.PIP_EXTRA_INDEX_URL,
9798
} else {},

ci/python-gate.libsonnet

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
linux: {
8282
common: {
8383
LIBGMP: {name:"libgmp", version:"6.1.0", platformspecific:true},
84-
NUMPY_BENCHMARKS_DIR: {name: "numpy", version: "1.26.4", platformspecific: false},
8584
PYPY_HOME: {name: "pypy3", version: "3.10-v7.3.12", platformspecific: true},
8685
PYPY_BENCHMARKS_DIR: {name: "pypybenchmarks", version: "84f401a8f55a", platformspecific: false},
8786
},

mx.graalpython/mx_graalpython_python_benchmarks.py

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,45 @@
7070
]
7171

7272
SKIPPED_NUMPY_BENCHMARKS = [
73+
"bench_core.CountNonzero.time_count_nonzero(1, 1000000, <class 'str'>)", # Times out
7374
"bench_core.CountNonzero.time_count_nonzero(2, 1000000, <class 'str'>)", # Times out
7475
"bench_core.CountNonzero.time_count_nonzero(3, 1000000, <class 'str'>)", # Times out
76+
"bench_core.CountNonzero.time_count_nonzero(1, 1000000, <class 'object'>)", # Times out
77+
"bench_core.CountNonzero.time_count_nonzero(2, 1000000, <class 'object'>)", # Times out
78+
"bench_core.CountNonzero.time_count_nonzero(3, 1000000, <class 'object'>)", # Times out
79+
"bench_core.CountNonzero.time_count_nonzero_axis(1, 1000000, <class 'str'>)", # Times out
7580
"bench_core.CountNonzero.time_count_nonzero_axis(2, 1000000, <class 'str'>)", # Times out
7681
"bench_core.CountNonzero.time_count_nonzero_axis(3, 1000000, <class 'str'>)", # Times out
82+
"bench_core.CountNonzero.time_count_nonzero_axis(1, 1000000, <class 'object'>)", # Times out
83+
"bench_core.CountNonzero.time_count_nonzero_axis(2, 1000000, <class 'object'>)", # Times out
84+
"bench_core.CountNonzero.time_count_nonzero_axis(3, 1000000, <class 'object'>)", # Times out
85+
"bench_core.CountNonzero.time_count_nonzero_multi_axis(1, 1000000, <class 'str'>)", # Times out
7786
"bench_core.CountNonzero.time_count_nonzero_multi_axis(2, 1000000, <class 'str'>)", # Times out
7887
"bench_core.CountNonzero.time_count_nonzero_multi_axis(3, 1000000, <class 'str'>)", # Times out
88+
"bench_core.CountNonzero.time_count_nonzero_multi_axis(1, 1000000, <class 'object'>)", # Times out
89+
"bench_core.CountNonzero.time_count_nonzero_multi_axis(2, 1000000, <class 'object'>)", # Times out
90+
"bench_core.CountNonzero.time_count_nonzero_multi_axis(3, 1000000, <class 'object'>)", # Times out
7991
"bench_linalg.LinalgSmallArrays.time_det_small_array", # TODO fails with numpy.linalg.LinAlgError
8092
"bench_indexing.IndexingSeparate.time_mmap_fancy_indexing", # Hangs in periodic job GR-73912
8193
"bench_indexing.IndexingStructured0D.time_array_slice", # Hangs in periodic job GR-73912
8294
]
8395

96+
SKIPPED_NUMPY_BENCHMARK_PATTERNS = [
97+
# These patterns match ASV's expanded benchmark names. They keep the small
98+
# cases while dropping large Cartesian-product outliers that dominate the
99+
# periodic job runtime.
100+
r"bench_core\.CorrConv\.time_(?:correlate|convolve)\((?:100000,|[^)]*, (?:1000|10000), )",
101+
r"bench_core\.CountNonzero\.time_count_nonzero(?:_axis|_multi_axis)?\([1-3], (?:10000|1000000), ",
102+
r"bench_core\.Nonzero\.time_nonzero(?:_sparse|_dense)?\([^)]*, \((?:1000000,|1000, 1000)\)\)",
103+
r"bench_core\.StatsMethods\.time_(?:max|mean|min|prod|std|sum|var)\('[^']+', 10000\)",
104+
r"bench_indexing\.Indexing\.time_op\('(?:complex64|complex128|object|O,i)'",
105+
r"bench_indexing\.Indexing\.time_op\('[^']+', 'indexes_rand_'",
106+
r"bench_indexing\.Indexing\.time_op\('[^']+', '[^']+', 'np\.ix_\(I, I\)'",
107+
r"bench_indexing\.IndexingWith1DArr\.time_(?:getitem|setitem)_ordered\(\((?:1000, 2|2, 1000, 1|1000, 3)\), ",
108+
r"bench_linalg\.LinAlgTransposeVdot\.time_(?:transpose|vdot)\(\(64, 64\), ",
109+
r"bench_linalg\.MatmulStrided\.time_matmul\('matmul_m(?:150|400)_",
110+
]
111+
84112
DEFAULT_PANDAS_BENCHMARKS = [
85113
"reshape",
86114
"replace"
@@ -199,11 +227,12 @@
199227
]
200228

201229

202-
def create_asv_benchmark_selection(benchmarks, skipped=()):
230+
def create_asv_benchmark_selection(benchmarks, skipped=(), skipped_patterns=()):
203231
regex = '|'.join(benchmarks)
204-
if not skipped:
205-
return regex
206232
negative_lookaheads = [re.escape(skip) + (r'\b' if not skip.endswith(')') else '') for skip in skipped]
233+
negative_lookaheads.extend(skipped_patterns)
234+
if not negative_lookaheads:
235+
return regex
207236
return '^(?!' + '|'.join(negative_lookaheads) + ')(' + regex + ')'
208237

209238

@@ -435,7 +464,7 @@ class PySuite(mx_benchmark.TemporaryWorkdirMixin, mx_benchmark.VmBenchmarkSuite)
435464

436465

437466
class PyPerformanceSuite(PySuite):
438-
VERSION = "1.0.6"
467+
VERSION = "1.14.0"
439468

440469
def name(self):
441470
return "pyperformance-suite"
@@ -600,10 +629,11 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
600629

601630

602631
class NumPySuite(PySuite):
603-
VERSION = "1.26.4"
632+
VERSION = "2.4.4"
604633

605634
BENCHMARK_REQ = [
606635
"asv==0.5.1",
636+
"asv-runner==0.2.1",
607637
f"setuptools=={SETUPTOOLS_PIN}",
608638
"distlib==0.3.6",
609639
"filelock==3.8.0",
@@ -648,13 +678,14 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
648678
shutil.copytree(artifact, npdir)
649679
else:
650680
mx.warn("NUMPY_BENCHMARKS_DIR is not set, cloning numpy repository")
681+
repo_url = os.environ.get("NUMPY_REPO_URL", "https://github.com/numpy/numpy.git")
651682
mx.run(
652683
[
653684
"git",
654685
"clone",
655686
"--depth",
656687
"1",
657-
"https://github.com/numpy/numpy.git",
688+
repo_url,
658689
"--branch",
659690
f"v{self.VERSION}",
660691
"--single-branch",
@@ -691,7 +722,9 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
691722
"--python=same",
692723
"--set-commit-hash",
693724
f"v{self.VERSION}",
694-
"-b", create_asv_benchmark_selection(benchmarks, skipped=SKIPPED_NUMPY_BENCHMARKS),
725+
"-b", create_asv_benchmark_selection(
726+
benchmarks, skipped=SKIPPED_NUMPY_BENCHMARKS, skipped_patterns=SKIPPED_NUMPY_BENCHMARK_PATTERNS
727+
),
695728
],
696729
cwd=benchdir,
697730
nonZeroIsFatal=False,
@@ -708,7 +741,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
708741

709742

710743
class PandasSuite(PySuite):
711-
VERSION = "1.5.2"
744+
VERSION = "3.0.2"
712745
VERSION_TAG = "v" + VERSION
713746

714747
BENCHMARK_REQ = [
@@ -721,6 +754,7 @@ class PandasSuite(PySuite):
721754
"virtualenv==20.16.3",
722755
"packaging==24.0",
723756
"jinja2",
757+
"tzdata==2026.2",
724758
f"numpy=={NumPySuite.VERSION}",
725759
f"pandas=={VERSION}",
726760
]

0 commit comments

Comments
 (0)