Skip to main content

GAIA-ML

GAIA-ML is an experimental compiler that turns ONNX models into optimized C++ kernels and graphs for AMD AI Engine v1, targeting the Versal Premium VP2802-2M.

Features

  • Dense/MLP networks, supported CNN patterns and bounded tree ensembles.
  • Float32, int32, int16 and int8 neural-network kernels.
  • Custom model-local ONNX functions using supported float32 arithmetic and tensor operations.
  • Operation fusion, weight packing and implementation selection across AIE tiles.
  • Scheduling for first-output latency, steady-state output interval or event bursts.
  • New opt-in surrogate selection for supported FP32 CNN row kernels and tensor reductions, plus vectorized reductions of up to 4096 elements.

GAIA generates an ADF graph, C++ kernels, weights, test vectors and build files. Generating a project does not require Vitis. Building and simulating the emitted AIE code requires the AMD toolchain separately.

Install

From a checkout, with Python 3.9 or newer:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .
gaia_ml version

Compile a model

Inspect the model and target constraints, then generate a project:

gaia_ml inspect model.onnx --stage constraints

gaia_ml compile model.onnx \
  --output gaia_project \
  --schedule-objective latency \
  --data-file input.csv \
  --simulation-events 10

Each CSV row is one flattened input event; provide at least as many rows as --simulation-events. For dynamic inputs, supply a static --input-shape, for example --input-shape 1,3,18,18. Use a new output directory or --force to regenerate an existing project.

Useful compilation options:

Option Purpose
--aggressive-latency-search Explore more supported implementation and tile choices.
--latency-metric first-output Prioritize the first completed inference.
--latency-metric interval Prioritize spacing between successive outputs.
--latency-metric balanced Balance first-output latency and output interval.
--latency-metric burst --burst-events 100 Prioritize completion of a 100-event burst.
--quantize int8 Generate integer kernels; also accepts int16 and int32.
--max-tiles 16 Limit the available compute tiles.
--cnn-row-kernel surrogate --cnn-row-surrogate selection.json Use a supplied trained selection bundle for supported FP32 7×7, stride-3 CNN row kernels.

Surrogate selection requires a trained bundle for the supported compute family. Use gaia_ml compile --help for all options, including tensor microkernel selection. The generated manifest.json records resource use, the selected schedule and estimated latency.

Build and validate

After loading your AMD Vitis environment:

cd gaia_project
make aie
make aiesim
cd ..
gaia_ml verify gaia_project

Latency estimates guide optimization; validate numerical accuracy and measured timing for your model with the external AMD toolchain.

Developed by the NGT WP2.1 Group. Core developer: Ioannis Xiotidis. Distributed under the MIT license.

Metadata

Release files for gaia-ml 0.13.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gaia-ml 0.13.21
File Size Uploaded
gaia_ml-0.13.21.tar.gz 520.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gaia-ml 0.13.21
File Interpreter ABI Platform
gaia_ml-0.13.21-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / gaia_ml-0.13.21.tar.gz

Download URL gaia_ml-0.13.21.tar.gz
Size 520.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fc3aa3be96deab62c7a169e17f0c9f89a936df1be24927449651dce51e09704a
BLAKE2b-256 checksum
How to use checksums
3e72c13237f8fd61714e08eb1622b4993d71c81d3d98e486248766adf6426ddd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / gaia_ml-0.13.21-py3-none-any.whl

Download URL gaia_ml-0.13.21-py3-none-any.whl
Size 532.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c60aeeff0de5f96811791f8eea65d3e0c5e9786bcc9131c44ca65f0facf206c3
BLAKE2b-256 checksum
How to use checksums
77bdac5f021b8faab82f24bae7a20eb3e33d9cd50f71746f12d21da5d30c1952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

This release

0.13.21 This release

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.6.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page