fhelium.compile.passes.lowering._select_execution
Select registered lowerings independently at each execution operation.
SelectExecutionLoweringsPass
class View source
SelectExecutionLoweringsPass(implementations: OperationImplementationRegistry, fusion_implementations: Sequence[FusionImplementation] = (), lowerings: CkksLoweringRegistry = DEFAULT_CKKS_LOWERINGS, allow_partial_fusion: bool = True, name: str = 'select-execution-lowerings', execution_cost: Callable[[Operation, Sequence[Operation]], tuple[float, float] | None] | None = None)Keep applicable whole operations or expose a supported fusion expression.
A supplied implementation assignment is local to its operation. Unassigned operations without whole-operation coverage require lowering. Where both routes exist, an isolated lowering probe is accepted only when a fusion implementation supports the complete expression. With partial fusion enabled, supported subregions may instead be combined with independent implementations for the remaining operations.
execution_cost may compare the whole operation with the isolated lowered candidate after this pass's fusion scheduling. It returns (whole, lowered) costs in one caller-selected unit, or None when the comparison is unknown. Lowering is selected only for a strictly smaller supplied cost; ties retain the whole operation. Missing estimates retain the fusion-coverage decision. Implementation assignments always take precedence over this callback.
Attributes
| Name | Type | Default/value |
|---|---|---|
implementations | OperationImplementationRegistry | |
fusion_implementations | Sequence[FusionImplementation] | () |
lowerings | CkksLoweringRegistry | DEFAULT_CKKS_LOWERINGS |
allow_partial_fusion | bool | True |
name | str | 'select-execution-lowerings' |
execution_cost | Callable[[Operation, Sequence[Operation]], tuple[float, float] | None] | None | None |
run
method
def run(compilation: 'Compilation') -> PassResult: ...