Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More experiments for improving performance (WIP) #1617

Draft
wants to merge 57 commits into
base: matthias/memory-opt-more/paralleler
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
7c557d3
Use workspace dependencies
matthiasgoergens Apr 22, 2024
e140e28
No more looked tables
matthiasgoergens Apr 22, 2024
defbda8
Fix extraction
matthiasgoergens Apr 22, 2024
8e00e78
More extraction
matthiasgoergens Apr 22, 2024
79d587d
Ignore rangecheck, too
matthiasgoergens Apr 22, 2024
3495e6c
Fix warning
matthiasgoergens Apr 22, 2024
8f5642b
Merge branch 'matthias/use-workspace-deps' into matthias/ctl/use-upst…
matthiasgoergens Apr 22, 2024
b8e88ba
Use my hacked up prototype plonky2
matthiasgoergens Apr 22, 2024
642d3b9
Radical surgery to remove public sub table mechanism (temporarily)
matthiasgoergens Apr 22, 2024
a00b344
Update example's Cargo.lock for some reason
matthiasgoergens Apr 22, 2024
fae398f
Clean up
matthiasgoergens Apr 22, 2024
383e914
Use upstream, pre
matthiasgoergens Apr 22, 2024
dd6f0fd
Merge remote-tracking branch 'origin/main' into matthias/ctl/use-upst…
matthiasgoergens Apr 23, 2024
ba4240f
Update
matthiasgoergens Apr 23, 2024
3f35bc0
Match starky
matthiasgoergens Apr 23, 2024
cfeeb43
Use upstream
matthiasgoergens Apr 23, 2024
7dae23c
base verifier compiles, tackling recursion
matthiasgoergens Apr 24, 2024
9a3d6d1
Merge remote-tracking branch 'origin/main' into matthias/ctl/use-upst…
matthiasgoergens Apr 24, 2024
d65aaa9
Try to make basic proving and verification work
matthiasgoergens Apr 24, 2024
1c8b93c
Use my branch
matthiasgoergens Apr 24, 2024
0dc5c0b
Update
matthiasgoergens Apr 24, 2024
b51474a
Simpler
matthiasgoergens Apr 24, 2024
f2e65de
Serialising
matthiasgoergens Apr 24, 2024
11297df
Nicer
matthiasgoergens Apr 24, 2024
98364e3
All the things
matthiasgoergens Apr 24, 2024
ed4d1cd
Clippy fix
matthiasgoergens Apr 24, 2024
9db9a4b
Clippy
matthiasgoergens Apr 24, 2024
d7b5a6f
Standalone proving
matthiasgoergens Apr 24, 2024
49d789c
Rescue tests
matthiasgoergens Apr 24, 2024
60bd2e2
Fix forgotten ones
matthiasgoergens Apr 24, 2024
28adc1c
Verify
matthiasgoergens Apr 24, 2024
801cdc0
Simpler
matthiasgoergens Apr 24, 2024
9da3be1
Update
matthiasgoergens Apr 24, 2024
8bdee5e
Merge remote-tracking branch 'origin/main' into matthias/ctl/use-upst…
matthiasgoergens Apr 24, 2024
27cebe8
Fix more
matthiasgoergens Apr 24, 2024
ca7f5b5
Restore
matthiasgoergens Apr 24, 2024
f0da0ac
Cargo update
matthiasgoergens Apr 24, 2024
84bac18
Fix from_u32
matthiasgoergens Apr 24, 2024
545575f
Progress
matthiasgoergens Apr 24, 2024
eee3932
More progress
matthiasgoergens Apr 24, 2024
ca33a6f
Merge remote-tracking branch 'origin/main' into matthias/ctl/use-upst…
matthiasgoergens Apr 24, 2024
2c22f52
Merge remote-tracking branch 'origin/main' into matthias/ctl/use-upst…
matthiasgoergens Apr 24, 2024
ab48066
Merge branch 'matthias/memory-opt-more/paralleler' into matthias/upst…
matthiasgoergens Apr 24, 2024
ac41127
Fix
matthiasgoergens Apr 24, 2024
7ef8f66
requires_ctl
matthiasgoergens Apr 24, 2024
1f2e72a
Parallel
matthiasgoergens Apr 24, 2024
f40b479
Time more
matthiasgoergens Apr 24, 2024
88b3129
Use from
matthiasgoergens Apr 25, 2024
900da21
Use from
matthiasgoergens Apr 25, 2024
72f11d5
Use from
matthiasgoergens Apr 25, 2024
563b709
Remove stuff
matthiasgoergens Apr 25, 2024
5814f4e
One giant lookup
matthiasgoergens Apr 25, 2024
8a6680f
One single lookup to get more batching
matthiasgoergens Apr 25, 2024
c8e087c
Merge branch 'matthias/rump-cpu' into matthias/upstream-with-separate…
matthiasgoergens Apr 30, 2024
f9c9954
Merge branch 'matthias/memory-opt-more/paralleler' into matthias/upst…
matthiasgoergens Apr 30, 2024
743bda9
Merge branch 'main' into matthias/upstream-with-separate-lw-sw
matthiasgoergens Apr 30, 2024
c01b3eb
Merge branch 'matthias/memory-opt-more/paralleler' into matthias/upst…
matthiasgoergens May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ starky = { version = "0", default-features = false }
plonky2_crypto = { git = "https://github.com/0xmozak/plonky2-crypto.git" }

