fhelium.backend.triton._weighted_sum
Fuse represented plaintext products and modular sums without temporary products.
TritonWeightedSumImplementation
class View source
python
TritonWeightedSumImplementation(name: str = 'triton-montgomery-weighted-sum', operation_types: tuple = (rns.MontgomeryWeightedSumOp, rns.MontgomeryWeightedSumsOp), supports_in_place: bool = False)1
Compute each row's sum in bounded NTT/Montgomery expression kernels.
Each kernel evaluates a caller-selected consecutive range of terms. Its modular products and left-associated additions use the existing RNS expression generator. Dense and compressed plaintexts remain runtime operands; sparse implicit rows are loaded from their supplied Tensors. Chunk results are added modulo each prime without changing scale or depth.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | str | 'triton-montgomery-weighted-sum' |
operation_types | tuple | (rns.MontgomeryWeightedSumOp, rns.MontgomeryWeightedSumsOp) |
supports_in_place | bool | False |
resource_requirements
method
python
def resource_requirements(invocation): ...1
execute
method
python
def execute(invocation, values, resources, *, in_place): ...1