-
Notifications
You must be signed in to change notification settings - Fork 53
/
run-cuda-benchmarks.sh
103 lines (77 loc) · 4.43 KB
/
run-cuda-benchmarks.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
# shellcheck disable=SC2103,SC2002
# shellcheck source=/dev/null
# 1.1. Follow the instructions in the comments, then exit and open a connection through the Mosh shell.
#
# IMPORTANT!!!
#
# Switch to the Debian Sid branch by modifying the file "/etc/apt/sources.list", and then upgrade all packages.
# This process will involve updating grub and selecting options on the screen.
# It is necessary because the go binding will not work with outdated libc family packages,
# and the current version of Go is too low to run benchmarks from "go-kzg-4844".
#
# This script is designed to be run once and forgotten about.
#
# 1.2. setup system
# apt -y install htop gcc g++ clang make git mosh golang libgmp-dev llvm python3 python3-pip
# pip install aiogram
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# curl https://nim-lang.org/choosenim/init.sh -sSf | sh
# choosenim 1.6.14
#
# 1.3. setup mosh-server
# locale-gen en_US.UTF-8
# update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
# source /etc/default/locale
SECONDS=0
paste_name="linode_benchmarks"
paste_file="$paste_name.txt"
print_msg () {
printf "\n\n\n~~~~~~~~~~ %s ~~~~~~~~~~\n\n\n" "$1" >> "$2"
}
lscpu >> "$paste_file"
nvidia-smi >> "$paste_file"
# 2. prepare benchmarks
# 2.1. prepare rust-kzg
git clone https://github.com/ArtiomTr/rust-kzg.git
cd rust-kzg || exit
git checkout Integrate_sppark_msm || exit
# 3. run benchmarks
print_msg "rust-kzg with blst backend (parallel, bgmw)" ../"$paste_file"
cargo bench --manifest-path blst/Cargo.toml --bench eip_4844 --no-default-features --features std,rand,parallel,bgmw >> ../"$paste_file"
print_msg "rust-kzg with blst backend (sppark)" ../"$paste_file"
cargo bench --manifest-path blst/Cargo.toml --bench eip_4844 --no-default-features --features std,rand,parallel,sppark >> ../"$paste_file"
print_msg "rust-kzg with arkworks backend (parallel, bgmw)" ../"$paste_file"
cargo bench --manifest-path arkworks/Cargo.toml --bench eip_4844 --no-default-features --features std,rand,parallel,bgmw >> ../"$paste_file"
print_msg "rust-kzg with arkworks3 backend (parallel)" ../"$paste_file"
cargo bench --manifest-path arkworks3/Cargo.toml --bench eip_4844 --no-default-features --features std,rand,parallel >> ../"$paste_file"
print_msg "rust-kzg with arkworks3 backend (sppark)" ../"$paste_file"
cargo bench --manifest-path arkworks3/Cargo.toml --bench eip_4844 --no-default-features --features std,rand,parallel,sppark >> ../"$paste_file"
print_msg "rust-kzg with arkworks3 backend (sppark_wlc)" ../"$paste_file"
cargo bench --manifest-path arkworks3/Cargo.toml --bench eip_4844 --no-default-features --features std,rand,parallel,sppark_wlc >> ../"$paste_file"
point_count=("12" "14" "16" "18" "20")
jobs_count=${#point_count[@]}
for (( i=0; i<jobs_count; i++ ));
do
export BENCH_NPOW="${point_count[$i]}"
print_msg "rust-kzg with blst backend (parallel, bgmw)" ../"$paste_file"
cargo bench --manifest-path blst/Cargo.toml --bench lincomb --no-default-features --features std,rand,parallel,bgmw >> ../"$paste_file"
print_msg "rust-kzg with blst backend (sppark)" ../"$paste_file"
cargo bench --manifest-path blst/Cargo.toml --bench lincomb --no-default-features --features std,rand,parallel,sppark >> ../"$paste_file"
print_msg "rust-kzg with arkworks backend (parallel, bgmw)" ../"$paste_file"
cargo bench --manifest-path arkworks/Cargo.toml --bench lincomb --no-default-features --features std,rand,parallel,bgmw >> ../"$paste_file"
print_msg "rust-kzg with arkworks3 backend (parallel)" ../"$paste_file"
cargo bench --manifest-path arkworks3/Cargo.toml --bench lincomb --no-default-features --features std,rand,parallel >> ../"$paste_file"
print_msg "rust-kzg with arkworks3 backend (sppark)" ../"$paste_file"
cargo bench --manifest-path arkworks3/Cargo.toml --bench lincomb --no-default-features --features std,rand,parallel,sppark >> ../"$paste_file"
print_msg "rust-kzg with arkworks3 backend (sppark_wlc)" ../"$paste_file"
cargo bench --manifest-path arkworks3/Cargo.toml --bench lincomb --no-default-features --features std,rand,parallel,sppark_wlc >> ../"$paste_file"
done
cd ..
# 4. collect results
paste_url=$(curl --upload-file "$paste_file" "https://paste.c-net.org/")
echo "=========================================="
echo "Uploaded to $paste_url"
echo "=========================================="
echo "Script finished in $(printf '%02dh:%02dm:%02ds\n' $((SECONDS/3600)) $((SECONDS%3600/60)) $((SECONDS%60)))"
echo "Success!"