Commit Graph

1586 Commits

Author SHA1 Message Date
lbenhorin 5bbdf02750 docs(groot): update training command with image transformation parameters 2026-07-03 15:31:18 +03:00
lbenhorin a28e93f009 Merge branch 'docs/groot-train-eval-commands' into nvidia-gr00t-n17-lerobot 2026-07-03 15:29:32 +03:00
lbenhorin 18a1342ecd docs(groot): remove optional Flash Attention setup instructions and update base model path for evaluation 2026-07-03 15:28:19 +03:00
Andy Wrenn 234ad0c9c7 Remove sample so101 training command 2026-07-03 05:24:49 -07:00
Andy Wrenn 7e2178e66b Add sample so101 training command 2026-07-03 05:20:49 -07:00
lbenhorin 0a1c2cb76c docs(groot): update training and rollout commands with new parameters and dependencies 2026-07-03 12:02:08 +03:00
nv-sachdevkartik a17da38b2a docs(groot): remove checkpoint download note above LIBERO eval 2026-07-02 14:21:30 +00:00
nv-sachdevkartik e99c65f38a docs(groot): restore suite checkpoint download intro sentence 2026-07-02 14:10:09 +00:00
nv-sachdevkartik e88a0d6aef docs(groot): drop hf download step from LIBERO eval, fix intro 2026-07-02 14:09:48 +00:00
nv-sachdevkartik 488650678b docs(groot): use $BASE_MODEL for base_model_path in LIBERO eval 2026-07-02 14:06:03 +00:00
nv-sachdevkartik 92beebcaa9 docs(groot): remove LIBERO checkpoints subdirectory section 2026-07-02 14:05:06 +00:00
nv-sachdevkartik 602d710a73 docs(groot): add LIBERO training command example 2026-07-02 14:02:02 +00:00
nv-sachdevkartik 8a60f06a75 docs(groot): use literal HF repo IDs for dataset/policy repo_id
Public-facing Hub references (--dataset.repo_id, --policy.repo_id) shown as
concrete IDs; local-only values ($OUTPUT_DIR, $JOB_NAME) stay as placeholders.
2026-07-02 13:01:04 +00:00
nv-sachdevkartik be0bfd90cd docs(groot): keep BASE_MODEL export in training command 2026-07-02 12:52:58 +00:00
nv-sachdevkartik a8ded211aa docs(groot): drop export block, reference env vars directly
Use $DATASET_ID / $BASE_MODEL / $REPO_ID / $OUTPUT_DIR / $JOB_NAME as
bare placeholders in the commands without concrete export assignments.
2026-07-02 12:52:38 +00:00
nv-sachdevkartik 62ff497ebc docs(groot): parameterize commands with env vars + fill LIBERO results
- Introduce BASE_MODEL / DATASET_ID / REPO_ID / JOB_NAME / OUTPUT_DIR env vars
  in the training command and reuse OUTPUT_DIR + BASE_MODEL in the rollout cmd.
- Fill the LIBERO benchmark table with GR00T-LeRobot success rates
  (Spatial 94%, Object 98%, Goal 93%, LIBERO 10/Long 90%; avg 93.75%),
  drop the OSS column and XX placeholders. LeRobot-focused.
2026-07-02 12:49:35 +00:00
nv-sachdevkartik 9ec4530248 docs(groot): update Training & hardware Evaluation commands
Replace the multi-GPU accelerate-launch Training snippet with the current
single-command 'uv run lerobot-train' N1.7 recipe (relative actions excluding
gripper, bf16, flash attention, chunk/n_action_steps=16, bs64/20k steps).

Replace the bimanual 'Evaluate in your hardware setup' rollout example with the
SO-101 follower RTC 'uv run lerobot-rollout' command (strategy.type=base,
inference.type=rtc, wrist+front cameras, place-the-vial task).

