Skip to content

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

Merged
copybara-service[bot] merged 1 commit into
google:mainfrom
inbelic:inbelic/poly-mul-using-ntt
May 28, 2024
Merged

poly: add pass to convert poly.mul to use ntt ops#657
copybara-service[bot] merged 1 commit into
google:mainfrom
inbelic:inbelic/poly-mul-using-ntt

Conversation

@inbelic

@inbelic inbelic commented Apr 29, 2024

Copy link
Copy Markdown
Contributor
  • 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

@j2kun j2kun left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great work!

Comment thread lib/Dialect/Polynomial/Transforms/Passes.td Outdated
Comment thread lib/Dialect/Polynomial/Transforms/NTTRewrites.td
@j2kun

j2kun commented May 1, 2024

Copy link
Copy Markdown
Collaborator

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

@inbelic

inbelic commented May 2, 2024

Copy link
Copy Markdown
Contributor Author

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
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