Page cover image

Runtime

The HEAL Runtime is an engine that sequentially processes a model inference pipeline, as defined in a JSON-based transcript. This runtime is hardware-agnostic, delegating each operation to a provided device engine and abstracting execution to enable both software fallbacks and hardware acceleration.

The runtime reads an execution transcript (a list of operations) and executes them step-by-step. It handles memory references between host and device, dispatches each instruction to the correct function, and manages verification if required.

This allows for seamless execution of fully homomorphic encryption (FHE) workflows, including

  • Moving data between the host and hardware (host_to_device, device_to_host)

  • Executing tensor operations (e.g., modmul) on hardware

  • Managing memory via named tensor references

  • Logging performance and verification success


Call Format

run_transcript(device_t_eng, transcript, verify=False)

device_t_eng

The hardware abstraction interface knows how to run each function. This is the bridge between the runtime and your implementation.

transcript

JSON-based list of instructions. For full details, see the Transcript page.

verify

By default, verify=False, which means the runtime just runs the functions and assumes the hardware gives correct results.

If it is enabled, the runtime compares the actual result with the expected output (embedded in the transcript). If they don't match, it raises an error.

This is useful for debugging or validating your hardware functions.


Output

At the end of execution:

  • The runtime prints timing info

  • You get logs for each step

  • If verification is enabled, it confirms correctness


Last updated