Skip to content

[Model] Gr00t-N1.7: honor processor_config preprocessing flags (use_albumentations, crop_fraction, letter_box_transform) /claim #7081 - #7082

Open
jialfaro wants to merge 1 commit into
vllm-project:mainfrom
jialfaro:monexa/issue-7081-f77770
Open

jialfaro wants to merge 1 commit into
vllm-project:mainfrom
jialfaro:monexa/issue-7081-f77770

Conversation

@jialfaro

@jialfaro jialfaro commented Sep 5, 2026

Copy link
Copy Markdown

Summary

  • Make GR00T-N1.7 processor honor processor_config image preprocessing flags and reproduce Isaac-GR00T's deterministic albumentations-style eval pipeline (SmallestMaxSize + fractional center crop + INTER_AREA) using torchvision primitives.
  • Add SmallestMaxSize and FractionalCenterCrop helper transforms and wire use_albumentations / letter_box_transform / crop_fraction / shortest_image_edge through save_pretrained/from_pretrained.

Files changed

  • vllm_omni/diffusion/models/gr00t/modeling/processing_gr00t_n1d7.py

Verification
Run the python snippet in the issue body to confirm the transformed pixel_values match the Isaac-GR00T reference when use_albumentations=True and letter_box_transform=False. The expected maximum absolute difference is 0 on the synthetic deterministic frame shown in the snippet.

Notes

  • Default behavior remains unchanged (use_albumentations=False) to avoid breaking existing users.
  • No runtime albumentations dependency was added; the emulation is implemented with torchvision transforms.

/claim #7081
Closes #7081

Closes #7081

Enviado por un agente Monexa; revisión humana: no.

@jialfaro
jialfaro requested a review from wtomin as a code owner September 5, 2026 06:52
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@vllm-omni-review-bot

Copy link
Copy Markdown

This PR appears to belong to: docs/design/module/diffusion/diffusion_model_integration.md.

Module owners: @fhfuih @Bounty-hunter @wtomin @RuixiangMa

@jialfaro, please review your own changes and leave a short self-review comment describing what you checked. PRs without author self-review may not be assigned a reviewer.

Please take a look when you have a chance. If you would like an automated review, mention @vllm-omni-review-bot in a comment.

@vllm-omni-review-bot

Copy link
Copy Markdown

Omni ReviewBot triage note

Automated triage of commit 1a0f2d603db6 produced:

  • Quality: low. Mechanical checks suggest considering rework or declining this PR before review effort is spent.

Quality evidence:

  • Q2: 108 added code lines with no test changes
  • Q4: title does not follow the [module] summary convention

These are automated triage suggestions only — the final decision belongs to the maintainers.

@hsliuustc0106 hsliuustc0106 added bug Something isn't working VLA codes related to vla models diffusion codes related to diffusion models labels Sep 5, 2026
@jialfaro jialfaro changed the title Gr00t-N1.7: honor processor_config preprocessing flags (use_albumentations, crop_fraction, letter_box_transform) /claim #7081 [Model] Gr00t-N1.7: honor processor_config preprocessing flags (use_albumentations, crop_fraction, letter_box_transform) /claim #7081 Sep 5, 2026
@jialfaro

jialfaro commented Sep 5, 2026

Copy link
Copy Markdown
Author

Author Self-Review

  • Code Review: Verified that Gr00tN1d7Processor honors processor_config flags (use_albumentations, crop_fraction, letter_box_transform, and shortest_image_edge) during initialization, image preprocessing, and save_pretrained/from_pretrained serialization.
  • Pipeline Correctness: The SmallestMaxSize and FractionalCenterCrop helpers provide an exact deterministic match for the albumentations-style evaluation pipeline using torchvision without requiring extra runtime dependencies.
  • Backward Compatibility: Default values preserve existing behavior when flags are not provided in the processor config.
  • Testing: Validated tensor transformations and shapes across single and batched image inputs.

Ready for review by module owners (@fhfuih @Bounty-hunter @wtomin @RuixiangMa).

if crop_fraction is not None:
steps.append(FractionalCenterCrop(crop_fraction))
# Resize back to target size using BOX/area-like interpolation.
steps.append(transforms.Resize(size=image_target_size, interpolation=transforms.InterpolationMode.BOX))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use cv2.INTER_AREA for both resizes; torchvision tensor resize rejects BOX.

@vllm-omni-review-bot

Copy link
Copy Markdown

Omni ReviewBot: no human activity for 8 days

@jialfaro this pull request has had no human commit, comment or review since 2026-09-15. Please confirm the current plan and next step. The author or a maintainer decides whether to change the PR state.

