fhelium.serialization.compilation
Single-file Program persistence with optional, storage-preserving bindings.
inspect_compilation
function View source
def inspect_compilation(path: str | os.PathLike[str]) -> ValueFileMetadata: ...Inspect Program and binding metadata without loading numerical payloads.
load_compilation
function View source
def load_compilation(path: str | os.PathLike[str], *, device: torch.device | str='cpu') -> Compilation: ...Restore a Program and saved bindings; leave all other symbols unbound.
Loading does not prepare resources, run passes, compile kernels, or execute the Program. Every stored byte storage is copied to independent writable memory on device once, so views continue to share storage after transfer.
save_compilation
function View source
def save_compilation(compilation: Compilation, path: str | os.PathLike[str], *, include_materials: bool | Collection[str]=False, overwrite: bool=False) -> ValueFileMetadata: ...Save a Program and selected bound Tensors without serializing Python state.
False omits all data; True includes every current binding; a collection selects bound symbols. Missing Program bindings may remain external. The payload retains strided views, shared storage, repeated Tensor objects, and conjugate/negative view bits. Only bytes covered by selected views are copied; holes in their shared storage are zero-filled. Original addresses, devices, autograd history, workspaces, reports, and executables are not saved.
Data is unencrypted. Inclusion is opt-in and does not detect sensitive contents of arbitrary Tensors. Callers own synchronization with live writers.