Skip to main content

Aidge logo

EPL 2.0 Examples PyPi Examples Documentation Status GitLab Contributors Open GitLab Issues Closed GitLab Issues

Aidge CPP Export

This module depends on aidge_core and registers generic C++ implementations for DNN operators.

Examples

If you want to generate exports and/or better understand how it works in Aidge, you may take a look at the following resources :

Quick start

System Requirements

  • python >= 3.10
pip install aidge-export-cpp

Static analysis of generated C/C++ code

Host C++ exports provide opt-in strict compilation and blocking analysis with Cppcheck and Clang-Tidy. These tools are system dependencies: installing Aidge does not install them. Install the profiles you intend to use and ensure the executables are available in PATH.

For example, on Debian or Ubuntu:

sudo apt install cppcheck clang-tidy

Select a profile through the Python export configuration:

from aidge_core.export_utils import export
from aidge_core.export_utils.config import ExportConfig

export(
    graph=model,
    config=ExportConfig(
        target="host",
        export_folder="export_model_float32_host",
        static_analysis="static-analysis",
    ),
    input_tensors=[input_tensor],
)

static_analysis is disabled by default. It accepts the following values:

Profile Behavior
strict Compile a separate binary with additional warnings promoted to errors.
cppcheck Run Cppcheck checks focused on likely defects.
cppcheck-strict Run broader Cppcheck style, performance and portability checks.
clang-tidy Run the Clang static analyzer checks.
clang-tidy-strict Add bug-prone, performance and portability checks.
static-analysis Run the standard Cppcheck and Clang-Tidy profiles.
static-analysis-strict Run both strict analyzer profiles.

Passing True is a convenience equivalent to running static-analysis and strict. Passing False or None disables the feature.

The same profiles are available as standalone targets in a generated host export:

cmake -S . -B build
cmake --build build --target strict
cmake --build build --target cppcheck
cmake --build build --target cppcheck-strict
cmake --build build --target clang-tidy
cmake --build build --target clang-tidy-strict
cmake --build build --target static-analysis
cmake --build build --target static-analysis-strict

The regular executable remains at build/run_export. The strict target writes its separate executable to build/strict/run_export. Analysis requested via the Python API is currently supported only by CMake-based exports; requesting it for a Make-based bare-metal target raises an explicit error.

🛠 Build from Source

Prerequisite (in addition to previous one):

1. Python installation using setup scripts

Environment Python Development
Windows .\setup.ps1 -Modules export_cpp -Tests
Unix ./setup.sh -m export_cpp --tests

2. Python Installation using pip

Run these commands from the aidge_export_cpp/ directory:

#fStandard install
pip install . -v

# Install with testing dependencies
pip install .[test] -v && pytest

Editable Install (Experimental)

Use this for real-time development without re-installing.

pip install --no-build-isolation -ve . --config-settings=editable.rebuild=true -Cbuild-dir=build

Export Support

The following models have been tested :

Model float32 int8
LeNet ✔ ✔
ResNet18 ❌ ✔

On the table above, validation is done using the aidge_cmp option, which evaluates the results between the aidge_backend_cpu and aidge_export_cpp kernels, with an absolute precision of 10^-3 (for float exports).

An example script is provided for each of these models (examples/export_<model_name>/<model_name>.py).

Metadata

Release files for aidge-export-cpp 0.10.1

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

Built distribution (wheel)

Table of built distributions (wheels) for aidge-export-cpp 0.10.1
File Interpreter ABI Platform
aidge_export_cpp-0.10.1-py3-none-any.whl Python 3 none any Details

Release files / aidge_export_cpp-0.10.1-py3-none-any.whl

Download URL aidge_export_cpp-0.10.1-py3-none-any.whl
Size 224.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
152652ed1a8ef71d3b895ce09538a2fe8965fecd6990f1fb0098e2b4c320a642
BLAKE2b-256 checksum
How to use checksums
422fa98ff5040c31e7796b110e45907023dd680e62292e73b5eef57a9be4aa0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.10.1 This release

1 release file

0.10.0

1 release file

0.9.1

1 release file

0.9.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

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