Fix aliasing bug in OpenFHE emitter for InsertOp with shared buffers - #3198
Fix aliasing bug in OpenFHE emitter for InsertOp with shared buffers#3198toprakmurat wants to merge 1 commit into
Conversation
|
Welcome to HEIR! Thank you for opening your first pull request! We appreciate you joining our community. Please note that our contributing policy) requires unrecognized users to meet a maintainer in a non-textual format before their first PR will be reviewed. If you have already met a maintainer, or you're sure the maintainers know who you are, you can safely ignore this message. Otherwise, a maintainer will likely close this PR shortly. Don't take it personally! Instead, we welcome you to attend one of our open meetings on our community calendar, schedule a dedicated call with a maintainer, or reach out in the We look forward to connecting with you! |
VedantParanjape
left a comment
There was a problem hiding this comment.
Thanks for the fix!
|
@j2kun could you review this as well? |
j2kun
left a comment
There was a problem hiding this comment.
LGTM. The lattigo backend is bufferized, meaning there are no tensor ops. I plan on bufferizing the openfhe backend, but I have gotten sidetracked with other priorities.
|
So I was looking at this in more detail and I think the change is actually not the right thing to do. Indeed, it is semantically wrong, but copy on write will make the resulting FHE programs extremely slow (not even for FHE reasons, just because it will be copying data way too often). The right solution here is to bufferize the openfhe dialect, so that the operations are memref and memory safety is upheld by the bufferization logic. |
Fixes #3196
Implemented changes mostly based on printOperation(tensor::InsertSliceOp)
I did not look into Lattigo backend, I can change it with a different PR if needed.
Tested with the test code @VedantParanjape provided.