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

poly: add pass to convert poly.mul to use ntt ops #657

Merged
merged 1 commit into from
May 28, 2024

Conversation

inbelic
Copy link
Contributor

@inbelic inbelic commented Apr 29, 2024

  • We can reduce complexity of polynomial multiplication by using the number-theoretic transform

  • Here we add a pass that will convert all poly.mul operations into a poly.ntt of both operands -> modulus multiplication of the coefficients -> poly.intt back into the polynomial type

Resolves #541

@inbelic inbelic marked this pull request as ready for review April 29, 2024 17:24
@j2kun j2kun self-requested a review May 1, 2024 13:59
Copy link
Collaborator

@j2kun j2kun left a comment

Choose a reason for hiding this comment

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

Great work!

lib/Dialect/Polynomial/Transforms/Passes.td Outdated Show resolved Hide resolved
@j2kun
Copy link
Collaborator

j2kun commented May 1, 2024

Also please squash the commits when you're ready. Thanks!

@inbelic
Copy link
Contributor Author

inbelic commented May 2, 2024

Great thanks. I will be AFK until the 15th, but can fix it up when I have my laptop again. Otherwise, feel free to apply your suggestions and merge. Sorry for the delay

  - We can reduce complexity of polynomial multiplication by using the
    number-theoretic transform

  - Here we add a pass that will convert all poly.mul operations into a
    poly.ntt of both operands -> modulus multiplication of the
    coefficients -> poly.intt back into the polynomial type

Resolves google#541
@inbelic inbelic force-pushed the inbelic/poly-mul-using-ntt branch from 9f7d696 to 3c56676 Compare May 20, 2024 02:39
@j2kun j2kun added the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label May 20, 2024
@copybara-service copybara-service bot merged commit 6b3dc4f into google:main May 28, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a pass that converts polynomial multiplication to NTT/INTT + arith.muli
2 participants