-
Notifications
You must be signed in to change notification settings - Fork 61
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
Arith to ModArith Conversion pass and Mac Transformer pass #1125
Conversation
Looks like some tests are failing. Could you fix that and then send the PR to me for review? |
5135ddf
to
40e5db2
Compare
One thing I think would be helpful is an explanation (perhaps in the PR description, maybe also in the tablegen pass description field) of the broader reason for having this pass. What e2e use case is it intended to support, and what stage of that e2e use case is it managing? |
8221333
to
baca68e
Compare
tests/Dialect/Arith/Conversions/ArithToModArith/arith-to-mod-arith.mlir
Outdated
Show resolved
Hide resolved
lib/Dialect/Arith/Conversions/ArithToModArith/ArithToModArith.cpp
Outdated
Show resolved
Hide resolved
56fbde0
to
bc8feac
Compare
@WoutLegiest is this ready for a final review? |
Yes it is! |
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.
I don't think I fully understand why this TOSA pipeline needs to use mod_arith
but I already have some ideas for howto (ab)use ArithToModArith so super happy to see it :)
Conversion is place in the Arith folder, but lives in the heir::arith dialect
The arith-to-mod-arith pass is required to lower a neural network TOSA model to a CGGI backend. This pass will transform the operations to the mod-arith dialect, where the find-mac pass can be used to convert consecutive multiply addition operations into a single operation. In a later pass (ongoing work), these large precision MAC operations (typically 64 or 32-bit) will be lowered into small precision (8 or 4b) operations that can be mapped to CGGI operations.