Using zkAsm runner for benchmarks
Use-cases:
- filetests
- benchmarks
- How would the benchmarking pipeline look like after your work?
- How will the workflow of using benchmarking look like for the user?
[2024-04-11 16:07:54] INFO: Use default config {'local': True, 'near_root': '/home/akashin/repos/nearcore/target/debug', 'binary_name': 'neard', 'release': False} | |
[2024-04-11 16:07:54] INFO: Creating LOCAL cluster configuration with 2 nodes | |
[2024-04-11 16:07:54] INFO: Search for stdout and stderr in ['/home/akashin/.near/test0', '/home/akashin/.near/test1'] | |
[2024-04-11 16:07:54] INFO: Starting node 0 as BOOT NODE | |
[2024-04-11 16:07:59] INFO: node 0 started | |
[2024-04-11 16:07:59] INFO: Starting node 1 with --boot-nodes=He7QeRuwizNEhBioYG3u4DZ8jWXyETiyNzFD3MkTjDMf@127.0.0.1:24577 | |
[2024-04-11 16:08:04] INFO: node 1 started | |
{ | |
"jsonrpc": "2.0", | |
"result": { |
0: (1, 0, 0) | |
1: (-1, 0, 0) | |
1: (1, 2, 0) | |
1: (1, 0, 2) | |
2: (-1, -2, 0) | |
2: (-1, 0, -2) | |
2: (3, 2, 0) | |
2: (1, 2, 6) | |
2: (3, 0, 2) | |
2: (1, 6, 2) |
Total opcodes: 292945 | |
Opcode counts: | |
local.get: 71492 | |
i32.const: 48239 | |
i32.add: 23429 | |
local.set: 16986 | |
end: 16427 | |
i32.load: 15149 | |
block: 13453 |
#![no_main] | |
#![no_std] | |
use panic_halt as _; | |
use sha3::{Digest, Keccak256}; | |
extern "C" { | |
fn assert_eq_i64(actual: u64, expected: u64); | |
} |
;; FIXME: Inst::Select([Writable { reg: v350 }], v213, ValueRegs { parts: [v211, v2097151] }, ValueRegs { parts: [v201, v2097151] }, i32) | |
;; FIXME: Inst::Select([Writable { reg: v346 }], v218, ValueRegs { parts: [v214, v2097151] }, ValueRegs { parts: [v215, v2097151] }, i32) | |
;; FIXME: Inst::BrTable(v212, Writable { reg: v358 }, Writable { reg: v359 }, [Label(MachLabel(15)), Label(MachLabel(4)), Label(MachLabel(14)), Label(MachLabel(11)), Label(MachLabel(10)), Label(MachLabel(6)), Label(MachLabel(5))]) | |
;; FIXME: Inst::BrTable(v253, Writable { reg: v349 }, Writable { reg: v350 }, [Label(MachLabel(9)), Label(MachLabel(8)), Label(MachLabel(7))]) | |
;; FIXME: Inst::BrTable(v220, Writable { reg: v292 }, Writable { reg: v293 }, [Label(MachLabel(16)), Label(MachLabel(22)), Label(MachLabel(21)), Label(MachLabel(17)), Label(MachLabel(18)), Label(MachLabel(20)), Label(MachLabel(19))]) | |
;; FIXME: Inst::Select([Writable { reg: v438 }], v205, ValueRegs { parts: [v199, v2097151] }, ValueRegs { parts: [v200, v2097151 |
#!/bin/bash | |
cargo build --target wasm32-unknown-unknown --release | |
mkdir -p out | |
cp target/wasm32-unknown-unknown/release/cranelift-bench.wasm out/mod.wasm | |
cd out | |
wasm-strip mod.wasm | |
wasm2wat mod.wasm > mod.wat |
#![no_main] | |
#![no_std] | |
use panic_halt as _; | |
use sha2::{Digest, Sha256}; | |
extern "C" { | |
fn assert_eq_i64(actual: u64, expected: u64); | |
} |
#![no_main] | |
#![no_std] | |
use panic_halt as _; | |
use sha2::{Sha256, Digest}; | |
extern "C" { | |
fn assert_eq(actual: u64, expected: u64); | |
} |
#![no_main] | |
#![no_std] | |
use panic_halt as _; | |
extern "C" { | |
fn assert_eq(actual: i64, expected: i64); | |
} | |
#[no_mangle] |