microsoft / Spartan

Spartan: High-speed zkSNARKs without trusted setup
MIT License
672 stars 112 forks source link

The fine-grained profiler and benches only prints proof_compressed_len #28

Closed 29988122 closed 3 years ago

29988122 commented 3 years ago

I was not running

RUSTFLAGS="-C target_cpu=native" cargo bench

command directly, cause I cross-compiled this on my powerful machine, and I tested it on raspberry pi.

I removed the "simd_backend" feature argument in Cargo.toml. Then it successfully compiled via

cross build --target aarch64-unknown-linux-gnu --release
cross build --target aarch64-unknown-linux-gnu --benches

without error.

Then I copied /target/release/nizk snark (fine grained profiler), /target/debug/nizk snark(plot drawing benches) to my raspberry pi.

However, after execution, It only shows something like

user@localhost:~/aarch64-unknown-linux-gnu/release$ ./snark
Profiler:: SNARK
  * SNARK::proof_compressed_len 32012

  * SNARK::proof_compressed_len 36824

  * SNARK::proof_compressed_len 41696

  * SNARK::proof_compressed_len 47935

  * SNARK::proof_compressed_len 54218

  * SNARK::proof_compressed_len 62994

  * SNARK::proof_compressed_len 71696

  * SNARK::proof_compressed_len 84932

  * SNARK::proof_compressed_len 98174

  * SNARK::proof_compressed_len 120041

  * SNARK::proof_compressed_len 141788

And nothing else.

Despite the binaries are different in sizes, aarch64-unknown-linux-gnu/debug/snark yieled the same result, not drawing plots as it should.

Am I doing it wrong? How do I compile the profiler and make it run on aarch64 correctly? Thanks!

srinathsetty commented 3 years ago

Yes, please pass the following argument to cargo build (https://github.com/microsoft/Spartan#supported-features):

--features “profile”