google / heir

A compiler for homomorphic encryption
https://heir.dev/
Apache License 2.0
237 stars 34 forks source link

openfhe: rotation index is statically known - use an attribute? #741

Closed asraa closed 3 weeks ago

asraa commented 4 weeks ago

Hey, Noted in review https://github.com/google/heir/pull/696#discussion_r1636681052, openfhe.rot 's rotation index probably has to be statically known and it may be better to use an attribute.

j2kun commented 4 weeks ago

Seems like it was my oversight. Let's do it!

asraa commented 4 weeks ago

Probably for consistency, I think bgv.rotate should also use an attr - again here we're expected statically known indices.

That probably moves the restriction from tensor_ext rotate to bgv rotate to mean a check that it must be constant in order to be translated to a ciphertext rotation. I think that makes sense. Tensor ext probably isn't aware that rotations must be known constants, and if it is, the lowering would look a little more like a blind rotate than a plain rotation operation.

asraa commented 4 weeks ago

cc @Maokami