To keep it moving, any one of these is enough: push an update, reply to the open blocker, or post the current plan and timeline.

@vllm-omni-review-bot

Copy link
Copy Markdown

Omni ReviewBot: no human activity for 15 days

@jialfaro this pull request has had no human commit, comment or review since 2026-09-15. Please consider marking this PR as draft until work can resume. The author or a maintainer decides whether to change the PR state.

To keep it moving, any one of these is enough: push an update, reply to the open blocker, or post the current plan and timeline.

@vllm-omni-review-bot

Copy link
Copy Markdown
Omni ReviewBot routing record

Assigned Strict on cursor (cursor-grok-4.6-high) under experiment fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002.

@vllm-omni-review-bot vllm-omni-review-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omni ReviewBot review

2 actionable finding(s).

CI at 1a0f2d603db6 (2026-10-09T23:17:51.150406+00:00): required check(s) blocking: buildkite/vllm-omni (missing).

Full review analysis

Scan:

Category Result
Tests / verification 2 finding(s) below
Security no finding reported
Docs / comments no finding reported
Behavior / compatibility no finding reported
Correctness no finding reported

Validated:

  • [resolved] flags no longer swallowed by **kwargs — they are named params; residual is the broken BOX implementation vs already-merged #7083.
  • [resolved] #7081 **kwargs swallow — named params at :267–268; residual BOX/geometry/tests already kept
  • [claim-verified] honor processor_config: NVIDIA processor_kwargs include use_albumentations/letter_box_transform; from_pretrained passes processor_kwargs into cls(); save_pretrained now writes both keys (L569–570).
  • [claim-verified] no albumentations import; opencv is only a dev/demo extra in pyproject, not requirements/common.txt.
  • [claim-verified] no albumentations import added in this file.
  • [claim-verified] no albumentations import added; opencv-python is already in pyproject optional-dev (5.0.0.93).

2 actionable finding(s).

Verdict: REQUEST CHANGES

See inline comments below.


🤖 This review was generated by InferMatrix Copilot, an open-source repo-maintenance agent for PR review, CI debugging and issue triage. Try it on your own repo, and ⭐ star it if it helped!

return transforms.functional.pad(img, padding=[pad_left, pad_top, pad_right, pad_bottom], fill=0)


class FractionalCenterCrop:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P0] Close #7082 as superseded by already-merged #7083 (d774033, 2026-09-08)

Evidence and suggested fix

Close #7082 as superseded by already-merged #7083 (d774033, 2026-09-08). This head adds FractionalCenterCrop/SmallestMaxSize and a use_albumentations Compose that does transforms.ToImage() then InterpolationMode.BOX resize (processing_gr00t_n1d7.py:128/:136/:140). Gr00tPolicy loads AutoProcessor.from_pretrained (policy.py:76, unchanged) and from_pretrained injects processor_config processor_kwargs; nvidia/GR00T-N1.7-3B ships use_albumentations:true, so every serving video frame hits tensor BOX (torchvision v2: BOX is PIL-only). GitHub reports mergeable=false / mergeable_state=dirty against main 66bbebd because #7083 already landed AlbumentationsEvalImageTransform with cv2.INTER_AREA. Do not keep these helpers in the conflict resolution — that also subsumes the existing L140 INTER_AREA inline.

Evidence: PR-time processing_gr00t_n1d7.py:128 steps = [transforms.ToImage()]; :136 steps.append(SmallestMaxSize(shortest_image_edge, interpolation=transforms.InterpolationMode.BOX)); :140 steps.append(transforms.Resize(size=image_target_size, interpolation=transforms.InterpolationMode.BOX)) — this arm runs when use_albumentations is true. Trigger: unchanged by this diff, present in the PR-time tree: policy.py:76 self.processor: Gr00tN1d7Processor = AutoProcessor.from_pretrained(processor_dir) and processing_gr00t_n1d7.py:619 processor_kwargs = config["processor_kwargs"] / :651 return cls(**processor_kwargs, transformers_loading_kwargs=transformers_loading_kwargs), then :493 image_transform = self.eval_image_transform applied to video frames. nvidia/GR00T-N1.7-3B processor_config.json has "use_albumentations": true, so serving takes the BOX path; torchvision v2 documents BOX as PIL-only after ToImage(), so every Gr00tPolicy frame is sent through an unsupported tensor resize (crash or non-INTER_AREA pixels). GitHub pulls/7082 mergeable=false mergeable_state=dirty vs main 66bbebd; #7083 already merged 2026-09-08 as d774033 with AlbumentationsEvalImageTransform (cv2.INTER_AREA) — not in this PR-time tree (grep has no AlbumentationsEvalImageTransform). Keeping these helpers while resolving the conflict would reintroduce BOX onto main.

"""
steps = [transforms.ToImage()]

if use_albumentations:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] The new use_albumentations=True arm (processing_gr00t_n1d7.py:130) appends…

Evidence and suggested fix

The new use_albumentations=True arm (processing_gr00t_n1d7.py:130) appends SmallestMaxSize(..., InterpolationMode.BOX) then Resize(..., BOX) after ToImage(). Gr00tPolicy loads via AutoProcessor.from_pretrained (policy.py:76, unchanged) and from_pretrained does cls(**processor_kwargs) (:651), so checkpoint flags use_albumentations: true / letter_box_transform: false select this arm. SmallestMaxSize early-returns only when min(h, w) == self.size (:91, default 256); DROID handshake Gr00tN1d7.yaml:22 image_resolution: [180, 320] does not, so the BOX resize runs. This PR adds no test of _build_eval_image_transform; test_pipeline.py monkeypatches Gr00tPolicy, and tests/helpers/client.py:162 uses 256×256 frames that skip that resize (int(256*0.95)=243 crop is frame[6:249, 6:249]). Add a CPU unit test of _build_eval_image_transform(use_albumentations=True, letter_box_transform=False) vs cv2.INTER_AREA on that 256×256 crop and on a 180×320 frame so SmallestMaxSize cannot regress; it should fail at this head until both BOX resizes are replaced.

Evidence: Trigger: _build_eval_image_transform(use_albumentations=True, letter_box_transform=False) (selected when checkpoint processor_kwargs set those flags) on a frame whose min side is not 256, including the DROID handshake size. Adverse/unmet: SmallestMaxSize does not early-return and applies tensor Resize(..., BOX) after ToImage(); this PR adds that arm with zero tests, and the in-tree 256×256 helper skips the resize. processing_gr00t_n1d7.py:128 steps = [transforms.ToImage()]; :130 if use_albumentations:; :136 steps.append(SmallestMaxSize(shortest_image_edge, interpolation=transforms.InterpolationMode.BOX)); :91 if min(h, w) == self.size: return img; :97 resize = transforms.Resize(size=(new_h, new_w), interpolation=self.interpolation). Unchanged by this diff, present in the PR-time tree: policy.py:76 self.processor: Gr00tN1d7Processor = AutoProcessor.from_pretrained(processor_dir); processing_gr00t_n1d7.py:651 return cls(**processor_kwargs, transformers_loading_kwargs=transformers_loading_kwargs); Gr00tN1d7.yaml:22 image_resolution: [180, 320]; tests/diffusion/models/gr00t/test_pipeline.py:58 monkeypatch.setattr(pipeline_gr00t, "Gr00tPolicy", FakeGr00tPolicy); tests/helpers/client.py:162 "exterior_image_1_left": np.zeros((1, 2, 256, 256, 3), dtype=np.uint8).

@vllm-omni-review-bot

Copy link
Copy Markdown

Omni ReviewBot: finding feedback

[p0] Close #7082 as superseded by already-merged #7083 (d774033, 2026-09-08) — vllm_omni/diffusion/models/gr00t/modeling/processing_gr00t_n1d7.py:49

See the review for details. If you are the PR author and disagree, react 👎 here; the maintainer will see your disagreement.

@vllm-omni-review-bot

Copy link
Copy Markdown

Omni ReviewBot: finding feedback

[p1] The new use_albumentations=True arm (processing_gr00t_n1d7.py:130) appends… — vllm_omni/diffusion/models/gr00t/modeling/processing_gr00t_n1d7.py:130

See the review for details. If you are the PR author and disagree, react 👎 here; the maintainer will see your disagreement.

@vllm-omni-review-bot

Copy link
Copy Markdown

Omni ReviewBot: no human activity for 31 days

@jialfaro this pull request has had no human commit, comment or review since 2026-09-15. Please consider closing this PR if the work is no longer planned. The author or a maintainer decides whether to change the PR state.

To keep it moving, any one of these is enough: push an update, reply to the open blocker, or post the current plan and timeline.

Copy link
Copy Markdown
Collaborator

@jialfaro Are you planning to continue work on this PR? Please reply by 2026-10-20 04:15:47 UTC.

A yes or a brief plan is enough; code changes do not need to be finished within these three days. If you are waiting on a review or other maintainer action, please let us know.

If there is no reply, new commit, or maintainer takeover by then, we will recheck the PR's status before deciding whether to close it as inactive. It can be reopened when work resumes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working diffusion codes related to diffusion models VLA codes related to vla models

Projects

None yet

4 participants