File size: 8,454 Bytes
4b5ff89 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | ---
license: openmdw-1.1
base_model:
- nvidia/Alpamayo2-Edge
datasets:
- nvidia/PhysicalAI-Autonomous-Vehicles
pipeline_tag: robotics
language:
- en
tags:
- alpamayo
- autonomous-driving
- vision-language-action
- model-compression
- pytorch
---
# alpamini
**NVIDIA Alpamayo 2 Edge at under a third of the FLOPs: ~93 ms per driving decision instead of 264β305 ms, with no
loss of accuracy.**
alpamini is a compressed [Alpamayo 2 Edge](https://huggingface.co/nvidia/Alpamayo2-Edge). It takes the same inputs
(6 cameras, 22 frames, ego history and a navigation instruction) and gives the same outputs (a 6.4 s trajectory and a
reasoning text), at 10.6 decisions per second on one RTX 5090. Full bf16 PyTorch: no quantization, no TensorRT.
**Code and setup:** [github.com/Rohit-R-Rao/alpamini](https://github.com/Rohit-R-Rao/alpamini)
<video src="https://huggingface.co/Rohit-R-Rao/alpamini/resolve/main/media/07981e6a.mp4" controls autoplay muted loop playsinline width="100%"></video>
*Closed loop in [AlpaSim](https://github.com/NVlabs/alpasim), bird's-eye view with each run's metrics. Left: Alpamayo 2 Edge. Right: alpamini. The camera view is cropped out of all videos: AlpaSim's scenes are reconstructions of real drives from NVIDIA's dataset, and its license doesn't allow redistributing that footage.*
## At a glance
| per decision, RTX 5090, bf16 | Alpamayo 2 Edge | alpamini |
|---|---|---|
| end-to-end latency (CUDA graphs on both) | 264β305 ms | **92β94 ms** |
| speedup | 1.0Γ | **2.8β3.3Γ** |
| native with frame caching too | 159β207 ms | **1.7β2.3Γ faster than that** |
| decision rate | 3.3β3.8 Hz | **10.6β10.9 Hz** |
| compute | 23.3 TFLOP | **6.6 TFLOP (3.6Γ fewer)** |
| GT FDE, 132 held-out samples | 4.60 m | **4.28 m** |
| mean lateral error | 0.241 m | **0.208 m** |
| closed loop, 9 scenes (mean score) | 0.97 | **1.00** |
| peak GPU memory | 5.9 GiB | 5.6 GiB |
## Quick start
Full setup steps (environment, PyTorch, flash-attn, Hugging Face access) are in the
[GitHub README](https://github.com/Rohit-R-Rao/alpamini#setup). In short:
```bash
git clone https://github.com/Rohit-R-Rao/alpamini && cd alpamini
pip install -e ".[dataset]"
pip install flash-attn==2.8.3 --no-build-isolation
python -m alpamini.example # drives a PhysicalAI-AV clip at 10 Hz and prints per-decision latency
```
```python
import alpamini
model = alpamini.load() # downloads nvidia/Alpamayo2-Edge + this repo's weights
out = alpamini.predict(model, raw_sample) # raw_sample = alpamayo2_edge's input dict
out["xyz"] # (1, 64, 3) trajectory, 10 Hz for 6.4 s, ego frame at t0
out["cot_text"] # reasoning text
```
Call `predict` once per decision, in time order, at 10 Hz: frames seen at earlier decisions are reused from a cache.
## How it works
Two stages own 97% of native's compute: the vision tower and the language model's prefill over the image tokens it
produces. alpamini cuts both, and replaces token-by-token reasoning with a single pass.
| part | Alpamayo 2 Edge | alpamini |
|---|---|---|
| per-camera resolution | full for all 6 cameras | front tele full, front wide 75%, the other 4 cameras 50% |
| vision tower (27 blocks) | 16 heads, MLP 4,304 | width-pruned to 12 heads, MLP 3,200, + a rank-64 adapter per block, retrained |
| past-frame image tokens | all | 25% kept at random (original positions); front tele and newest frames all kept |
| reasoning decode | autoregressive, one token per step | **one-shot**: 40 learned slots in one bidirectional pass (slot-only LoRA, rank 128) |
| frame caching | | vision features of earlier frames reused; 6 of 22 frames are new per decision |
| language model | | unchanged (downloaded from `nvidia/Alpamayo2-Edge`, not redistributed) |
| action expert | | retrained (10 Euler steps, as native) |
| ms per stage, RTX 5090 | Alpamayo 2 Edge | alpamini |
|---|---|---|
| preprocessing | 40β42 | 10β13 |
| vision | 95 | 24β25 |
| LM prefill | 67 | 29β30 |
| reasoning decode | 25β76 (grows with length) | 5.5 (any length) |
| action expert | 20β22 | 17 |
Training distills native (reasoning tokens, KV states, flow-matching targets) and adds ground-truth flow matching
plus explicit lateral and longitudinal trajectory losses, on 8,000 PhysicalAI-AV samples.
## Evaluation
**Open loop.** 132 held-out PhysicalAI-AV samples, 12 for each of 11 driving situations (stops, braking, turns, lane
changes, curves, cruise, β¦), 4 flow seeds each. Errors against the recorded future, in metres:
| | Alpamayo 2 Edge | alpamini |
|---|---|---|
| GT FDE (6.4 s) | 4.60 | **4.28** |
| lateral, 1 / 2 / 3 s | 0.019 / 0.073 / 0.150 | 0.019 / 0.069 / 0.142 |
| lateral, 6.4 s | 0.764 | **0.643** |
| lateral, mean over the horizon | 0.241 | **0.208** |
Native is teacher-forced on its own reasoning; alpamini runs its one-shot decode. At 1β3 s the differences are
within noise.
**Closed loop.** 10 AlpaSim scenes, one rollout each: 5 development scenes and 5 drawn at random from the public
evaluation set.
| scene | score, Alpamayo 2 Edge | score, alpamini | max lateral to GT, Alpamayo 2 Edge | max lateral to GT, alpamini |
|---|---|---|---|---|
| cdb709d1 | 0.76 | **1.00** | 2.89 m | 0.64 m |
| 6f3be572 | 1.00 | 1.00 | 0.21 m | 0.07 m |
| 6f34d20b | 1.00 | 1.00 | 3.59 m | 0.63 m |
| 02eadd92 | 1.00 | 1.00 | 2.36 m | 0.24 m |
| fe0c2168 | 1.00 | 1.00 | 3.50 m | 0.54 m |
| e39fb49b | 1.00 | 1.00 | 1.28 m | 0.57 m |
| 07981e6a | 1.00 | 1.00 | 0.28 m | 0.24 m |
| d7a656c2 | 1.00 | 1.00 | 0.95 m | 0.73 m |
| 023b7fcc | 1.00 | 1.00 | 0.44 m | 0.52 m |
| **mean** | 0.97 | **1.00** | 1.72 m | **0.46 m** |
The tenth scene, f41175b5, is not in the mean: its navigation command says *continue straight* for the whole scene,
while the recorded driver turns left. alpamini follows the command and is scored 0 for leaving the recorded corridor;
Alpamayo 2 Edge drifts left with the driver and scores 0.93.
<table>
<tr>
<td width="50%"><video src="https://huggingface.co/Rohit-R-Rao/alpamini/resolve/main/media/cdb709d1.mp4" controls muted loop playsinline width="100%"></video><br><b>cdb709d1</b>: Alpamayo 2 Edge stalls at 60% of the route with front and rear contacts; alpamini drives it through.</td>
<td width="50%"><video src="https://huggingface.co/Rohit-R-Rao/alpamini/resolve/main/media/6f34d20b.mp4" controls muted loop playsinline width="100%"></video><br><b>6f34d20b</b>: Alpamayo 2 Edge spends 8.5 s in the wrong lane, alpamini 0.3 s.</td>
</tr>
<tr>
<td width="50%"><video src="https://huggingface.co/Rohit-R-Rao/alpamini/resolve/main/media/6f3be572.mp4" controls muted loop playsinline width="100%"></video><br><b>6f3be572</b>: stop behind a lead car. Both stop cleanly.</td>
<td width="50%"><video src="https://huggingface.co/Rohit-R-Rao/alpamini/resolve/main/media/f41175b5.mp4" controls muted loop playsinline width="100%"></video><br><b>f41175b5</b>: the command says straight, the recorded driver turns left. alpamini goes straight.</td>
</tr>
</table>
All 10 side-by-side videos are in [`media/`](https://huggingface.co/Rohit-R-Rao/alpamini/tree/main/media).
## Limitations
- Closed-loop evaluation covers 10 scenes with one seed each. That is evidence it works, not a safety validation.
- Not bit-identical to the eager path: frame caching and CUDA graphs change bf16 rounding. Trajectories move by at
most 0.03 m, and the reasoning text can change.
- The one-shot reasoning text can come out garbled; the trajectory doesn't depend on its exact wording.
- About 2.68 B parameters vs 2.65 B for native. The speedup comes from fewer tokens, a narrower vision tower and
one-shot decoding, not from a smaller model.
- Tuned on PhysicalAI-AV camera rigs; other rigs and resolutions are untested.
- Evaluated offline and in simulation only. Not for use in a vehicle on public roads.
## Files
| file | contents |
|---|---|
| `alpamini.safetensors` | every tensor that differs from native: vision tower, projector, action expert, slot embeddings and slot LoRA |
| `alpamini.json` | weight metadata |
| `alpamini/` | the runtime package (also on GitHub) |
| `media/` | closed-loop side-by-side videos |
## License
The weights are a modification of Alpamayo 2 Edge's Model Materials and are distributed under
[OpenMDW-1.1](https://openmdw.ai/license/1-1/) (`LICENSE`). The code (`alpamini/`) is Apache-2.0. See `NOTICE`.
This is independent work, not affiliated with or endorsed by NVIDIA.
|