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

Miki/msm-optimiations #794

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Miki/msm-optimiations #794

wants to merge 4 commits into from

Conversation

mickeyasa
Copy link
Contributor

avoid scalar copy
improve c formula

@@ -42,22 +42,28 @@ class Msm
}

// run MSM based on pippenger algorithm
void run_msm(const scalar_t* scalars, const A* bases, P* results)
void run_msm(const scalar_t* scalars, const A* bases, P* results, bool last_task_on_batch)
Copy link
Collaborator

@yshekel yshekel Mar 2, 2025

Choose a reason for hiding this comment

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

I think it's last_task_in_batch? instead of on_batch

phase3_final_accumulator(results);
m_phase3_thread = nullptr;
} else {
m_phase3_thread = new std::thread(&Msm::phase3_final_accumulator, this, results);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see that you release it so you leak memory. Why not a unique_ptr? you can still have it nullptr

@@ -217,18 +226,35 @@ class Msm
}
}

// // phase 2: accumulate m_segment_size buckets into a line_sum and triangle_sum
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you need this code?

Copy link
Collaborator

@yshekel yshekel left a comment

Choose a reason for hiding this comment

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

Can you please elaborate which case you checked (curve, size) and the before/after performance? and for which HW

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