The PineValidNormEquality circuit uses the Mul gadget to square each element of the encoded gradient, i.e., Mul(x, x) = x^2. We could instead use PolyEval to square each x, which reduces the arity of gadget by a factor of 2. This pays off especially when we use ParallelSum, as the arity counts against the size of the proof and verifier.
In Daphne's benchmarks, this improves prove time 14% and query time by 50% after re-tuning the chunk length so that the proof and verifier are as large as before. (We see a more modest improvement with a smaller chunk length.) This equates in a 3% improvement in shard time and a 5% improvement in prep time.
Based on #96 (merge that first).
The
PineValidNormEquality
circuit uses theMul
gadget to square each element of the encoded gradient, i.e.,Mul(x, x) = x^2
. We could instead usePolyEval
to square eachx
, which reduces the arity of gadget by a factor of 2. This pays off especially when we useParallelSum
, as the arity counts against the size of the proof and verifier.In Daphne's benchmarks, this improves prove time 14% and query time by 50% after re-tuning the chunk length so that the proof and verifier are as large as before. (We see a more modest improvement with a smaller chunk length.) This equates in a 3% improvement in shard time and a 5% improvement in prep time.