-
Notifications
You must be signed in to change notification settings - Fork 72
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 approximation patterns #1449
Conversation
b44e84c
to
afe1a58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing! Just a nit and one real request: could you also add this pass to the --mlir-to-secret-arithmetic
pipeline, and add at least one math.<something>
op in an e2e test? Thanks!
lib/Transforms/PolynomialApproximation/PolynomialApproximation.td
Outdated
Show resolved
Hide resolved
I actually cannot, because we don't have a lowering for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you also add this pass to the
--mlir-to-secret-arithmetic
pipeline, and add at least onemath.<something>
op in an e2e test? Thanks!I actually cannot, because we don't have a lowering for
polynomial.eval
yet.
:( That's a good reason, though xD
7d1d584
to
bb17c79
Compare
Part of #1217
This PR adds polynomial approximation patterns for all unary
math
dialect ops that operate on floats, e.g.,math.exp
. These should all be elementwise mappable, so extent to tensors and similar for use in the secret+tensor_ext_layer.The pass supports extracting the desired degree/interval of approximation from the op attributes, and otherwise uses a default [-1, 1] degree 5 approximation.
What's missing:
linalg.map { arith.maximumf }