Quickstart¶
Build vAi and run the MNIST classifier example.
The MNIST classifier, from model definition to weight loading and execution, is contained in a single file, examples/mnist/main.cpp. The checkpoint is in data/ckpts/mnist/jroot/, and the input images are in data/images/.
1. Installation¶
1.1 Requirements¶
| GPU | Vulkan conformant (NVIDIA / AMD / Intel / Qualcomm) |
| Vulkan SDK | 1.3 or later, including glslc |
| CMake | 3.20 or later |
| Compiler | C++23 (gcc 14 or later) |
1.2 Clone¶
eva (the Vulkan wrapper) is a submodule and must be cloned along with the repository.
git clone --recursive https://github.com/vaistrata/vAi.git
cd vAi
git submodule update --init --recursive
1.3 Build¶
Build options:
| Option | Default | Description |
|---|---|---|
VAI_BUILD_MODEL_DEMO |
ON |
Model demos (demo-gpt2, demo-yolox, etc.) |
VAI_BUILD_EXAMPLES |
OFF |
Examples outside the models (demo-mnist, chat-llama3, chat-gemma3) |
VAI_BUILD_BENCH |
OFF |
Benchmarks against other inference frameworks |
VAI_BUILD_PYTHON |
OFF |
Python bindings |
1.4 Run¶
1.5 Results¶
An example output is shown below. Since the input is 0.png, check that class 0 has the largest value among the 10 logits.