fhelium.compile._driver
Create callable execution interfaces over Compile Programs.
compile
function View source
def compile(source: Program | Compilation | Callable[_P, _R] | None=None, *, backend: OperationBackend | None=None, pipeline: Pipeline | Callable[[CallSignature], Pipeline] | None=None, on_miss: Literal['compile', 'error']='compile', workspace: CompileWorkspace | None=None, inputs: Mapping[str, InputSpec] | None=None, material_names: Mapping[str, object] | None=None) -> CompiledCallable[_P, _R] | Callable[[Callable[_P, _R]], CompiledCallable[_P, _R]]: ...Create a lazily prepared callable or decorate a pure Python function.
Python functions capture ordinary Tensor expressions and Eager calls in one Program unless inputs selects the role-declared FX frontend. Ordinary Tensor computations retain their public numerical role; a Ciphertext input does not encrypt other inputs or the entire function. Programs and Compilations skip Python capture. There is no frontend fallback: unsupported capture or execution raises. The original Python reference and standard function metadata are retained.
An omitted Backend uses the standard operation registry. Capture retains actual Tensor materials; it does not bind an Engine owner or generate keys. material_names assigns stable symbols to fixed Tensor/value objects.
When pipeline is omitted, preparation uses default_lower_and_fuse_pipeline. A supplied Pipeline, or function from CallSignature to Pipeline, replaces that recipe rather than extending it. on_miss='error' requires prepare before calls with new input conditions or new Backend bindings. Lazy Backend kernel compilation may still occur on the first actual execution.
Use capture, capture_eager, Compilation, and Pipeline.run when a transformed Program rather than a callable executable is the desired product. Those lower-level operations do not require a Backend.