From 1fbe836d7ee91933f86d6d7114911988ed6bd603 Mon Sep 17 00:00:00 2001 From: Stephen <81497928+eigmax@users.noreply.github.com> Date: Sun, 21 Apr 2024 13:38:34 +0800 Subject: [PATCH] fix: starky docs (#244) * fix: missing feature * fix: docs --- fields/src/lib.rs | 1 - starky/README.md | 21 +++----------------- starky/src/arch/x86_64/avx2_poseidon_gl.rs | 4 ---- starky/src/arch/x86_64/avx512_poseidon_gl.rs | 4 ---- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/fields/src/lib.rs b/fields/src/lib.rs index a8ff3aef..76de1bc4 100644 --- a/fields/src/lib.rs +++ b/fields/src/lib.rs @@ -1,5 +1,4 @@ #![cfg_attr(feature = "avx512", feature(stdarch_x86_avx512))] -//#![cfg_attr(feature = "avx512", feature(stdsimd))] extern crate rand; pub mod arch; diff --git a/starky/README.md b/starky/README.md index c1084593..ece8af3d 100644 --- a/starky/README.md +++ b/starky/README.md @@ -65,22 +65,6 @@ Merkelization calculates the Merkel proof of a polynomial, where the leaf nodes |24|79| 66.01 |49.9154 | -* Polynomial evaluation - -The evaluation is to calculate by: - -``` -let acc = 0n; // zero on GF(2^3) - -let v be the point to evaluate; -let l be the coefficient vector of the polynomial; -for (let k=0; k<2^nExtBits; k++) { - acc = F.add(acc, F.mul(v, l[k])); -} -``` - -Because the nExtBits reaches up to 24 so this step would be very slow. Consider importing parallel fold from Rayon. - ## Optimization * reimpl pil-stark by Rust @@ -93,17 +77,18 @@ Because the nExtBits reaches up to 24 so this step would be very slow. Consider - [x] Codegen (arithmetization) - [x] Verification hash type > - [x] BN128 +> - [x] BLS12381 > - [x] GL(F64) - [x] Parallel reduce for polynomial evaluation - [x] Recursive FRI -- [x] Poseidon Hash on GPU/Multicore for BN128 +- [x] Poseidon Hash on GPU/Multicore for BN128/BLS12381 ## Profiling ``` cargo bench --bench merklehash -- --profile-time=5 -# or with AVX enabled like this +# or with AVX enabled like this RUSTFLAGS='-C target-feature=+avx512f,+avx512bw,+avx512cd,+avx512dq,+avx512vl' cargo bench --features avx512 -- merklehash RUSTFLAGS="-C target-feature=+avx2" cargo bench -- merklehash diff --git a/starky/src/arch/x86_64/avx2_poseidon_gl.rs b/starky/src/arch/x86_64/avx2_poseidon_gl.rs index cf991fc2..4a5ef106 100644 --- a/starky/src/arch/x86_64/avx2_poseidon_gl.rs +++ b/starky/src/arch/x86_64/avx2_poseidon_gl.rs @@ -436,10 +436,6 @@ impl Poseidon { #[cfg(test)] mod tests { use crate::arch::x86_64::avx2_poseidon_gl::*; - use algebraic::arch::x86_64::avx2_field_gl::Avx2GoldilocksField; - use algebraic::packed::PackedField; - use plonky::field_gl::Fr as FGL; - use plonky::PrimeField; use std::time::{Duration, Instant}; #[test] diff --git a/starky/src/arch/x86_64/avx512_poseidon_gl.rs b/starky/src/arch/x86_64/avx512_poseidon_gl.rs index db86277a..7e8be40c 100644 --- a/starky/src/arch/x86_64/avx512_poseidon_gl.rs +++ b/starky/src/arch/x86_64/avx512_poseidon_gl.rs @@ -465,10 +465,6 @@ impl Poseidon { #[cfg(test)] mod tests { use crate::arch::x86_64::avx512_poseidon_gl::*; - use algebraic::arch::x86_64::avx512_field_gl::Avx512GoldilocksField; - use algebraic::packed::PackedField; - use fields::PrimeField; - use plonky::field_gl::Fr as FGL; use std::time::{Duration, Instant}; #[test]