-
Notifications
You must be signed in to change notification settings - Fork 72
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
WideFib test with AVX Backend #492
WideFib test with AVX Backend #492
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @spapinistarkware and the rest of your teammates on Graphite |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #492 +/- ##
==========================================
+ Coverage 93.34% 94.04% +0.70%
==========================================
Files 65 65
Lines 8299 8302 +3
Branches 8299 8302 +3
==========================================
+ Hits 7747 7808 +61
+ Misses 490 432 -58
Partials 62 62 ☔ View full report in Codecov by Sentry. |
f21e77e
to
12ade2f
Compare
9949fe2
to
74caa3e
Compare
12ade2f
to
a8014d1
Compare
74caa3e
to
79bac64
Compare
34a5a50
to
28f7685
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 13 files at r2.
Reviewable status: 1 of 13 files reviewed, 1 unresolved discussion (waiting on @spapinistarkware)
src/core/air/accumulation.rs
line 169 at r2 (raw file):
pub struct ColumnAccumulator<'a, B: Backend> { pub random_coeff_pow: SecureField, pub col: &'a mut SecureColumn<B>,
I changed this code. you probably have some conflicts :(
Code quote:
pub struct ColumnAccumulator<'a, B: Backend> {
pub random_coeff_pow: SecureField,
pub col: &'a mut SecureColumn<B>,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 13 files at r2.
Reviewable status: 3 of 13 files reviewed, 6 unresolved discussions (waiting on @spapinistarkware)
src/core/backend/avx512/blake2s.rs
line 28 at r2 (raw file):
) -> Vec<Blake2sHash> { // Pad prev_layer if too small. if log_size < 4 {
Suggestion:
VECS_LOG_SIZE
src/examples/wide_fibonacci/avx.rs
line 95 at r2 (raw file):
let mut b = trace_eval[1].data[vec_row]; #[allow(clippy::needless_range_loop)] for i in 0..(N_COLS - 2) {
Can you add the boundary constraint?
Code quote:
#[allow(clippy::needless_range_loop)]
for i in 0..(N_COLS - 2) {
src/examples/wide_fibonacci/avx.rs
line 104 at r2 (raw file):
// Denominator. // TODO(spapini): Optimized this, for the small number of columns case.
Is this the coset_vanishing function?
Don't we already have one?
Suggestion:
// TODO(spapini): Move to PolyOps? and optimized for the small number of columns case.
src/examples/wide_fibonacci/avx.rs
line 118 at r2 (raw file):
accum.col.set_packed( vec_row, accum.col.packed_at(vec_row) * PackedQM31::broadcast(accum.random_coeff_pow)
Where the denomenator is used?
src/examples/wide_fibonacci/avx.rs
line 158 at r2 (raw file):
#[test] fn test_avx_wide_fib_prove() { // TODO(spapini): Increase to 20, to get 1GB of trace.
You can do these now, no?
Code quote:
// TODO(spapini): Increase to 20, to get 1GB of trace.
28f7685
to
bc6f0e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 13 files reviewed, 5 unresolved discussions (waiting on @shaharsamocha7)
src/core/air/accumulation.rs
line 169 at r2 (raw file):
Previously, shaharsamocha7 wrote…
I changed this code. you probably have some conflicts :(
Done.
src/examples/wide_fibonacci/avx.rs
line 95 at r2 (raw file):
Previously, shaharsamocha7 wrote…
Can you add the boundary constraint?
Done.
src/examples/wide_fibonacci/avx.rs
line 104 at r2 (raw file):
Previously, shaharsamocha7 wrote…
Is this the coset_vanishing function?
Don't we already have one?
Sorry, leftovers.
src/examples/wide_fibonacci/avx.rs
line 118 at r2 (raw file):
Previously, shaharsamocha7 wrote…
Where the denomenator is used?
Done.
src/examples/wide_fibonacci/avx.rs
line 158 at r2 (raw file):
Previously, shaharsamocha7 wrote…
You can do these now, no?
When I test with AVX flags not on release, it's slow. I use it for my tests, so I'd rather only do this when I benchmark.
2a6c1c1
to
2247dbf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 13 files at r2, 7 of 10 files at r3, all commit messages.
Reviewable status: 10 of 13 files reviewed, 4 unresolved discussions (waiting on @spapinistarkware)
src/core/air/accumulation.rs
line 65 at r3 (raw file):
Self { random_coeff_powers: generate_secure_powers(random_coeff, total_columns), sub_accumulations: (0..(max_log_size + 1)).map(|_| None).collect(),
For efficiency?
Code quote:
(0..(max_log_size + 1)).map(|_| None).collect(),
src/examples/wide_fibonacci/constraint_eval.rs
line 436 at r3 (raw file):
evaluation_accumulator: &mut PointEvaluationAccumulator, ) { let constraint_zero_domain = Coset::subgroup(self.log_size);
Why it is not a CanonicCoset?
Code quote:
Coset::subgroup(self.log_size);
src/examples/wide_fibonacci/mod.rs
line 50 at r3 (raw file):
QM31::from_u32_unchecked(1, 2, 3, 4), wide_fib.log_size + 1, Component::<CPUBackend>::n_constraints(&wide_fib),
A question:
Why this change is good?
Code quote:
Component::<CPUBackend>::n_constraints(&wide_fib)
src/examples/wide_fibonacci/avx.rs
line 158 at r2 (raw file):
Previously, spapinistarkware (Shahar Papini) wrote…
When I test with AVX flags not on release, it's slow. I use it for my tests, so I'd rather only do this when I benchmark.
so this TODO is to add benchmark? can you change that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 10 of 13 files reviewed, 3 unresolved discussions (waiting on @shaharsamocha7)
src/core/air/accumulation.rs
line 65 at r3 (raw file):
Previously, shaharsamocha7 wrote…
For efficiency?
Because small sizes are not supported in AVX backend.
src/examples/wide_fibonacci/constraint_eval.rs
line 436 at r3 (raw file):
Previously, shaharsamocha7 wrote…
Why it is not a CanonicCoset?
Good point. I wonder why the test didnt catch it. We should inverstigate this.
src/examples/wide_fibonacci/mod.rs
line 50 at r3 (raw file):
Previously, shaharsamocha7 wrote…
A question:
Why this change is good?
Not good. Necessary.
We should separate Component to a backedn dependenc one and a non backend dependent one.
Currently, when we do .n_constraints(), it doesnt know which impl to use (for which of the backends)
2247dbf
to
701e435
Compare
afae560
to
22acef4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 8 of 13 files reviewed, 2 unresolved discussions (waiting on @spapinistarkware)
src/core/air/accumulation.rs
line 65 at r3 (raw file):
Previously, spapinistarkware (Shahar Papini) wrote…
Because small sizes are not supported in AVX backend.
I don't see the connection.
It seems that you don't initialize unused accumulations, no?
src/examples/wide_fibonacci/constraint_eval.rs
line 436 at r3 (raw file):
Previously, spapinistarkware (Shahar Papini) wrote…
Good point. I wonder why the test didnt catch it. We should inverstigate this.
It works for both CanonicCoset and subgroup?
That's really strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 8 of 13 files reviewed, 2 unresolved discussions (waiting on @shaharsamocha7)
src/core/air/accumulation.rs
line 65 at r3 (raw file):
Previously, shaharsamocha7 wrote…
I don't see the connection.
It seems that you don't initialize unused accumulations, no?
The issue was that I interpolate each of these sub accumulations. And I am not allowed to do it on small ones right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 8 of 13 files reviewed, 2 unresolved discussions (waiting on @shaharsamocha7)
src/examples/wide_fibonacci/constraint_eval.rs
line 436 at r3 (raw file):
Previously, shaharsamocha7 wrote…
It works for both CanonicCoset and subgroup?
That's really strange.
I agree. We should inverstigate this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 10 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @spapinistarkware)
src/examples/wide_fibonacci/constraint_eval.rs
line 436 at r3 (raw file):
Previously, spapinistarkware (Shahar Papini) wrote…
I agree. We should inverstigate this.
Solution here is now clear, it worked since the poly was constant?
src/examples/wide_fibonacci/avx.rs
line 161 at r4 (raw file):
#[test] fn test_avx_wide_fib_prove() {
Need to fix this test before
Code quote:
fn test_avx_wide_fib_prove()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @shaharsamocha7)
src/examples/wide_fibonacci/constraint_eval.rs
line 436 at r3 (raw file):
Previously, shaharsamocha7 wrote…
Solution here is now clear, it worked since the poly was constant?
Yep
src/examples/wide_fibonacci/avx.rs
line 161 at r4 (raw file):
Previously, shaharsamocha7 wrote…
Need to fix this test before
Waiting on you now (mask points change)
701e435
to
42c6621
Compare
22acef4
to
b9036b8
Compare
42c6621
to
2053114
Compare
b9036b8
to
19ded1d
Compare
2053114
to
e3218cf
Compare
19ded1d
to
bcc3f59
Compare
bcc3f59
to
4b151b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 10 of 13 files reviewed, 1 unresolved discussion (waiting on @shaharsamocha7)
src/examples/wide_fibonacci/avx.rs
line 161 at r4 (raw file):
Previously, spapinistarkware (Shahar Papini) wrote…
Waiting on you now (mask points change)
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r5, 2 of 2 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @spapinistarkware)
This change is