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

Polynomial evaluation IR #1217

Open
j2kun opened this issue Dec 20, 2024 · 0 comments
Open

Polynomial evaluation IR #1217

j2kun opened this issue Dec 20, 2024 · 0 comments
Labels
dialect: polynomial Issues concerning the polynomial dialect

Comments

@j2kun
Copy link
Collaborator

j2kun commented Dec 20, 2024

As part of the broader polynomial approximation system, we would like to materialize polynomial approximations in the IR.

We should create a polynomial.eval op, which takes as input a static polynomial attribute and an SSA value (AnyType), and semantically this represents the evaluation of the polynomial at the input.

Then we would implement possible lowerings of eval to a sequence of add/mul ops in an appropriate dialect (see below). One lowering would be a Horner's method, while another would correspond to Paterson-Stockmeyer. We'd expect the latter to be more efficient for FHE due to the imbalance in add/mul costs.

We should start by implementing this for integer/float types, with the lowering lower to addi/mui/add/mulf. Ideally we could generalize this to an interface, so that the interface would decide what is the "right" add/mul op to use for a given type. Maybe the interface would be in charge of actually constructing the op in question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialect: polynomial Issues concerning the polynomial dialect
Projects
None yet
Development

No branches or pull requests

1 participant