feat(train) Allow policies to declare their input image format - #3959
Open
acwrenn-nv wants to merge 14 commits into
Open
acwrenn-nv wants to merge 14 commits into
acwrenn-nv wants to merge 14 commits into
Conversation
acwrenn-nv
force-pushed
the
acwrenn/skip_double_image_transforms_with_input_type_option
branch
from
July 6, 2026 15:49
9adea3f to
f971773
Compare
acwrenn-nv
marked this pull request as draft
July 6, 2026 15:57
acwrenn-nv
marked this pull request as ready for review
July 6, 2026 16:49
imstevenpmwork
self-requested a review
July 23, 2026 08:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title
Allow policies to declare their input image format
Summary / Motivation
Dataset workers already produce compact
uint8images, but the training loop converted them to float32[0, 1]before the GR00T preprocessor converted them back touint8and staged them through a CPU NumPy/HWC buffer. This change adds an explicit class-level raw-image input contract to policies so GR00T can preserve worker-produceduint8tensors through packing and transfer. Existing policies inherit the historical float32 behavior without adding policy-specific state to serialized processor configs.The GR00T
videointermediate is now an ordered tuple of per-camera(B, T, C, H, W)tensors. The cv2/Albumentations path still converts individual frames to HWC at its point of use, preserving the reference transform and crop behavior while removing the full-batch staging copy.Related issues
What changed
ImageInputFormatcontract toPreTrainedPolicy, withfloat32_0_1as the inherited default and no processor-pipeline serialization.uint8images only when the selected policy expects float32 input; the value is captured before PEFT or Accelerate wraps the model.GrootPolicy.input_image_format = UINT8_0_255and removed image-format state from new and loaded GR00T preprocessors.How was this tested (or how to run locally)
Targeted touched-file suite:
CUDA run on the current PR head: 169 passed, 7 skipped.
W&B training/performance results
These performance results apply to the MR as a whole. The class-level
ImageInputFormatdeclaration changes where the input contract lives without changing image values, preprocessing, or the training execution path.Four-suite performance comparison (mean across LIBERO-10, Spatial, Object, and Goal; global batch 640, 2×320)
Checklist (required before merge)
pre-commit run -a)pytest)tests/policies/pi0_fast/test_pi0_fast_original_vs_lerobot.py::test_pi0_fast_action_generation
tests/policies/pi0_fast/test_pi0_fast_original_vs_lerobot.py::test_pi0_fast_action_token_sampling
^ both tests are failing on this branch, but also failing on main.
Reviewer notes
ImageInputFormatownership onPreTrainedPolicy, the GR00T class override, capture before model wrappers, and the ordered per-camera tensor contract betweenGrootN17PackInputsStepandGrootN17VLMEncodeStep.