Docs-only; no source/test changes.
2026-07-02 12:41:13 +00:00
acwrenn53 1ce1c01337 Merge pull request #42 from johnnynunez/split/groot-n17-train-random-crop
feat(groot): train-time random crop for N1.7 (crop geometry only, zero new deps)
2026-07-02 03:18:43 -07:00
johnnynunez f53490c15e feat(groot): train-time random crop for N1.7 (eval keeps center crop)
Isaac-GR00T crops a random crop_fraction window during training and the
deterministic center window at eval, replaying the sampled window across all
camera views of a sample. This contract is unchanged since the N1.5 release
(gr00t/data/transform/video.py: "If mode is 'train', return a random crop
transform. If mode is 'eval', return a center crop transform.") and mirrors
LeRobot's own Diffusion/VQBeT crop_is_random pattern. The LeRobot N1.7 port
used the eval center crop for training too, so the fine-tuned projector/DiT
never sees frame borders and trains on a single fixed appearance point.

Scope: crop geometry ONLY - no color jitter, no new dependencies. The random
window is plain numpy slicing inside the existing cv2 eval transform:

- _transform_n1_7_image_for_vlm_albumentations gains crop_position=(y, x)
  fractions; None keeps the center crop byte-identical to before (verified
  by test)
- GrootN17VLMEncodeStep gains a runtime-only 'training' flag (never
  serialized; reloaded pipelines default to eval); training samples ONE
  window per sample and reuses it across (timestep, view) frames - Isaac's
  cross-view consistency
- gated on torch.is_grad_enabled() so no_grad validation and frozen-eval
  paths are unaffected
- wired via dataset_meta is not None in make_groot_pre_post_processors and
  the existing _set_groot_preprocessor_training on serialized reloads

Verification: tests/policies/groot/test_groot_train_random_crop.py (8 passed:
center-crop bit-exactness with crop_position=None, corner/center windows,
cross-view replay, train!=eval, no_grad gating, seed reproducibility,
serialization contract) + groot suite 23 passed / 5 skipped on RTX PRO 6000 /
CUDA 13.3.
2026-07-02 03:17:47 +02:00
acwrenn53 459d416bbf Merge pull request #41 from johnnynunez/split/groot-n17-state-dropout
feat(groot): activate checkpoint-configured N1.7 raw-state dropout during training
2026-07-01 16:16:48 -07:00
acwrenn53 bb6f5a2c7e Merge pull request #39 from johnnynunez/split/groot-n17-training-optim-contract
fix(groot): align N1.7 fine-tuning optimizer/scheduler/precision with Isaac-GR00T
2026-07-01 16:16:34 -07:00
johnnynunez f42cdcf137 fix(groot): align N1.7 fine-tuning optimizer/scheduler/precision with Isaac-GR00T
Evidence from the LeRobot-vs-OSS checkpoint comparison: the LeRobot/HF 8k
checkpoint's DiT moved only ~19% as far from base as the OSS-trained one
(0.0547 vs 0.285 relative L2) - undertrained because the scheduler decayed over
a hardcoded 10k steps regardless of --steps, on top of beta1/clip mismatches.

- AdamW betas (0.95, 0.999) -> (0.9, 0.999) and grad_clip_norm 10.0 -> 1.0
  (Isaac defaults)
- scheduler: hardcoded CosineDecayWithWarmup(10k decay, floor 10% peak) ->
  DiffuserSchedulerConfig HF cosine with ceil(max_steps * warmup_ratio) warmup,
  deriving num_training_steps from the outer --steps at runtime
- model_params_fp32 (default true): keep master weights in FP32 and compute
  under BF16 autocast like the native N1.7 recipe (fixes optimizer-update
  numerics vs pure-BF16 params)
- weight-decay grouping via transformers get_parameter_names: biases and norm
  parameters excluded from decay
- restore the TF4 lm_head/embedding weight tie so the unused Qwen LM head stays
  frozen and deduplicated in checkpoints
- action_mask kept in native dtype for the masked flow-matching loss
- drop_n_last_frames: exclude episode tails that cannot supply a complete
  action chunk (Isaac sampler behavior)

Verification: tests/policies/groot/test_groot_training_optim_contract.py
(7 passed) + remaining groot suite 11 passed/5 skipped on RTX PRO 6000 /
CUDA 13.3. Note: tests/policies/groot/test_groot_n1_7.py does not collect on
the base branch (pre-existing ImportError, fixed in PR #37).
2026-07-02 01:04:23 +02:00
johnnynunez 20c0f07858 feat(groot): activate checkpoint-configured N1.7 raw-state dropout during training
Isaac-GR00T applies dual state regularization during fine-tuning: raw-state
zeroing driven by the processor sidecar's state_dropout_prob (0.2 for the
inspected N1.7 checkpoint) plus encoded-feature dropout. Baseline LeRobot kept
the processor in deterministic mode, so the raw-state dropout never activated
(RCA Tier-2 contributor to the LeRobot-trained SO-101 failures).

- GrootN17PackInputsStep: runtime-only 'training' flag + state_dropout_prob;
  whole-sample state zeroing gated on torch.is_grad_enabled() so eval and
  no_grad validation paths are unaffected
- sidecar loader reads state_dropout_prob from processor_config.json
- state_dropout_prob serializes with the step; the training flag intentionally
  does not (reloaded pipelines default to eval, re-enabled only when processors
  are rebuilt with dataset_meta)
- _set_groot_preprocessor_training toggles any dataclass step exposing a
  'training' field on serialized-pipeline reloads

Verification: tests/policies/groot/test_groot_state_dropout.py (4 passed) on
RTX PRO 6000 / CUDA 13.3.
2026-07-02 00:54:20 +02:00
Andy Wrenn da9ce79678 fix(groot): make N1.7 letterbox opt-in 2026-06-30 15:46:56 -07:00
Steven Palma c74eb20abd fix(test): add guard 2026-06-30 15:46:56 -07:00
Steven Palma 22c1d0765a chore(policies): add explicit dataset dependecy to gr00t implementation 2026-06-30 15:46:56 -07:00
Steven Palma 86e60499d0 chore(groot): move cv2 to the top as its in the default install tag 2026-06-30 15:46:56 -07:00
Steven Palma 73c3a66d51 fix(ci): guard dependecy checks 2026-06-30 15:46:56 -07:00
Steven Palma b422269de4 fix(style): pre-commit 2026-06-30 15:46:56 -07:00
Steven Palma 44b6950f06 chore(policies): add guards, warnings and comments + recover tests n1.5 check 2026-06-30 15:46:56 -07:00
Andy Wrenn 4a3f46d0ec Format GR00T OSS parity changes 2026-06-28 12:55:42 -07:00
Andy Wrenn bdc05c89e3 Apply LIBERO action decode override after loading 2026-06-28 12:55:42 -07:00
Andy Wrenn 1fcc100790 Match GR00T N1.7 OSS preprocessing and relative actions 2026-06-28 12:55:42 -07:00
Andy Wrenn 6126a85d60 Guard GR00T relative action stepwise decode 2026-06-28 12:55:42 -07:00
Andy Wrenn 2ed55d2a77 Move GROOT relative stats out of train script 2026-06-28 12:55:42 -07:00
Andy Wrenn 31f7979498 Revert "Reset rollout state after robot episode end"
This reverts commit 1322f45aec.
2026-06-28 12:55:42 -07:00
Andy Wrenn b8dcc51f35 Reset rollout state after robot episode end 2026-06-28 12:55:42 -07:00
Andy Wrenn ab351fa3b0 Fix GROOT relative action padding and RTC leftovers 2026-06-28 12:55:42 -07:00
Andy Wrenn 977e00a4e5 Fix GROOT relative action training stats 2026-06-28 12:55:42 -07:00
Andy Wrenn f25b97936e Fix GROOT N1.7 relative action stats 2026-06-28 12:55:42 -07:00
Andy Wrenn 0a588064d4 Address GROOT relative action review feedback 2026-06-28 12:55:42 -07:00
Andy Wrenn 679fe3621e Fix GROOT relative action training stats 2026-06-28 12:55:42 -07:00
Andy Wrenn 5a83db89de Remove PIL fallback from GR00T preprocessing 2026-06-28 12:55:42 -07:00
Andy Wrenn ee41109d35 Optimize GR00T N1.7 image preprocessing 2026-06-28 12:55:42 -07:00
Steven Palma 229299d937 refactor(groot): N1.7 style cleanup (utils, imports, flash-attn, config)
Mechanical refactor of the GR00T N1.7 policy to match the repo's architecture and
style standards. No change to policy algorithm/numerics; only UX/CLI and packaging
changes. Tests are intentionally left untouched (out of scope) and need updating
for the removed `model_version` field.

Cleanup & consolidation:
- Add `groot/utils.py` holding the pure, side-effect-free helpers (JSON I/O, value
  coercion, stat flattening, rot6d/SE3 math, language/batch prep) shared by the
  config and processor layers.
- Remove dead code: the unused `resolve_groot_n1_7_backbone_model` cache-resolver
  cluster, `GR00TN17Config.to_filtered_dict/json`, and the `_copy_default` wrapper.

Imports & execution guards:
- Hoist nested imports to module top; relative imports within the package, absolute
  for external modules. The version-gated Qwen3-VL classes import under the single
  `_transformers_available` guard (transformers is pinned >=5.4, which ships them).
- No import-time side effects: `_register_with_transformers()` now runs in
  `GR00TN17.__init__` (idempotent via `register(exist_ok=True)`), and the N1.5 step
  stubs register lazily before pipeline deserialization (idempotent via the
  registry, no run-once globals).
- Gate optional deps at the point of use with `require_package(..., extra="groot")`.

Dependencies & docs:
- Drop `flash-attn` (and its build-only dep `ninja`) from the `groot` extra; default
  to SDPA (numerically equivalent) with opt-in via `--policy.use_flash_attention`.
  Un-comment `lerobot[groot]` in the `all` extra and regenerate `uv.lock`.
- Rewrite the `groot.mdx` install section: flash-attn is a purely optional,
  user-managed optimization that LeRobot neither installs nor requires.

Config & CLI:
- Surface previously-frozen knobs on `GrootConfig` (plumbed into `GR00TN17Config`;
  no-ops at their defaults): inference — `num_inference_timesteps`, `rtc_ramp_rate`,
  `use_flash_attention`; fine-tuning — `tune_top_llm_layers` (partial-LLM tuning)
  and `tune_vlln` (previously hardwired to True).
- Convert the single-valued `model_version` and `n1_7_backbone_model` fields to
  internal constants.
- Keep `base_model_path`: it is NOT equivalent to `pretrained_path` (raw NVIDIA
  checkpoints have no LeRobot `type` field and load only via `base_model_path`) and
  is genuinely user-tunable.
- Keep the deprecated Isaac-GR00T/N1.5 fields (and the dead LoRA fields) as a
  back-compat block so a v0.5.1 N1.5 `config.json` still parses under draccus and is
  rejected with the friendly N1.5 removal message instead of an opaque decode error.
2026-06-28 12:55:42 -07:00
Steven Palma 5fe9fe0050 fix(groot): GPU/tensor N1.7 image preprocessing + resize to trained resolution
GR00T training was dataloader-bound (0->100->0 GPU-utilization sawtooth).
GrootN17VLMEncodeStep ran the Qwen3-VL image processor per frame on PIL images
on the single CPU main-loop thread, and that cost is timed inside dataloading_s
(preprocessor(batch) runs in the main process, not the dataloader workers), so
adding workers cannot hide it.

- Feed the torchvision-backed Qwen3-VL processor (C,H,W) uint8 tensors instead
  of a per-frame Image.fromarray PIL roundtrip, and run resize/normalize/patchify
  on config.device (GPU) when available. Bit-identical on CPU when no resize is
  configured; with a resize only the PIL->torchvision bicubic backend differs
  (<2/255 per pixel). The use_albumentations path stays PIL/cv2; reload on a box
  without the saved device falls back to CPU.

- Default image_target_size/crop to the N1.7 backbone's training geometry
  (256x256 / 230x230) when a checkpoint ships no image sizing (checkpoint_assets
  is None, e.g. finetuning nvidia/GR00T-N1.7-3B via repo-id with a new
  embodiment). Previously image_target_size=None disabled the resize, so
  full-resolution frames were patchified into ~4.7x more vision tokens than the
  model was trained on -- inflating dataloading_s (patchify) and update_s (VLM
  sequence) and skewing the input distribution. Checkpoints that pin their own
  sizing are honored; the default constants are shared with GR00T_N1_7_DEFAULTS.

Net: preprocessing leaves the CPU critical path and the VLM sees the resolution
it was trained on -- faster training/inference and a correct train/serve
distribution. Affects inference too (shared preprocessor); existing checkpoints
still load (backward compatible) but must be retrained to gain the benefits.
2026-06-28 12:55:18 -07:00
Steven Palma 0e49933773 fix(groot): skip normalization overrides for training 2026-06-28 12:55:18 -07:00
Steven Palma 286ba4456f fix(groot): N1.7 config defaults, N1.5 rejection, and processor/model runtime fixes
Covers the GR00T N1.7 source trio (configuration, processor, model wrapper).

Config:
- GrootConfig defaults are the N1.7 values; explicitly passed legacy N1.5-era
  values (chunk_size=50, max_state_dim=64, ...) are remapped with a warning
  instead of silently.
- action_decode_transform gains an 'auto' sentinel so an explicit 'none'
  opt-out wins over the libero_sim default and survives save/load round-trips.
- action_delta_indices is cached on the inputs that determine it.
- Legacy N1.5 checkpoints/configs (tokenizer_assets_repo, model_type/
  architectures/eagle backbone markers) are rejected with a single clear
  error pointing to lerobot==0.5.1.

Processor:
- GrootN17ActionDecodeStep handles the 2-D (B, D) actions delivered by sync
  select_action (relative eef/non-eef decode in eval/record flows).
- Postprocessor falls back to dataset stats when a raw checkpoint lacks the
  configured embodiment tag; raw-state cache is per-instance, not
  process-global; caller overrides (device, rename_map) are honored on the
  raw-checkpoint branch.
- Camera/modality-key mismatches warn (including the zero-match fallback);
  deprecated Qwen2VLImageProcessorFast replaced with Qwen2VLImageProcessor;
  removed N1.5 processor steps are stubbed to raise the removal guidance and
  the action-unpack step is re-registered as _v2.

Model:
- Flash-attention probe is diagnostic-only; forward raises on a missing loss;
  print() replaced with logging; N1.5 base-path mismatch includes the
  removal guidance.
2026-06-28 12:55:18 -07:00
Steven Palma 42ab929ce2 fix(groot): N1.7 backbone loading and DiT parameter-count logging
- select_layer default tracks the N1.7-3B checkpoint value (16); real
  checkpoint loads still override it from config.json.
- get_backbone_cls recognizes Cosmos-Reason2 / Qwen3-VL backbones by name and
  warns (instead of silently assuming) when an unrecognized backbone is loaded
  only on the strength of backbone_model_type='qwen'.
- 'revision' pins the GR00T checkpoint repo only and is no longer forwarded
  into the unrelated backbone repo load; pin the backbone via
  transformers_loading_kwargs instead.
- DiT / SelfAttentionTransformer parameter counts go through logging.debug
  instead of print().
2026-06-28 12:55:18 -07:00
Steven Palma 1c660feda4 docs(groot): document the N1.5 removal and the N1.7 parity test
- groot.mdx: breaking-change warning and migration path (pin lerobot==0.5.1 to
  keep N1.5, or move to N1.7); the dead `huggingface-cli download` is replaced
  with `hf download`.
- policy_groot_README.md: N1.5 removal note, updated paper / model-card links,
  and the two-comparison (model parity + preprocessor parity) description of
  the original-vs-LeRobot test, including the raw-observation artifacts and
  recorded seed.
2026-06-28 12:55:18 -07:00