Skip to content

[FEAT] Calculate Sumcheck's round polynomials more efficiently#884

Open
idanfr-ingo wants to merge 5 commits intomainfrom
idan/sumcheck_dont_calc_last_elm
Open

[FEAT] Calculate Sumcheck's round polynomials more efficiently#884
idanfr-ingo wants to merge 5 commits intomainfrom
idan/sumcheck_dont_calc_last_elm

Conversation

@idanfr-ingo
Copy link
Copy Markdown
Contributor

No description provided.

@idanfr-ingo idanfr-ingo requested a review from mickeyasa April 28, 2025 13:45
tf::Executor m_executor; // execute all tasks accumulated on multiple threads

// functions
F lagrange_interpolation(const std::vector<F>& poly_evaluations, const F& x) const
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is copied from the frontend. Please avoid that.
You can make it static and friend at the frontend and use it here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why friend function and not just a regular function outside the Sumcheck class?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a valid option but making it public will enable the end user to also use it.
Not sure that we want to.

break;
default: {
std::vector<F>& prev_round_polynomial = sumcheck_proof.get_round_polynomial(round_idx - 1);
alpha_value = lagrange_interpolation(prev_round_polynomial, alpha);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might be the reason for the low performance on small sumchecks. the calculation of lagrange_interpolation might be longer for small MLE polynomials.

Comment thread icicle/backend/cpu/include/cpu_sumcheck.h Outdated

for (int element_idx = start_element_idx; element_idx < start_element_idx + nof_iterations; ++element_idx) {
for (int k = 0; k < round_polynomial.size(); ++k) {
for (int k = 1; k < round_polynomial.size() - 1; ++k) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add explanation why you start from 1 and not 0

}

for (int k = 0; k < round_polynomial.size(); ++k) {
for (int k = 1; k < round_polynomial.size(); ++k) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

// update_round_polynomial(element_idx, folded_mle_polynomials, mle_polynomial_size, program_executor,
// round_polynomial);
for (int k = 0; k < round_polynomial.size(); ++k) {
for (int k = 1; k < round_polynomial.size(); ++k) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Copy link
Copy Markdown
Contributor

@mickeyasa mickeyasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require more tests about the reason for small sumchecks delay

@@ -111,6 +112,25 @@ namespace icicle {
worker_round_polynomial[worker_idx][k] = F::zero();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt this loop suppose to run fro k=1 and not k=0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants