Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Measure cycles instead of time for benchmarking #632

Merged
merged 36 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c04fee7
cycle numbers coming back
oflatt Oct 9, 2024
ea8b54e
sum-bits working well
oflatt Oct 11, 2024
8a89691
fix asm import and two benchmarks
oflatt Oct 14, 2024
e1be1fc
refactor benchmarks to not have big loops
oflatt Oct 14, 2024
6e7547c
a bunch more cleanup of core benchmarks
oflatt Oct 14, 2024
a1074b9
parallel dot generation
oflatt Oct 14, 2024
6860d57
fix up bril float benchmarks
oflatt Oct 14, 2024
acbc658
depend on new bril commit
oflatt Oct 15, 2024
646ed3a
fix up doitgen
oflatt Oct 15, 2024
592d714
need to fix
oflatt Oct 15, 2024
05c1300
just bril core for now
oflatt Oct 15, 2024
7675b71
fix python import
oflatt Oct 15, 2024
cfa5eb4
move rectangle difference
oflatt Oct 15, 2024
da445ed
move to failing or now
oflatt Oct 15, 2024
022927c
try save and restore rdx
oflatt Oct 15, 2024
5654a6a
fix ticks end as well
oflatt Oct 15, 2024
ed022e0
update some benchmarks
oflatt Oct 15, 2024
1cb4f5b
float benchmarks working
oflatt Oct 15, 2024
25303c8
fix rest of bril benchmarks
oflatt Oct 15, 2024
fd7f506
make tmp defined
oflatt Oct 15, 2024
a8223d2
move function_call to failing
oflatt Oct 15, 2024
3bf38a8
try constant result
oflatt Oct 15, 2024
6545420
oops, need to be diff
oflatt Oct 15, 2024
1f4e2ff
restore old assembly
oflatt Oct 15, 2024
10c624a
hopefully fix bug in tick_counter package
oflatt Oct 15, 2024
d8bedce
try inline always idk
oflatt Oct 15, 2024
120345a
adapt polybench
oflatt Oct 15, 2024
8dc539b
make polybench into tests so they can print
oflatt Oct 15, 2024
e4ba13f
some fixes
oflatt Oct 16, 2024
9cf7893
fix more polybench benchmarks, update nightly.sh
oflatt Oct 16, 2024
5fba165
last polybench benchmark working
oflatt Oct 16, 2024
0fd381f
fmt javascript
oflatt Oct 16, 2024
2120fde
move to slow folder
oflatt Oct 16, 2024
4a7b28e
re-name to -test files
oflatt Oct 16, 2024
781b31f
fix up pow
oflatt Oct 16, 2024
558ca2c
cargo lock
oflatt Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 14 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ smallvec = "1.11.1"

