-
Notifications
You must be signed in to change notification settings - Fork 156
SIMD Barycentric Evaluation and Test #1069
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
bdbf71c
to
baac125
Compare
8a83a9f
to
92a5086
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: 0 of 1 files reviewed, 1 unresolved discussion
crates/prover/src/core/poly/circle/evaluation.rs
line 249 at r1 (raw file):
// TODO(Gali): Remove. #[allow(dead_code)] fn simd_weights(
This function should have unit test
Code quote:
fn simd_weights(
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.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2
.
Benchmark suite | Current: c76f10e | Previous: 615de1f | Ratio |
---|---|---|---|
iffts/simd ifft/27 |
588941361 ns/iter (± 7171756 ) |
277997930 ns/iter (± 8211035 ) |
2.12 |
iffts/simd ifft/28 |
1209210657 ns/iter (± 15563836 ) |
574305772 ns/iter (± 32121353 ) |
2.11 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @shaharsamocha7
92a5086
to
bb9e718
Compare
baac125
to
ce3c080
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## gali/barycentric #1069 +/- ##
====================================================
+ Coverage 92.68% 92.73% +0.04%
====================================================
Files 106 106
Lines 14374 14497 +123
Branches 14374 14497 +123
====================================================
+ Hits 13323 13444 +121
- Misses 970 972 +2
Partials 81 81 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ce3c080
to
986c607
Compare
bb9e718
to
8dd5b33
Compare
8dd5b33
to
34fce22
Compare
986c607
to
eda6d66
Compare
b901e8e
to
886ec2e
Compare
34fce22
to
ad1902f
Compare
886ec2e
to
8218dfb
Compare
8218dfb
to
faab86f
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 all commit messages.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @Gali-StarkWare)
crates/prover/src/core/poly/circle/evaluation.rs
line 249 at r1 (raw file):
Previously, shaharsamocha7 wrote…
This function should have unit test
I want a test that compares this with the cpu weights
Also, try to simplify the code as we did in the cpu pr
crates/prover/src/core/poly/circle/evaluation.rs
line 321 at r4 (raw file):
weights: &Col<SimdBackend, SecureField>, ) -> SecureField { let evals = evals.clone().bit_reverse();
Is this going to be removed?
If so, please have a TODO on that
Code quote:
let evals = evals.clone().bit_reverse();
crates/prover/src/core/poly/circle/evaluation.rs
line 326 at r4 (raw file):
acc + (weights.at(i) * evals.values.at(i)) }); }
could we discard this usecase?
Code quote:
if evals.domain.size() < N_LANES {
return (0..evals.domain.size()).fold(SecureField::zero(), |acc, i| {
acc + (weights.at(i) * evals.values.at(i))
});
}
faab86f
to
209a21d
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: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @Gali-StarkWare and @shaharsamocha7)
crates/prover/src/core/poly/circle/evaluation.rs
line 249 at r1 (raw file):
Previously, shaharsamocha7 wrote…
I want a test that compares this with the cpu weights
Also, try to simplify the code as we did in the cpu pr
Added the test. Do you want to split the si_i optimization (using only 2 values because it alternates) to another pr?
crates/prover/src/core/poly/circle/evaluation.rs
line 321 at r4 (raw file):
Previously, shaharsamocha7 wrote…
Is this going to be removed?
If so, please have a TODO on that
I have a TODO in the weights function to change the order, do we need another one here? Same for the CPU function?
crates/prover/src/core/poly/circle/evaluation.rs
line 326 at r4 (raw file):
Previously, shaharsamocha7 wrote…
could we discard this usecase?
Done.
209a21d
to
c76f10e
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 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Gali-StarkWare)
crates/prover/src/core/poly/circle/evaluation.rs
line 238 at r6 (raw file):
/// Computes the weights for Barycentric Lagrange interpolation for point `p` on `coset`. /// `p` must not be in the domain. For more information, see [`barycentric_weights`]. fn simd_barycentric_weights(
Shouldn't this code be under simd folder somewhere?
I'm not sure
Code quote:
fn simd_barycentric_weights(
crates/prover/src/core/poly/circle/evaluation.rs
line 281 at r6 (raw file):
// TODO(Gali): Change weights order to bit-reverse order. // S_i(i) is invariant under G_(n−1) and alternate under J
Can you clarify this comment?
It should explain why the second part is multiplied by -1, but I think that comment is a bit implicit.
Code quote:
// S_i(i) is invariant under G_(n−1) and alternate under J
crates/prover/src/core/poly/circle/evaluation.rs
line 292 at r6 (raw file):
.collect(); weights
Does this pass compiler?
Suggestion:
(0..weights_vec_len)
.map(|i| {
if i < weights_vec_len / 2 {
vi_p_inverse[i] * si_0_vn_p
} else {
vi_p_inverse[i] * -si_0_vn_p
}
})
.collect()
c76f10e
to
132f1f1
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: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @shaharsamocha7)
crates/prover/src/core/poly/circle/evaluation.rs
line 238 at r6 (raw file):
Previously, shaharsamocha7 wrote…
Shouldn't this code be under simd folder somewhere?
I'm not sure
Next pr is moving it to simd
crates/prover/src/core/poly/circle/evaluation.rs
line 292 at r6 (raw file):
Previously, shaharsamocha7 wrote…
Does this pass compiler?
Yes, it's like that because in a following parallelism pr I need to do it that way. Would you rather I change it to your suggestion and define weights there?
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 1 files at r7, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Gali-StarkWare)
132f1f1
to
4681461
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 1 files at r7.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @shaharsamocha7)
4681461
to
c5056c4
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 1 files at r9, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Gali-StarkWare)
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 all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Gali-StarkWare)
No description provided.