forked from yetanotherco/zkvm_benchmarks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
128 lines (93 loc) · 3.93 KB
/
Makefile
File metadata and controls
128 lines (93 loc) · 3.93 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
.PHONY: build_elf_fibo_pico build_fibo_pico build_fibo_sp1 build_fibo_risc0
.PHONY: build_elf_keccak_pico build_keccak_pico build_keccak_sp1 build_keccak_risc0
.PHONY: fibo_pico_wrapped fibo_sp1 fibo_risc0
.PHONY: keccak_pico keccak_sp1 keccak_risc0
.PHONY: build_rsp_sp1 rsp_sp1
.PHONY: build_rsp_risc0 build_rsp_risc0_cuda rsp_risc0 rsp_risc0_cuda
.PHONY: run_plotter create_python_venv install_requirements export_notebook
# PROOF_MODE ONLY USED FOR SP1
PROOF_MODE ?= compressed
# SAVE_PROOF ONLY USED FOR SP1
SAVE_PROOF ?= false
# Iterations of fibonacci
N ?= 100000
# action_function_proving-system
# Pico is the only prover which doesn't
# build ELF elf automatically if it's no thee
build_elf_fibo_pico:
cd fibonacci/pico/app && cargo pico build
build_elf_keccak_pico:
cd keccak/pico/app && cargo pico build
build_fibo_pico:
cd fibonacci/pico/prover && cargo build --release
build_keccak_pico:
cd keccak/pico/prover && cargo build --release
build_fibo_sp1:
cd fibonacci/sp1/script && cargo build --release
build_keccak_sp1:
cd keccak/sp1/script && cargo build --release
build_rsp_sp1:
cd rsp/sp1/script && cargo build --release
build_fibo_risc0:
cd fibonacci/risc0/host && cargo build --release
build_fibo_risc0_cuda:
cd fibonacci/risc0/host && cargo build --release -F cuda
build_keccak_risc0:
cd keccak/risc0/host && cargo build --release
build_keccak_risc0_cuda:
cd keccak/risc0/host && cargo build --release -F cuda
build_rsp_risc0:
cd rsp/risc0/host && RISC0_FEATURE_bigint2=1 cargo build --release
build_rsp_risc0_cuda:
cd rsp/risc0/host && RISC0_FEATURE_bigint2=1 cargo build --release -F cuda
fibo_pico_wrapped:
./fibonacci/pico/target/release/prover $(N)
keccak_pico:
./keccak/pico/target/release/prover $(N)
fibo_sp1:
./fibonacci/sp1/target/release/fibonacci $(N) $(PROOF_MODE)
keccak_sp1:
./keccak/sp1/target/release/prover $(N) $(PROOF_MODE)
rsp_sp1:
./rsp/sp1/target/release/prover block_data/$(BLOCK_MEGAGAS)M.bin $(PROOF_MODE) $(SAVE_PROOF)
fibo_risc0:
RUST_LOG=info RISC0_INFO=1 ./fibonacci/risc0/target/release/host $(N)
fibo_risc0_cuda:
RUSTFLAGS="-C target-cpu=native" RUST_LOG=info RISC0_INFO=1 ./fibonacci/risc0/target/release/host $(N)
keccak_risc0:
RUST_LOG=info RISC0_INFO=1 RISC0_KECCAK_PO2=18 ./keccak/risc0/target/release/host $(N)
keccak_risc0_cuda:
RUSTFLAGS="-C target-cpu=native" RUST_LOG=info RISC0_INFO=1 RISC0_KECCAK_PO2=18 ./keccak/risc0/target/release/host $(N)
rsp_risc0:
RUST_LOG=info RISC0_INFO=1 ./rsp/risc0/host/target/release/host block_data/$(BLOCK_MEGAGAS)M.bin
rsp_risc0_cuda:
RUSTFLAGS="-C target-cpu=native" RUST_LOG=info RISC0_INFO=1 ./rsp/risc0/host/target/release/host block_data/$(BLOCK_MEGAGAS)M.bin
run_plotter_fibo: INPUT_FILE=benchmark_fibo_results.csv
run_plotter_fibo: X_LABEL="Fibonacci N"
run_plotter_fibo: FUNCTION="Fibonacci"
run_plotter_fibo: run_plotter
run_plotter_keccak: INPUT_FILE=benchmark_keccak_results.csv
run_plotter_keccak: X_LABEL="Vec of Length N bytes"
run_plotter_keccak: FUNCTION="Keccak"
run_plotter_keccak: run_plotter
run_plotter_cuda: INPUT_FILE=benchmark_cuda_results.csv
run_plotter_cuda: X_LABEL="Block Size (Megagas)"
run_plotter_cuda: FUNCTION="RSP"
run_plotter_cuda: LINEAR=1
run_plotter_cuda: REGRESSION=1
run_plotter_cuda: run_plotter
run_plotter:
@echo "Running plotter$(if $(LINEAR), with linear option)..."
@python3 plotter.py $(INPUT_FILE) $(X_LABEL) $(FUNCTION) $(if $(LINEAR),--linear) $(if $(REGRESSION),--regression)
create_python_venv:
@echo "Creating virtual environment..."
@python3 -m venv venv
@echo "Virtual environment created successfully on 'venv' directory!"
install_requirements:
@echo "Installing dependencies..."
@pip install -r requirements.txt
export_notebook:
@echo "Exporting notebook to HTML..."
@jupyter nbconvert --to html benchmark.ipynb --output index --HTMLExporter.theme=dark --no-input
@sed -i '' 's/<title>.*<\/title>/<title>zkVM Benchmarks<\/title>/' index.html
@echo "Notebook exported successfully to 'index.html'!"