Core Concepts Explained
Last updated
Last updated
HEAL is a runtime framework for executing AI models over structured polynomial data using an efficient and hardware-aligned approach. Central to this system are the concepts of tensors, transcripts, and pointer-based memory interaction.
Here, we outline the essential concepts that form the foundation of HEAL, with additional links provided for deeper technical insights.
In HEAL, data is organized into tensors, which:
Have clearly defined shapes (logical dimensions) and strides (physical memory layouts). The data type (int32 or int64) defines what kind of values the tensor can store.
For operations involving polynomial arithmetic, tensor shapes follow a structured convention:
One axis has length n, which represents the size of the polynomial evaluation domain.
Another axis corresponds to the number of residues in the Double-CRT representation.
Can be non-continuous in memory, facilitating flexible compatibility with various hardware architectures.
HEAL uses a pointer-based memory approach:
Functions do not manage memory internally. Instead, they receive pointers to input and output tensors.
The host directs the device to allocate memory regions and provides pointers to these regions when invoking device functions, reducing overhead and improving efficiency.
This model closely aligns with typical hardware APIs, simplifying integration and execution.
Transcripts are structured JSON files that:
Detail the exact sequence of operations, including tensor inputs, outputs, and functions to run.
Provide a clear execution path for running AI models.
Are processed sequentially by the HEAL runtime script, ensuring correct execution order and data handling.
HEAL supports gradual integration and optimization:
We supply a comprehensive specification document that outlines all functions required in HEAL transcript.
Provided example implementations (in C++) serve as clear references and temporary solutions during initial hardware implementation stages.
The transcript is configurable and specifies which implementation layer to use for each function, allowing seamless integration of hardware and software implementations.
Hardware teams can implement functions incrementally (managing complexity and optimizing performance step by step), or implement only a subset of functions if their hardware doesn't support all capabilities.
Also, transcripts can be adapted to integrate optimized hardware-specific high-level functions (such as key_switch
), eliminating the need for extensive runtime modifications.
To ensure robust implementation:
HEAL offers an extensive suite of unit tests.
These tests, downloadable from GitHub, provide clear and standardized logs detailing pass/fail status and performance metrics.
The standardized test suite aids debugging, ensuring the correctness and reliability of hardware implementations.
Explore the HEAL and system →
→