Lattica HEAL Documentation
  • Getting Started with HEAL
  • Core Concepts Explained
    • Memory and Execution Model
    • Tensor
    • Transcript
    • Runtime
  • Interface Specifications
Powered by GitBook
On this page
  • Key Concepts
  • 1. Tensors as Core Data Structures
  • 2. Pointer-Based Function Interfaces
  • 3. Transcripts as Runtime Execution Records
  • 4. Flexible and Incremental Function Implementation
  • 5. Unit Tests and Validation Suite

Core Concepts Explained

PreviousGetting Started with HEALNextMemory and Execution Model

Last updated 9 days ago

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.

Key Concepts

1. Tensors as Core Data Structures

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.


2. Pointer-Based Function Interfaces

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.


3. Transcripts as Runtime Execution Records

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.


4. Flexible and Incremental Function Implementation

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.


5. Unit Tests and Validation Suite

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 →

→

Learn more about tensor design →
See detailed explanation of host/device interaction →
transcript
runtime
Review the function spec and implementation approach →
Download the test suite and explore validation tools
Page cover image