Skip to content

jagged sumcheck #1289

@kunxian-xia

Description

@kunxian-xia

main idea

This sumcheck is used to reduce the evaluations $v_i = p_i(r)$ to a single evaluation of $q = \textrm{concat}(p_0, \ldots, p_N)$ at point $(r, z_c)$.

To be more specific, the sumcheck has the following form $v = \sum_i eq(z_c, i)*v_i = \sum_b q(b) * f(b)$ where

$$f(b) = \textrm{eq}(r, \textrm{row}(b)) * \textrm{eq}(z_c, \textrm{col}(b)).$$

The linear space algorithm (VSBW13) we use in crate sumcheck needs to have dense representation of $q(x) \in F, f(x) \in E$. In the case that $q(x)$ has around 31 variables, it's impossible to fit $f(x)$ in 24G GPU VRAM (which requires 32G).

The main constraint: $f(b)$ is too large to materialize in memory. We can only treat it as an oracle.

BlendySC

Fortunately the blendy paper perfectly solves this problem.

  • we currently use the linear time algorithm VSBW13 (with linear space).
  • try the blendy algorithm with $k = 2$ which runs in $O(k*N)$ and takes $O(\sqrt{N})$ space (see the blendy paper)

We describes blendy algorithm for $k = 2$ below.

  1. The prover runs in 2 stages (each stage has $n/2$ rounds).

  2. In the stage 1, for round $j < n/2$, the prover needs to output $h_j(x) = \sum_b p(R_j, x, b)$ where $p(b) = f(b)*g(b)$, $R_j = (r_1, \ldots, r_{j-1})$.
    a. We can unroll the above expression to $h_j(x) = \sum_B \textrm{eq}([R_j, x], B[..j]) * p(B)$;

    b. If we split $B$ into three parts $B = (a, c, d)$ with $|a| = j, |b| = n/2 - j, |c| = n/2$), then above expression becomes $h_j(x) = \sum_{a, b} \textrm{eq}([R_j, x], a) * \sum_c p(a, b, c)$.

    c. If we condense/accumulate $p(a, b, c)$ that shares same $(a,b)$, we get a new function $\text{Aux} (a, b) = \sum_c p(a, b, c)$;

    d. Then the expression in step b becomes $h_j(x) = \sum_{a} \textrm{eq}([R_j, x], a) * \sum_b \text{Aux}(a, b) = \sum_b \text{Aux}(R_j, x, b)$;

    e. from the expression in step d, this directly translates to run VSBW13 sumcheck prover for function $\text{Aux}(a,b)$ with expected sum equals to $v$.

  3. At the end of stage 2, the sumcheck reduce the original sumcheck to the validity of $\text{Aux}(r_1, \ldots, r_{n/2}) = \sum_c p(r_1, \ldots, r_{n/2}, c)$, then in stage 2, we just run another VSBW13 sumcheck prover for the function $p(r_1, \ldots, r_{n/2}, c)$ with expected sum equals to $\text{Aux}(r_1, \ldots, r_{n/2})$.

We can move one step further, by allowing the number of rounds in stage 1 to be configurable.

Implementation details

  1. By definition, $\text{Aux}(b) = \sum_c p(b, c) = \sum_c g(b, c) * f(b, c)$;
  2. For each c, we have $p(r_1, \ldots, r_{n/2}, c) = \sum_b \textrm{eq}([r_1, \ldots, r_{n/2}], b) * p(b, c)$.

It's easy to see the oracle for $f(b, c)$ is queried twice for each point.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions