scroll-tech / ceno

Accelerate Zero-knowledge Virtual Machine by Non-uniform Prover Based on GKR Protocol
Apache License 2.0
57 stars 7 forks source link

[experiment] more tracing span to identify mpcs latency breakdown on flamegraph #568

Open hero78119 opened 2 weeks ago

hero78119 commented 2 weeks ago

This PR just add tracing span to measure the mpcs break down and visualized in flamegraph

Also attachmented framegraph (its svg file and please download it local then open in browser which allow iteractive navigating) flamegraph

The bottleneck part probably not on sumcheck, and instead it's from compute_inner_ext and root_from_inner operation https://github.com/scroll-tech/ceno/blob/a756f466f7086bf5b204bff7afbf175c648050da/mpcs/src/basefold/commit_phase.rs#L458-L461

hero78119 commented 2 weeks ago

related to https://github.com/scroll-tech/ceno/pull/568

hero78119 commented 2 weeks ago

More added on: the latency breakdown

So optimize mpcs at current stage will be more huge gain.

In another follow up https://github.com/scroll-tech/ceno/issues/537#issuecomment-2453364815 the improvement only <15% overall is because it only affect opcode proof sumcheck part. mpcs got another sumcheck implementation and we plan to merge it in issue https://github.com/scroll-tech/ceno/issues/558

In overall, as mpcs occupied more time (til 7 Nov '24), any improvement on mpcs will have better impact on overall throuput.