Skip to content

Commit

Permalink
Merge pull request #151 from ewasm/scout-wamr
Browse files Browse the repository at this point in the history
add scout_wamr.c to scout engines
  • Loading branch information
jwasinger authored Aug 14, 2020
2 parents 5d93841 + 8002b09 commit f1ed847
Show file tree
Hide file tree
Showing 39 changed files with 563 additions and 492 deletions.
1,000 changes: 510 additions & 490 deletions benchmark_results_data/scout_bignum_benchmarks.csv

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bignums-bls12-pairings-rust-vs-wasm-total-time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bignums-rollup-rs-bn128-pairings-all-combos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bignums-rollup-rs-bn128-pairings-superops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bignums-rollup-rs-bn128-pairings-wabt-with-bignums.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bignums-rollup-rs-bn128-pairings-with-vs-without-bignums.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bignums-websnark-bn128-pairings-fasthost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bignums-websnark-bn128-pairings-fastmont.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bignums-websnark-bn128-pairings-startup-and-execution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bignums-websnark-bn128-pairings-superops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bignums-websnark-bn128-pairings-v8-with-bignums.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bignums-zkrollup-rust-vs-websnark-bn128-pairings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/evm384-bls12-pairings-synth-loop-rust-wasm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/evm384-bls12-synth-loop-vs-native-rust.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/evm384-bls12-synth-loop-vs-pairings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/evm384-bls12-synth-loop-wasm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/evm384-wasm-native-pairings-and-synth-loop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/evm384-wasm-native-pairings-vs-adjusted-synth-loop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/scout-biturbo-token-all-engines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/scout-biturbo-token-compilers-vs-interpreters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/scout-daiquiri-all-engines.png
Binary file modified images/scout-daiquiri-v8-vs-wabt.png
Binary file modified images/scout-ecpairing-zkrollup-rust-wasm-bn128-two-pairings-v8.png
Binary file modified images/scout-ecpairing-zkrollup-websnark-bn128-two-pairings-v8.png
Binary file modified images/websnark-vs-native-bn128-two-pairings-v8.png
Binary file modified images/websnark-vs-rust-wasm-native-zkrollup-bn128-pairings.png
7 changes: 6 additions & 1 deletion notebooks/wasm-engines.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5956,6 +5956,7 @@
"outputs": [],
"source": [
"\n",
"# test to make sure that scout wasm3 data is present\n",
"test_scout_wasm3_plot = plotOneTestColoredTicks(df_scout_data[df_scout_data['engine'].isin(['wasm3-with-bignums'])],)\n"
]
},
Expand All @@ -5964,7 +5965,11 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"\n",
"# test to make sure that scout_wamr.c data is present\n",
"test_scout_wasm3_plot = plotOneTestColoredTicks(df_scout_data[df_scout_data['engine'].isin(['wasm3-with-bignums'])],)\n"
]
},
{
"cell_type": "code",
Expand Down
11 changes: 10 additions & 1 deletion scout-engines/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,18 @@ RUN git clone --single-branch --branch dev https://github.com/jwasinger/eip1962-
RUN cd eip1962-bls12-rs-native && git submodule update --init
RUN cd eip1962-bls12-rs-native && cargo build --release

WORKDIR /engines

# install scout-wamr
RUN git clone https://github.com/ewasm-benchmarking/scout_wamr.c -b bls12-test-cases && \
cd scout_wamr.c && \
git submodule update --init && \
mkdir build && \
cd build && \
cmake .. && \
make -j4

# install fizzy
WORKDIR /engines

# fizzy for bls12 using host funcs
RUN git clone --single-branch --branch v0.3.0-ewasm-bench-bls12 https://github.com/ewasm-benchmarking/fizzy.git fizzy-bls12-hostfuncs && \
Expand Down
37 changes: 37 additions & 0 deletions scout-engines/scout_bignum_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@
}
]

WAMR_BENCH_INFOS = [
{
'bench_name': 'bls12-wasmsnark-synth-loop',
'engine_path': '/engines/scout_wamr.c/build/scout.exec',
'engine_name': 'wamr-with-bignums',
'scout_yml_path': '/engines/scout_wamr.c/bls12-synth-loop.yaml',
},
{
'bench_name': 'bls12-wasmsnark-two-pairings-standalone',
'engine_path': '/engines/scout_wamr.c/build/scout.exec',
'engine_name': 'wamr-with-bignums',
'scout_yml_path': '/engines/scout_wamr.c/bls12-two-pairings-standalone.yaml',
}
]

FIZZY_BENCH_INFOS = [
{
Expand Down Expand Up @@ -641,8 +655,25 @@ def do_v8_bench(scoutts_cmd, scoutts_working_dir):
exec_time = exec_time_seconds + exec_time_milliseconds
return { 'exec_time': exec_time.total_seconds(), 'parse_time': parse_time.total_seconds() }

def do_wamr_bench(wamr_bench_info):
wamr_cmd = [wamr_bench_info['engine_path'], wamr_bench_info['scout_yml_path']]
stdoutlines = []
wamr_working_dir = os.path.dirname(wamr_bench_info['scout_yml_path'])

with subprocess.Popen(wamr_cmd, cwd=wamr_working_dir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1, universal_newlines=True) as p:
for line in p.stdout: # b'\n'-separated lines
print(line, end='')
stdoutlines.append(line) # pass bytes as is
p.wait()

parse_time_regex = 'startup time: (.*)\n'
execution_time_regex = 'execution time: (.*)\n'
parse_time_match = re.search(parse_time_regex, stdoutlines[0])[1]
execution_time_match = re.search(execution_time_regex, stdoutlines[2])[1]
return {'engine': wamr_bench_info['engine_name'],
'bench_name': wamr_bench_info['bench_name'],
'parse_time': float(parse_time_match),
'exec_time': float(execution_time_match)}

"""
root@1152c9d9157f:/engines/scout.ts-bn128# /engines/scout-cpp-bn128/build/scout.exec bn128pairing_bignums.yaml
Expand Down Expand Up @@ -994,6 +1025,12 @@ def main():
scout_benchmarks.append(wasm3_record)
print("got fizzy result:", wasm3_record)

# run 10 iterations of scout_wamr.c

for i in range(10):
for bench_to_run in WAMR_BENCH_INFOS:
scout_benchmarks.append(do_wamr_bench(bench_to_run))

# run 10 iterations of rust-native
for i in range(0, 10):
print("\ndoing rust-native bench run i=",i)
Expand Down

0 comments on commit f1ed847

Please sign in to comment.