Skip to main content

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.

License: Apache-2.0 Python 3.10+ PyTorch: tested on 2.8 and 2.9 Tests

English · 简体中文 · Results · Benchmarks · Limitations · FAQ

Peak GPU memory (stock 37.0 and 39.2 GiB, this repo 18.2 and 20.6 GiB) and LIBERO-10 success after 3,000 steps (72.3 vs 72.0 with one noise draw, 83.0 vs 83.7 with two), stock on an A100 and this repo on an RTX 4090
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.AdamW8bit on 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-24 fits 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 for FlashAdamW and 46/100 for LowMemAdamW, which is within noise.
  • K=2 is a known technique (the diffusion_batch_mul of MAR, Mini Diffuser). The gain does not come from the memory work: the one fp32 run with K=2 also 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_checkpointing flag 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, git-lfs, ffmpeg, uv, and a Hugging Face login that has accepted the terms of the gated nvidia/Cosmos-Reason2-2B (full requirements). It trains what upstream trains by default: the projector and DiT action head (1.62B parameters), with the VLM frozen.

# 1. Isaac-GR00T, installed its own way (checked at commit 708617f)
git clone https://github.com/NVIDIA/Isaac-GR00T && cd Isaac-GR00T && git lfs pull
uv sync --python 3.12

# 2. this repository, into the same environment
git clone https://github.com/hly000/gr00t-bonsai ../gr00t-bonsai
uv pip install -e ../gr00t-bonsai
.venv/bin/gr00t-bonsai-data-setup     # detects Isaac-GR00T and leaves its packages unchanged

# 3. a dataset: LIBERO-10 in the LeRobot v2.1 format upstream uses
.venv/bin/hf download --repo-type dataset IPEC-COMMUNITY/libero_10_no_noops_1.0.0_lerobot \
  --local-dir examples/LIBERO/libero_10_no_noops_1.0.0_lerobot
cp examples/LIBERO/modality.json examples/LIBERO/libero_10_no_noops_1.0.0_lerobot/meta/

# 4. train
export GR00T_ROOT=$PWD
cd ../gr00t-bonsai
MODE=lowmem24_b32 BACKEND=native EVAL=0 EMA_DECAY=0 MAX_STEPS=3000 TRAIN_SEED=42 OUT_ROOT=$PWD/runs \
  DATASET=$GR00T_ROOT/examples/LIBERO/libero_10_no_noops_1.0.0_lerobot 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, then trains; the checkpoint loads in upstream run_gr00t_server.py. These steps were run as written on a rented RTX 4090 for 20 steps (peak 18.2 GB).

  • BACKEND=native reads the LeRobot v2.1 directory with upstream's loader. The published runs used BACKEND=lance on a converted dataset, which trains the same way (data section).
  • EVAL=0 skips the LIBERO evaluation, which needs upstream's simulator environment (gr00t/eval/sim/LIBERO/setup_libero.sh). With it installed, drop EVAL=0 and add N_EPISODES=10 for the 100-episode protocol.
  • The launcher patches upstream at run time, so a newer Isaac-GR00T 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.

Run the conversion tools from an environment like this one, not from inside Isaac-GR00T's: lerobot needs a newer huggingface-hub and numpy than GR00T pins. Inside Isaac-GR00T's environment the same command installs only what training from Lance needs.

# 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

24 GB fine-tuning pipeline: Lance dataset, frozen bf16 VLM backbone, K noise draws per frame, the trainable action head, LowMemAdamW, and optional DiT activation checkpointing
  • LowMemAdamW stores 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 as m/√v in int8, and both use stochastic rounding.
  • Multi-noise flow matching runs the frozen VLM once per batch and trains the action head on K stratified timesteps and noise draws per frame.
  • DiT activation checkpointing (5 in the figure) is optional and off in the published modes.
  • CpuShadowEMA keeps 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=2 costs about 17 % more training time and comes bundled with stratified timestep sampling. Neither an equal-compute K=1 baseline 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-3B are 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.3

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

Source distribution (sdist)

Source distribution for gr00t-bonsai 0.1.3
File Size Uploaded Provenance Actions
gr00t_bonsai-0.1.3.tar.gz 242.4 kB With provenance Details for gr00t_bonsai-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gr00t-bonsai 0.1.3
File Interpreter ABI Platform Actions
gr00t_bonsai-0.1.3-py3-none-any.whl Python 3 none any Details for gr00t_bonsai-0.1.3-py3-none-any.whl

Total release size: 412.9 kB

Release files / gr00t_bonsai-0.1.3.tar.gz

Download URL gr00t_bonsai-0.1.3.tar.gz
Size 242.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2606e15d454940a5ff3b3d727a79b0f4056497a4fefa6f25cc1851c04133ab1a
BLAKE2b-256 checksum
How to use checksums
fa4640f0730d2bbe0f540cce9eb7b019819e2a8447a8a15395e14617157ab493
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 29, 2026.

Transparency log

Release files / gr00t_bonsai-0.1.3-py3-none-any.whl

Download URL gr00t_bonsai-0.1.3-py3-none-any.whl
Size 170.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb361ae09fbfe5cc2619872f0b9892cc3c2c2c9f7a42f1b40a2ffb0fdd74be7f
BLAKE2b-256 checksum
How to use checksums
f5dc2192ba0464b9ca1560b7a9b76a72fe420573f7a526907380d27f6232cd09
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 29, 2026.

Transparency log

Security for gr00t-bonsai 0.1.3

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.

Select from 2 files

Attestation for gr00t_bonsai-0.1.3.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 29, 2026.

Transparency log

A 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.

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