gr00t-bonsai
Fine-tune NVIDIA GR00T N1.7 on one 24 GB GPU
NVIDIA recommends 40 GB+ to fine-tune GR00T N1.7: the default recipe peaks at 37 GB.
This repo runs it in 18 GB on an RTX 4090, at the same batch of 32.
English · 简体中文 · Results · Benchmarks · Limitations · FAQ
| Stock Isaac-GR00T | This repo | |
|---|---|---|
| Peak GPU memory, batch 32 | 37.0 GB on an A100, out of memory on 24 GB | 18.2 GB on an RTX 4090 |
| LIBERO-10, 3,000 steps, 3 seeds | 72.3 % | 72.0 % |
Same, with this repo's two noise draws per frame (K=2) |
83 % with fp32 AdamW, 32 × 2 in one pass (1 seed, 39.2 GB) | 83.7 % with 16 × 2 accumulated twice (3 seeds, 20.6 GB) |
| Weights + gradients + optimizer state | 16 bytes/param | 7.07 bytes/param (FlashAdamW-24: 7.14) |
| Batches a preempted run sees after resuming | 0/50 match the uninterrupted run | 50/50 match |
The claim is memory, not accuracy. In these runs the 24 GB recipe scored the same as stock, not better. Each score is 100 episodes (10 per task, about ±9 points), stock was evaluated on an A100 and this repo on an RTX 4090, and three seeds cannot rule out a gap under about 10 points. "Stock" means upstream's trainer with fp32 AdamW, started through this repo's launcher on the same dataset. Memory is in GiB as nvidia-smi reports it. Every number comes from a file in results/: see the results ledger and the limitations.
What is new here, and what is not
- Fitting N1.7 in 24 GB is not new. gr00t-on-4090 does it in about 21 GiB with paged 8-bit Adam, a bf16 load and gradient checkpointing, and evaluates on its own SO-101 task. In our probes
bitsandbytes.AdamW8biton fp32 weights also fits: 20.1 GB at 16 frames per step and 22.5 GB at 16 × 2. We did not probe it at 32 frames, where it probably fits too. Against that route this repo offers more headroom and a faster optimizer step. It has not been shown to be more accurate. - The optimizer builds on FlashOptim. FlashOptim already takes AdamW from 16 to 7 bytes per parameter with 8-bit moments. The int8 weight compensation here is its weight splitting, and
FlashAdamW-24fits this job just as well (18.3 GB, 481 ms/step against 18.2 GB, 469 ms). What differs is the encoding of the two moments. The only closed-loop comparison is one batch-16 run each, 38/100 forFlashAdamWand 46/100 forLowMemAdamW, which is within noise. K=2is a known technique (thediffusion_batch_mulof MAR, Mini Diffuser). The gain does not come from the memory work: the one fp32 run withK=2also scored 83.- What this repo adds: the 24 GB recipe measured over three seeds, a seeded LIBERO evaluator that runs one process per episode, a Lance data layer for GR00T, and resume that restores the data order. It also has optional per-block DiT activation checkpointing (upstream declares a
gradient_checkpointingflag that its forward pass never reads); that is used in one memory probe and in none of the published runs.
Quickstart
pip install gr00t-bonsai # torch and numpy only
# or from a clone:
git clone https://github.com/hly000/gr00t-bonsai && cd gr00t-bonsai
pip install -e . # torch and numpy only
python examples/standalone_lowmem_adamw.py # the optimizer on a toy model, CPU or GPU, under a minute
Fine-tune GR00T on 24 GB
Needs one 24 GB NVIDIA GPU and Isaac-GR00T checked out at $GR00T_ROOT (full requirements). It trains what upstream trains by default: the projector and DiT action head (1.62B parameters), with the VLM frozen.
MODE=lowmem24_b32 EMA_DECAY=0 MAX_STEPS=3000 TRAIN_SEED=42 N_EPISODES=10 \
DATASET=/data/datasets/libero_10_lance bash scripts/run_online_turbo.sh
MODE |
Frames × noise draws | Peak memory (RTX 4090) | 3,000 steps take | LIBERO-10, 3 seeds |
|---|---|---|---|---|
lowmem24_b32 |
32 × 1 | 18.2 GB | 28 min | 72.0 % |
lowmem24_mn2_ga2 |
16 × 2, accumulated twice | 20.6 GB | 32 min | 83.7 % |
The script checks the kernel, runs a 5-step smoke test, trains, then runs the seeded LIBERO-10 evaluation. The checkpoint loads in upstream run_gr00t_server.py. It reads a Lance dataset by default, which needs the install in the data section. The Isaac-GR00T commit used for these runs was not recorded, and the launcher patches upstream at run time, so a newer upstream may need fixes.
One 20,000-step run reached 90/100. NVIDIA's released LIBERO checkpoint scored 85 on the same evaluator and 91 and 93 on an A100, so read this as in the same range, not as a win: it is one seed with no 20,000-step stock baseline.
Use the optimizer anywhere
LowMemAdamW works with any PyTorch model that has bfloat16 weights. It does not need GR00T or Lance.
import torch
from gr00t_bonsai import LowMemAdamW
for p in model.parameters():
if p.ndim >= 2:
p.data = p.data.to(torch.bfloat16) # this snippet keeps 1-D parameters in fp32
optimizer = LowMemAdamW(model.parameters(), lr=1e-4, weight_decay=1e-5, comp_dtype="int8")
with torch.autocast("cuda", dtype=torch.bfloat16):
loss = model(batch)
loss.backward()
_, scale = optimizer.clip_scale(max_norm=1.0) # global-norm clip without rewriting the grads
optimizer.step(grad_scale=scale)
optimizer.zero_grad(set_to_none=True)
comp_dtype="int8" is what the 24 GB modes use; the default "bf16" takes one more byte per parameter. On the 1.62B-parameter action head (RTX 4090) it is level with FlashAdamW-24: 22.35 ms/step and 7.07 bytes/param against 23.18 ms and 7.14. bitsandbytes.AdamW8bit takes 47.90 ms at 10.05 bytes/param on fp32 weights. Full table · runnable example with EMA
Stream from S3 or GCS, resume in the same data order
Train from object storage with no download first. After a Spot preemption, the resumed run reads the same batches the uninterrupted run would have (50/50 batch fingerprints matched in one 80-step test; stock reseeds its loader). This is a guarantee about data order, not about bit-identical weights.
pip install gr00t-bonsai
gr00t-bonsai-data-setup # installs and verifies the data layer, about 90 seconds
The second command exists because two requirements are not on PyPI, so pip install "gr00t-bonsai[cloud]" alone cannot resolve them: lancedb>=0.42.0b26 is a prerelease on LanceDB's own package index, and lerobot-lancedb is needed at a GitHub commit newer than its PyPI release. gr00t-bonsai-data-setup --dry-run prints the pip commands it runs.
From a clone, pip install -e . and the same second command. Then, for example:
# convert a GR00T v2.1 dataset (videos are referenced, not copied)
gr00t-lance-convert --src s3://my-bucket/my-v2-dataset --out s3://my-bucket/my-v2-lance --video-mode external
The training script above reads Lance through scripts/launch_finetune_lance.py. Measurements: Benchmarks.
How it works
LowMemAdamWstores weights in bf16 and carries the rounding error of each update in one int8 per weight (FlashOptim's scheme). The second moment is an 8-bit code with a 5-bit exponent and 3-bit mantissa, the first moment is stored asm/√vin int8, and both use stochastic rounding.- Multi-noise flow matching runs the frozen VLM once per batch and trains the action head on
Kstratified timesteps and noise draws per frame. - DiT activation checkpointing (5 in the figure) is optional and off in the published modes.
CpuShadowEMAkeeps an optional fp32 EMA in host RAM instead of on the GPU.
Isaac-GR00T is not forked or patched on disk: everything is applied at run time.
Limitations
- Measured only on GR00T N1.7-3B with the VLM frozen, on LIBERO-10 and one LIBERO-Spatial run.
- Evaluations are 100 episodes, not the usual 500, and rollouts are not deterministic: the same checkpoint with the same seeds differed on 12 of 100 episodes.
- The stock and 24 GB arms were trained and evaluated on different machines.
- Memory figures are 30-step probes, not peaks over a full run.
K=2costs about 17 % more training time and comes bundled with stratified timestep sampling. Neither an equal-computeK=1baseline nor that ablation has been run.- Keep 32 frames per optimizer step. In one run at the same step count, a batch of 16 scored 36 against 75.
- The Triton kernel is tested against the CPU reference on a GPU, but CI runs on CPU only.
The full list, with negative results and the differences from upstream, is in docs/LIMITATIONS.md. Commands that reproduce every table are in docs/BENCHMARKS.md.
Citation
@software{gr00t_bonsai_2026,
title = {gr00t-bonsai: 24 GB single-GPU fine-tuning, Lance streaming and Spot resume for NVIDIA Isaac-GR00T},
author = {{gr00t-bonsai contributors}},
year = {2026},
url = {https://github.com/hly000/gr00t-bonsai}
}
If you use the optimizer, please also cite FlashOptim.
Acknowledgments
Built on NVIDIA Isaac-GR00T, Hugging Face LeRobot and lerobot-lancedb, and evaluated with LIBERO. Parts of the code are adapted from Isaac-GR00T (Apache-2.0); see NOTICE. The optimizer follows FlashOptim for weight compensation and uses it and bitsandbytes as baselines; no code from either is included.
Contributions are welcome: see CONTRIBUTING.md and the changelog.
License
The code in this repository is licensed under Apache-2.0. See also NOTICE.
- NVIDIA Isaac-GR00T (runtime dependency): the upstream code is Apache-2.0. Model weights such as
nvidia/GR00T-N1.7-3Bare licensed separately under the NVIDIA Open Model License. You must accept that license to download and use the weights; this repository's Apache-2.0 license does not grant it. - LIBERO (evaluation): the LIBERO codebase is MIT; the demonstration datasets are CC BY 4.0.
This project is independent and is not affiliated with or endorsed by NVIDIA or LanceDB.
Metadata
Release files for gr00t-bonsai 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gr00t_bonsai-0.1.2.tar.gz | 239.6 kB | With provenance | Details for gr00t_bonsai-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gr00t_bonsai-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for gr00t_bonsai-0.1.2-py3-none-any.whl |
Total release size: 408.3 kB
Release files / gr00t_bonsai-0.1.2.tar.gz
| Download URL | gr00t_bonsai-0.1.2.tar.gz |
|---|---|
| Size | 239.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1da9decf3b0426e3c507b7ae535a96ddfaa02e64971799737fe732f420959d6
|
|
BLAKE2b-256 checksum How to use checksums |
d63b6b811e7e242d5ecb4d8bacafac568e6f29018ab6327f693a5920a573da13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / gr00t_bonsai-0.1.2-py3-none-any.whl
| Download URL | gr00t_bonsai-0.1.2-py3-none-any.whl |
|---|---|
| Size | 168.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e16a96eb03f27c44fefafa75a4400601bc5e11c17e7d57223bf24b336147334
|
|
BLAKE2b-256 checksum How to use checksums |
d3aa966da727a9867c2245f189a57fa694302682990efef0ed8e4b695d81ef69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logSecurity for gr00t-bonsai 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for gr00t_bonsai-0.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.