Skip to content

Commit f64806e

Browse files
axel22Andrija Kolic
authored andcommitted
[GR-70656] Port 14 GraalPy micro benchmarks to Polybench, add initial parameters, and add stable run config JSON file
PullRequest: graalpython/4043
2 parents 20e0ab1 + c122d88 commit f64806e

17 files changed

+510
-20
lines changed

ci/graal/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
55
],
66

7-
"mx_version": "7.64.2",
7+
"mx_version": "7.67.0",
88

99
"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
1010
"jdks": {

graalpython/com.oracle.graal.python.benchmarks/python/micro/arith-binop.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, 2024, Oracle and/or its affiliates.
1+
# Copyright (c) 2017, 2025, Oracle and/or its affiliates.
22
# Copyright (c) 2013, Regents of the University of California
33
#
44
# All rights reserved.
@@ -35,17 +35,37 @@ def docompute(num):
3535
return sum_
3636

3737

38-
def measure(num):
38+
def measure(num, length):
3939
sum_ = 0
4040
for run in range(num):
41-
sum_ += docompute(10000) # 10000
41+
sum_ += docompute(length) # 10000
4242
return sum_
4343

4444

45-
def __benchmark__(num=5):
46-
return measure(num)
45+
def __benchmark__(num=5, length=10000):
46+
return measure(num, length)
4747

4848

4949
def __teardown__():
5050
# teardown example
5151
print("arith-binop teardown")
52+
53+
54+
def run():
55+
__benchmark__(num=1, length=2000)
56+
57+
58+
def warmupIterations():
59+
return 10
60+
61+
62+
def iterations():
63+
return 25
64+
65+
66+
def summary():
67+
return {
68+
"name": "OutlierRemovalAverageSummary",
69+
"lower-threshold": 0.0,
70+
"upper-threshold": 0.3,
71+
}

graalpython/com.oracle.graal.python.benchmarks/python/micro/arith-modulo-sized.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, 2024, Oracle and/or its affiliates.
1+
# Copyright (c) 2017, 2025, Oracle and/or its affiliates.
22
# Copyright (c) 2013, Regents of the University of California
33
#
44
# All rights reserved.
@@ -51,3 +51,19 @@ def measure(num):
5151

5252
def __benchmark__(num=50):
5353
return measure(num)
54+
55+
56+
def run():
57+
__benchmark__(num=1)
58+
59+
60+
def warmupIterations():
61+
return 20
62+
63+
64+
def summary():
65+
return {
66+
"name": "OutlierRemovalAverageSummary",
67+
"lower-threshold": 0.0,
68+
"upper-threshold": 0.3,
69+
}

graalpython/com.oracle.graal.python.benchmarks/python/micro/attribute-access-polymorphic.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, 2024, Oracle and/or its affiliates.
1+
# Copyright (c) 2017, 2025, Oracle and/or its affiliates.
22
# Copyright (c) 2013, Regents of the University of California
33
#
44
# All rights reserved.
@@ -82,3 +82,19 @@ def measure(num):
8282

8383
def __benchmark__(num=1000):
8484
return measure(num)
85+
86+
87+
def run():
88+
__benchmark__(num=10)
89+
90+
91+
def warmupIterations():
92+
return 10
93+
94+
95+
def summary():
96+
return {
97+
"name": "OutlierRemovalAverageSummary",
98+
"lower-threshold": 0.1,
99+
"upper-threshold": 0.7,
100+
}

graalpython/com.oracle.graal.python.benchmarks/python/micro/attribute-access-super.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -84,3 +84,19 @@ def measure(num):
8484

8585
def __benchmark__(num=5000):
8686
return measure(num)
87+
88+
89+
def run():
90+
__benchmark__(10)
91+
92+
93+
def warmupIterations():
94+
return 10
95+
96+
97+
def summary():
98+
return {
99+
"name": "OutlierRemovalAverageSummary",
100+
"lower-threshold": 0.0,
101+
"upper-threshold": 0.4,
102+
}

graalpython/com.oracle.graal.python.benchmarks/python/micro/attribute-access.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, 2024, Oracle and/or its affiliates.
1+
# Copyright (c) 2017, 2025, Oracle and/or its affiliates.
22
# Copyright (c) 2013, Regents of the University of California
33
#
44
# All rights reserved.
@@ -50,3 +50,15 @@ def measure(num):
5050

5151
def __benchmark__(num=5000):
5252
return measure(num)
53+
54+
55+
def run():
56+
__benchmark__(num=50)
57+
58+
59+
def summary():
60+
return {
61+
"name": "OutlierRemovalAverageSummary",
62+
"lower-threshold": 0.0,
63+
"upper-threshold": 0.3,
64+
}

graalpython/com.oracle.graal.python.benchmarks/python/micro/attribute-bool.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, 2024, Oracle and/or its affiliates.
1+
# Copyright (c) 2017, 2025, Oracle and/or its affiliates.
22
# Copyright (c) 2013, Regents of the University of California
33
#
44
# All rights reserved.
@@ -75,3 +75,23 @@ def measure(num):
7575

7676
def __benchmark__(num=3000):
7777
return measure(num)
78+
79+
80+
def run():
81+
__benchmark__(num=2)
82+
83+
84+
def warmupIterations():
85+
return 5
86+
87+
88+
def iterations():
89+
return 10
90+
91+
92+
def summary():
93+
return {
94+
"name": "OutlierRemovalAverageSummary",
95+
"lower-threshold": 0.1,
96+
"upper-threshold": 0.3,
97+
}

graalpython/com.oracle.graal.python.benchmarks/python/micro/boolean-logic-sized.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, 2024, Oracle and/or its affiliates.
1+
# Copyright (c) 2017, 2025, Oracle and/or its affiliates.
22
# Copyright (c) 2013, Regents of the University of California
33
#
44
# All rights reserved.
@@ -94,3 +94,23 @@ def measure(num):
9494

9595
def __benchmark__(num=1000):
9696
return measure(num)
97+
98+
99+
def run():
100+
return __benchmark__(num=5)
101+
102+
103+
def warmupIterations():
104+
return 16
105+
106+
107+
def iterations():
108+
return 20
109+
110+
111+
def summary():
112+
return {
113+
"name": "OutlierRemovalAverageSummary",
114+
"lower-threshold": 0.1,
115+
"upper-threshold": 0.4,
116+
}

graalpython/com.oracle.graal.python.benchmarks/python/micro/builtin-len-tuple-sized.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, 2024, Oracle and/or its affiliates.
1+
# Copyright (c) 2017, 2025, Oracle and/or its affiliates.
22
# Copyright (c) 2013, Regents of the University of California
33
#
44
# All rights reserved.
@@ -41,3 +41,23 @@ def measure(num):
4141

4242
def __benchmark__(num):
4343
return measure(num)
44+
45+
46+
def run():
47+
__benchmark__(1000000)
48+
49+
50+
def warmupIterations():
51+
return 32
52+
53+
54+
def iterations():
55+
return 32
56+
57+
58+
def summary():
59+
return {
60+
"name": "OutlierRemovalAverageSummary",
61+
"lower-threshold": 0.1,
62+
"upper-threshold": 0.5,
63+
}

graalpython/com.oracle.graal.python.benchmarks/python/micro/builtin-len.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, 2024, Oracle and/or its affiliates.
1+
# Copyright (c) 2017, 2025, Oracle and/or its affiliates.
22
# Copyright (c) 2013, Regents of the University of California
33
#
44
# All rights reserved.
@@ -43,3 +43,23 @@ def measure(num=500000000):
4343

4444
def __benchmark__(*args):
4545
return measure(*args)
46+
47+
48+
def run():
49+
__benchmark__(5000000)
50+
51+
52+
def warmupIterations():
53+
return 10
54+
55+
56+
def iterations():
57+
return 20
58+
59+
60+
def summary():
61+
return {
62+
"name": "OutlierRemovalAverageSummary",
63+
"lower-threshold": 0.1,
64+
"upper-threshold": 0.9,
65+
}

0 commit comments

Comments
 (0)