fhelium.backend.ckks.rotation.operations
Independent, hoisted, and weighted CKKS rotation implementations.
NativeRotateImplementation
class View source
python
NativeRotateImplementation(supports_in_place: bool = False, name: str = 'native-rotate-streaming', operation_types: tuple[type[Operation], ...] = (ckks.RotateOp,))1
Rotate CT2 through one automorphism and streaming hybrid key switch.
Attributes
| Name | Type | Default/value |
|---|---|---|
supports_in_place | bool | False |
name | str | 'native-rotate-streaming' |
operation_types | tuple[type[Operation], ...] | (ckks.RotateOp,) |
tensor_requirements | staticmethod(native_key_switch_requirements) | |
prepare_operation | prepare_native_key_switch |
resource_requirements
method
python
def resource_requirements(invocation: OperationInvocation) -> tuple[ResourceRequirement, ...]: ...1
execute
method
python
def execute(invocation: OperationInvocation, inputs: tuple[torch.Tensor, ...], resources: tuple[BoundResource, ...], *, in_place: bool) -> tuple[torch.Tensor, ...]: ...1
NativeRotationSumImplementation
class View source
python
NativeRotationSumImplementation(name: str = 'native-rotation-sum-aggregate', supports_in_place: bool = False, operation_types: tuple = (ckks.RotationSumOp,))1
Stream all rotation key products and execute one quotient tail.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | str | 'native-rotation-sum-aggregate' |
supports_in_place | bool | False |
operation_types | tuple | (ckks.RotationSumOp,) |
tensor_requirements | staticmethod(rotation_sum_requirements) | |
prepare_operation | prepare_native_key_switch |
resource_requirements
method
python
def resource_requirements(invocation): ...1
execute
method
python
def execute(invocation, inputs, resources, *, in_place): ...1
NativeHoistedRotateManyImplementation
class View source
python
NativeHoistedRotateManyImplementation(supports_in_place: bool = False, name: str = 'native-rotate-many-hoisted', operation_types: tuple[type[Operation], ...] = (ckks.RotateManyOp,))1
Execute one scheduled rotation group without changing its membership.
Attributes
| Name | Type | Default/value |
|---|---|---|
supports_in_place | bool | False |
name | str | 'native-rotate-many-hoisted' |
operation_types | tuple[type[Operation], ...] | (ckks.RotateManyOp,) |
tensor_requirements | staticmethod(native_key_switch_requirements) | |
prepare_operation | prepare_native_key_switch |
resource_requirements
method
python
def resource_requirements(invocation: OperationInvocation) -> tuple[ResourceRequirement, ...]: ...1
execute
method
python
def execute(invocation: OperationInvocation, inputs: tuple[torch.Tensor, ...], resources: tuple[BoundResource, ...], *, in_place: bool) -> tuple[torch.Tensor, ...]: ...1
NativeGroupedRotationWeightedSumImplementation
class View source
python
NativeGroupedRotationWeightedSumImplementation(supports_in_place: bool = False, name: str = 'native-grouped-rotation-weighted-sum', operation_types: tuple[type[Operation], ...] = (ckks.GroupedRotationWeightedSumOp,))1
Execute one supplied direct-rotation/plaintext group matrix.
Attributes
| Name | Type | Default/value |
|---|---|---|
supports_in_place | bool | False |
name | str | 'native-grouped-rotation-weighted-sum' |
operation_types | tuple[type[Operation], ...] | (ckks.GroupedRotationWeightedSumOp,) |
tensor_requirements | staticmethod(native_key_switch_requirements) | |
prepare_operation | prepare_native_key_switch |
resource_requirements
method
python
def resource_requirements(invocation: OperationInvocation) -> tuple[ResourceRequirement, ...]: ...1
execute
method
python
def execute(invocation: OperationInvocation, inputs: tuple[torch.Tensor, ...], resources: tuple[BoundResource, ...], *, in_place: bool) -> tuple[torch.Tensor, ...]: ...1