Building from source¶
AIMET provides a single script, scripts/all/build_and_test.py, to build wheels, run unit
tests, and build documentation across Linux, Windows, and macOS. It manages virtual environment
creation, system dependency installation, and CMake/scikit-build-core configuration so you don’t
need to set any of that up by hand.
Prerequisites¶
Python 3.10 or newer.
uv: the script installs it automatically if missing (
--task install_deps), or install it yourself with:curl -LsSf https://astral.sh/uv/install.sh | sh
(Optional, GPU builds only) NVIDIA CUDA Toolkit. See NVIDIA’s installation guide.
Quick start¶
# cd to the AIMET root directory
cd aimet/
# Build aimet-torch (CPU)
python3 scripts/all/build_and_test.py --task build --package aimet_torch
# Build aimet-torch (GPU/CUDA)
python3 scripts/all/build_and_test.py --task build --package aimet_torch --gpu
# Build aimet-onnx (CPU)
python3 scripts/all/build_and_test.py --task build --package aimet_onnx
# Build aimet-onnx (GPU/CUDA)
python3 scripts/all/build_and_test.py --task build --package aimet_onnx --gpu
# Build documentation (wheelhouse/Docs/releases/<version>/index.html)
python3 scripts/all/build_and_test.py --task build --package docs
The script creates and reuses a venv at aimet-dev/ by default (override with --venv), and
installs system dependencies on first run (install_deps, a dependency of build) – no
separate setup step is required.
Editable installs for local development¶
python3 scripts/all/build_and_test.py --task build --package aimet_torch --gpu -e
Running tests¶
test builds the package first (if needed) and then runs its unit test suite:
# Build (if needed) and run aimet-onnx unit tests
python3 scripts/all/build_and_test.py --task test --package aimet_onnx
# Run tests only, skipping the build step
python3 scripts/all/build_and_test.py --task test --package aimet_torch --only
# Force a rebuild before testing
python3 scripts/all/build_and_test.py --task test --package aimet_torch --force-rebuild
Common options¶
Option |
Description |
|---|---|
|
|
|
Enable GPU/CUDA support (default: CPU only). |
|
Install in editable mode for local development. |
|
Force a rebuild/reinstall even if the package is already installed. |
|
Number of parallel pytest workers (default: 8). |
|
Virtualenv directory to create/use (default: |
|
Run only the requested task, skipping its dependencies. |
|
Print the execution plan without running it. |
Run python3 scripts/all/build_and_test.py --task list to see every available task, or
--help for the full option reference.