-
Notifications
You must be signed in to change notification settings - Fork 79
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
Fall back to cpu in small fft size. #827
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #827 +/- ##
==========================================
- Coverage 91.86% 91.82% -0.04%
==========================================
Files 89 89
Lines 12080 12102 +22
Branches 12080 12102 +22
==========================================
+ Hits 11097 11113 +16
- Misses 876 882 +6
Partials 107 107
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
7c85193
to
da9d4c7
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.
Can all relevant tests be added please
Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @alonh5 and @shaharsamocha7)
crates/prover/src/core/backend/simd/circle.rs
line 148 at r1 (raw file):
let log_size = eval.values.length.ilog2(); if log_size < MIN_FFT_LOG_SIZE { let cpu_poly = CpuBackend::interpolate(eval.to_cpu(), &twiddles.to_cpu());
twiddles.to_cpu() could be very expensive.
Suggestion:
let cpu_poly = eval.to_cpu().interpolate();
crates/prover/src/core/backend/simd/circle.rs
line 241 at r1 (raw file):
&CirclePoly::new(poly.coeffs.to_cpu()), domain, &twiddles.to_cpu(),
Same here.
crates/prover/src/core/backend/simd/circle.rs
line 244 at r1 (raw file):
); return CircleEvaluation::new( cpu_eval.domain,
Won't this be expensive if cpu_domain is large?
da9d4c7
to
9dcd61b
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 4 files reviewed, 3 unresolved discussions (waiting on @andrewmilson and @shaharsamocha7)
crates/prover/src/core/backend/simd/circle.rs
line 148 at r1 (raw file):
Previously, andrewmilson (Andrew Milson) wrote…
twiddles.to_cpu() could be very expensive.
Done.
crates/prover/src/core/backend/simd/circle.rs
line 241 at r1 (raw file):
Previously, andrewmilson (Andrew Milson) wrote…
Same here.
Done.
crates/prover/src/core/backend/simd/circle.rs
line 244 at r1 (raw file):
Previously, andrewmilson (Andrew Milson) wrote…
Won't this be expensive if cpu_domain is large?
The worst it will be is 4 + log_blowup_factor
. So it shouldn't be that bad, right?
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 4 files reviewed, 2 unresolved discussions (waiting on @alonh5 and @shaharsamocha7)
crates/prover/src/core/backend/simd/circle.rs
line 229 at r2 (raw file):
) -> CircleEvaluation<Self, BaseField, BitReversedOrder> { // TODO(spapini): Precompute twiddles. // TODO(spapini): Handle small cases.
I think these can be removed now.
Code quote:
// TODO(spapini): Precompute twiddles.
// TODO(spapini): Handle small cases.
crates/prover/src/core/poly/twiddles.rs
line 36 at r2 (raw file):
} } }
Can this be removed?
Code quote:
impl TwiddleTree<SimdBackend> {
pub fn to_cpu(&self) -> TwiddleTree<CpuBackend> {
TwiddleTree {
root_coset: self.root_coset,
twiddles: self
.twiddles
.iter()
.map(|x| BaseField::from(x >> 1))
.collect_vec(),
itwiddles: self
.itwiddles
.iter()
.map(|x| BaseField::from(x >> 1))
.collect_vec(),
}
}
}
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.
Fixed comments. Regarding the tests, there are still places where the minimum bound needs to be removed. I'm fixing it and will add tests in the next PR.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @andrewmilson and @shaharsamocha7)
crates/prover/src/core/backend/simd/circle.rs
line 229 at r2 (raw file):
Previously, andrewmilson (Andrew Milson) wrote…
I think these can be removed now.
Done.
crates/prover/src/core/poly/twiddles.rs
line 36 at r2 (raw file):
Previously, andrewmilson (Andrew Milson) wrote…
Can this be removed?
Done.
9dcd61b
to
cced27f
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 4 files reviewed, all discussions resolved (waiting on @shaharsamocha7)
cced27f
to
77b7cdd
Compare
This change is