[patch.crates-io]
plonky2 = { git = "https://github.com/0xmozak/plonky2.git" }
plonky2_maybe_rayon = { git = "https://github.com/0xmozak/plonky2.git" }
starky = { git = "https://github.com/0xmozak/plonky2.git" }
# plonky2 = { path = "../plonky2/plonky2" }
# plonky2_maybe_rayon = { path = "../plonky2/maybe_rayon" }
# starky = { path = "../plonky2/starky" }
plonky2 = { git = "https://github.com/0xmozak/plonky2.git", branch = "matthias/looked-tables" }
plonky2_maybe_rayon = { git = "https://github.com/0xmozak/plonky2.git", branch = "matthias/looked-tables" }
starky = { git = "https://github.com/0xmozak/plonky2.git", branch = "matthias/looked-tables" }
13 changes: 11 additions & 2 deletions circuits/src/bitshift/stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use crate::unstark::NoColumns;
#[allow(clippy::module_name_repetitions)]
pub struct BitshiftStark<F, const D: usize> {
pub _f: PhantomData<F>,
pub standalone_proving: bool,
}

impl<F, const D: usize> HasNamedColumns for BitshiftStark<F, D> {
Expand Down Expand Up @@ -80,6 +81,8 @@ impl<F: RichField + Extendable<D>, const D: usize> Stark<F, D> for BitshiftStark
type EvaluationFrameTarget =
StarkFrame<ExtensionTarget<D>, ExtensionTarget<D>, COLUMNS, PUBLIC_INPUTS>;

fn requires_ctls(&self) -> bool { !self.standalone_proving }

fn eval_packed_generic<FE, P, const D2: usize>(
&self,
vars: &Self::EvaluationFrame<FE, P, D2>,
Expand Down Expand Up @@ -127,7 +130,10 @@ mod tests {

#[test]
fn test_degree() -> Result<()> {
let stark = S::default();
let stark = S {
standalone_proving: true,
..S::default()
};
test_stark_low_degree(stark)
}

Expand Down Expand Up @@ -206,7 +212,10 @@ mod tests {

#[test]
fn test_circuit() -> anyhow::Result<()> {
let stark = S::default();
let stark = S {
standalone_proving: true,
..S::default()
};
test_stark_circuit_constraints::<F, C, S, D>(stark)?;

Ok(())
Expand Down
5 changes: 4 additions & 1 deletion circuits/src/cpu/mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ mod tests {
"trace to poly",
trace_rows_to_poly_values(cpu_trace)
);
let stark = S::default();
let stark = S {
standalone_proving: true,
..S::default()
};

let proof = timed!(
timing,
Expand Down
13 changes: 11 additions & 2 deletions circuits/src/cpu/stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::expr::{build_ext, build_packed, ConstraintBuilder};
#[allow(clippy::module_name_repetitions)]
pub struct CpuStark<F, const D: usize> {
pub _f: PhantomData<F>,
pub standalone_proving: bool,
}

impl<F, const D: usize> HasNamedColumns for CpuStark<F, D> {
Expand Down Expand Up @@ -117,6 +118,8 @@ impl<F: RichField + Extendable<D>, const D: usize> Stark<F, D> for CpuStark<F, D
type EvaluationFrameTarget =
StarkFrame<ExtensionTarget<D>, ExtensionTarget<D>, COLUMNS, PUBLIC_INPUTS>;

fn requires_ctls(&self) -> bool { !self.standalone_proving }

fn eval_packed_generic<FE, P, const D2: usize>(
&self,
vars: &Self::EvaluationFrame<FE, P, D2>,
Expand Down Expand Up @@ -160,7 +163,10 @@ mod tests {
type F = <C as GenericConfig<D>>::F;
type S = CpuStark<F, D>;

let stark = S::default();
let stark = S {
standalone_proving: true,
..S::default()
};
test_stark_low_degree(stark)
}

Expand All @@ -171,7 +177,10 @@ mod tests {
type F = <C as GenericConfig<D>>::F;
type S = CpuStark<F, D>;

let stark = S::default();
let stark = S {
standalone_proving: true,
..S::default()
};
test_stark_circuit_constraints::<F, C, S, D>(stark)?;

Ok(())
Expand Down
3 changes: 3 additions & 0 deletions circuits/src/cpu_skeleton/stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use crate::stark::mozak_stark::PublicInputs;
#[derive(Clone, Copy, Default, StarkNameDisplay)]
#[allow(clippy::module_name_repetitions)]
pub struct CpuSkeletonStark<F, const D: usize> {
pub standalone_proving: bool,
pub _f: PhantomData<F>,
}

Expand Down Expand Up @@ -77,6 +78,8 @@ impl<F: RichField + Extendable<D>, const D: usize> Stark<F, D> for CpuSkeletonSt
type EvaluationFrameTarget =
StarkFrame<ExtensionTarget<D>, ExtensionTarget<D>, COLUMNS, PUBLIC_INPUTS>;

fn requires_ctls(&self) -> bool { !self.standalone_proving }

fn eval_packed_generic<FE, P, const D2: usize>(
&self,
vars: &Self::EvaluationFrame<FE, P, D2>,
Expand Down
Loading