syn = { version = "2.0", features = ["full", "extra-traits"] }
# currently using the uwplse/bril fork of bril, on eggcc-main
bril2json = { git = "https://github.com/uwplse/bril", rev = "e2be3f5d7e160f02b7aed0ef2bcc3e13ae722d2b" }
brilirs = { git = "https://github.com/uwplse/bril", rev = "e2be3f5d7e160f02b7aed0ef2bcc3e13ae722d2b" }
bril-rs = { git = "https://github.com/uwplse/bril", rev = "e2be3f5d7e160f02b7aed0ef2bcc3e13ae722d2b" }
brilift = { git = "https://github.com/uwplse/bril", rev = "e2be3f5d7e160f02b7aed0ef2bcc3e13ae722d2b" }
rs2bril = { git = "https://github.com/uwplse/bril", rev = "e2be3f5d7e160f02b7aed0ef2bcc3e13ae722d2b" ,features = [
bril2json = { git = "https://github.com/uwplse/bril", rev = "fe255deec1533960b20fff832971e45810202a5d" }
brilirs = { git = "https://github.com/uwplse/bril", rev = "fe255deec1533960b20fff832971e45810202a5d" }
bril-rs = { git = "https://github.com/uwplse/bril", rev = "fe255deec1533960b20fff832971e45810202a5d" }
brilift = { git = "https://github.com/uwplse/bril", rev = "fe255deec1533960b20fff832971e45810202a5d" }
rs2bril = { git = "https://github.com/uwplse/bril", rev = "fe255deec1533960b20fff832971e45810202a5d" ,features = [
"import",
] }
brillvm = { git = "https://github.com/uwplse/bril", rev = "e2be3f5d7e160f02b7aed0ef2bcc3e13ae722d2b" }
brillvm = { git = "https://github.com/uwplse/bril", rev = "fe255deec1533960b20fff832971e45810202a5d" }


ordered-float = { version = "3.7" }
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/failing/polybench/_lib.bril
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
store ptr new_val;
}

@matrix_print(mtx: ptr<float>, Nrow: int, Ncol: int) {
@matrix_sum(mtx: ptr<float>, Nrow: int, Ncol: int) {
i: int = const 0;
one: int = const 1;
total: int = mul Nrow Ncol;
Expand Down Expand Up @@ -190,7 +190,7 @@

# EXPECTS:
# @vector_get defined
@vector_print(vec: ptr<float>, N: int) {
@vector_sum(vec: ptr<float>, N: int) {
i: int = const 0;
one: int = const 1;
.while:
Expand Down
29 changes: 6 additions & 23 deletions benchmarks/passing/bril/core/ackermann.bril
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# ARGS: 480
# ARGS: 2 480
# Compute the Ackermann function recursively.
# WARNING: Will quickly exceed stack size

@main(m: int, n: int) {
t: int = call @ack m n;
print t;
}

@ack(m: int, n: int): int {
zero: int = const 0;
one: int = const 1;
Expand All @@ -25,25 +30,3 @@
ret t2;
}

@main(loop_bound: int) {
loop_incr: int = const 1;
loop_counter: int = const 10;
final_output: int = const 0;
.loop_cond:
loop_cond: bool = lt loop_counter loop_bound;
br loop_cond .loop_body .loop_done;
.loop_body:
output: int = call @orig_main loop_counter;
final_output: int = add final_output output;
loop_counter: int = add loop_counter loop_incr;
jmp .loop_cond;
.loop_done:
print final_output;
}

@orig_main(n: int): int {
m: int = const 2;
tmp: int = call @ack m n;
ret tmp;
}

25 changes: 3 additions & 22 deletions benchmarks/passing/bril/core/armstrong.bril
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
# ARGS: 2200000
@main(loop_bound: int) {
loop_incr: int = const 1;
loop_counter: int = const 10;
final_output: int = const 0;
.loop_cond:
loop_cond: bool = lt loop_counter loop_bound;
br loop_cond .loop_body .loop_done;
.loop_body:
output: bool = call @orig_main loop_counter;
br output .output_incr .skip;
.output_incr:
final_output: int = add final_output loop_incr;
.skip:
loop_counter: int = add loop_counter loop_incr;
jmp .loop_cond;
.loop_done:
print final_output;
}

@orig_main(input : int): bool {
# ARGS: 220001000
@main(input : int) {
zero : int = const 0;
ten : int = const 10;
sum : int = const 0;
Expand All @@ -35,7 +16,7 @@
jmp .loop;
.done:
res : bool = eq input sum;
ret res;
print res;
}

@getDigits(n : int) : int {
Expand Down
22 changes: 3 additions & 19 deletions benchmarks/passing/bril/core/binary-fmt.bril
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
# ARGS: 3500000
@main(loop_bound: int) {
loop_incr: int = const 1;
loop_counter: int = const 10;
final_output: int = const 1;
.loop_cond:
loop_cond: bool = lt loop_counter loop_bound;
br loop_cond .loop_body .loop_done;
.loop_body:
output: int = call @orig_main loop_counter;
final_output: int = add final_output output;
loop_counter: int = add loop_counter loop_incr;
jmp .loop_cond;
.loop_done:
print final_output;
}

@orig_main(n : int): int {
# ARGS: 3501010
@main(n : int) {
zero: int = const 0;
output: int = call @printBinary n zero;
ret output;
print output;
}

@printBinary(n: int, sum: int): int {
Expand Down
20 changes: 2 additions & 18 deletions benchmarks/passing/bril/core/birthday.bril
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
# ARGS: 9500
@main(loop_bound: float) {
loop_incr: float = const 1;
loop_counter: float = const 10;
final_output: float = const 0.0;
.loop_cond:
loop_cond: bool = flt loop_counter loop_bound;
br loop_cond .loop_body .loop_done;
.loop_body:
output: float = call @orig_main loop_counter;
final_output: float = fadd final_output output;
loop_counter: float = fadd loop_counter loop_incr;
jmp .loop_cond;
.loop_done:
print final_output;
}

@orig_main(n: float): float {
@main(n: float) {
v0: float = id n;
c: float = call @probability v0;
c: float = id c;
v1: float = id c;
v2: int = const 0;
ret v1;
print v1;
}
@probability(n: float): float {
v0: float = const 1;
Expand Down
45 changes: 3 additions & 42 deletions benchmarks/passing/bril/core/bitshift.bril
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ARGS: 61
# ARGS: 4371 5 343234 2

@pow(x: int, n: int): int {
v1: int = id n;
Expand Down Expand Up @@ -68,53 +68,14 @@
v4: int = div v2 v3;
ret v4;
}
@main(loop_bound: int) {
loop_incr: int = const 1;
loop_counter: int = const 10;
final_output: int = const 0;
.loop_cond:
loop_cond: bool = lt loop_counter loop_bound;
br loop_cond .loop_body .loop_done;
.loop_body:
loop2_counter: int = const 10;
.loop2_cond:
loop2_cond: bool = lt loop2_counter loop_bound;
br loop2_cond .loop2_body .loop2_done;
.loop2_body:
loop3_counter: int = const 10;
.loop3_cond:
loop3_cond: bool = lt loop3_counter loop_bound;
br loop3_cond .loop3_body .loop3_done;
.loop3_body:
loop4_counter: int = const 10;
.loop4_cond:
loop4_cond: bool = lt loop4_counter loop_bound;
br loop4_cond .loop4_body .loop4_done;
.loop4_body:
output: int = call @orig_main loop_counter loop2_counter loop3_counter loop4_counter;
final_output: int = add final_output output;
loop4_counter: int = add loop4_counter loop_incr;
jmp .loop4_cond;
.loop4_done:
loop3_counter: int = add loop3_counter loop_incr;
jmp .loop3_cond;
.loop3_done:
loop2_counter: int = add loop2_counter loop_incr;
jmp .loop2_cond;
.loop2_done:
loop_counter: int = add loop_counter loop_incr;
jmp .loop_cond;
.loop_done:
print final_output;
}

@orig_main (a : int, b: int, c: int, d : int): int {
@main (a : int, b: int, c: int, d : int) {
v2: int = id a;
v3: int = id b;
ans1: int = call @LEFTSHIFT v2 v3;
v4: int = id c;
v5: int = id d;
ans2: int = call @RIGHTSHIFT v4 v5;
output: int = add ans1 ans2;
ret output;
print output;
}
38 changes: 3 additions & 35 deletions benchmarks/passing/bril/core/bitwise-ops.bril
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ARGS: 84
# ARGS: 823324 2313 9000

# Bitwise Operator Library
# Supports AND, OR, XOR. 0 for and, 1 for OR, 2+ for XOR
Expand Down Expand Up @@ -67,39 +67,7 @@
ret ans;
}

@main(loop_bound: int) {
loop_incr: int = const 1;
loop_counter: int = const 10;
final_output: int = const 0;
.loop_cond:
loop_cond: bool = lt loop_counter loop_bound;
br loop_cond .loop_body .loop_done;
.loop_body:
loop2_counter: int = const 10;
.loop2_cond:
loop2_cond: bool = lt loop2_counter loop_bound;
br loop2_cond .loop2_body .loop2_done;
.loop2_body:
loop3_counter: int = const 10;
.loop3_cond:
loop3_cond: bool = lt loop3_counter loop_bound;
br loop3_cond .loop3_body .loop3_done;
.loop3_body:
output: int = call @orig_main loop_counter loop2_counter loop3_counter;
final_output: int = add final_output output;
loop3_counter: int = add loop3_counter loop_incr;
jmp .loop3_cond;
.loop3_done:
loop2_counter: int = add loop2_counter loop_incr;
jmp .loop2_cond;
.loop2_done:
loop_counter: int = add loop_counter loop_incr;
jmp .loop_cond;
.loop_done:
print final_output;
}

@orig_main (a : int, b: int, c: int): int {
@main (a : int, b: int, c: int) {
one: int = const 1;
zero: int = const 0;

Expand All @@ -124,5 +92,5 @@
.xor_op:
ans: int = call @XOR a b;
.end:
ret ans;
print ans;
}
Loading
Loading