Skip to content

Skip the InternVL tile count for models that split their images by image_grid_thw - #8484

Merged
qgallouedec merged 2 commits into
mainfrom
skip-internvl-tiles-for-grid-models
Nov 20, 2026
Merged

qgallouedec merged 2 commits into
mainfrom
skip-internvl-tiles-for-grid-models

Conversation

@qgallouedec

@qgallouedec qgallouedec commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Part of #8497.

GRPO, RLOO and Distillation guess InternVL from the shape of pixel_values (4-D, more rows than images), then call the image processor with crop_to_patches=True to count its tiles. Inkling 2 (transformers 5.23) also returns 4-D pixel_values, one row per patch, so GRPO and RLOO crash at the first step on image data: TypeError: ImagesKwargs.__init__() got an unexpected keyword argument 'crop_to_patches'.

Models with image_grid_thw are already split by their grid (split_pixel_values_by_grid checks it first), so the InternVL branch now skips them.

One GRPO and one RLOO step on a tiny Inkling 2 crash on main and pass here. #8498 adds that model to the tests.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T17:23:42.176472Z 82c0467 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@albertvillanova albertvillanova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Nits:

  • The body says Inkling 2 ships in transformers 5.24: it's in 5.23.0, and #8498 adds the test.
  • Merge order with #8498: whichever lands second needs to drop its three strict #8484 xfails.
  • Could you link the tracking issue ("Part of #8497")?

@qgallouedec

Copy link
Copy Markdown
Member Author

Thanks! Fixed the body. I'll merge this one first and drop the three #8484 xfails in #8498.

@qgallouedec
qgallouedec merged commit b6fdb9d into main Nov 20, 2026
12 checks passed
@qgallouedec
qgallouedec deleted the skip-internvl-tiles-for-grid-models branch November 20, 2026 10:55
qgallouedec added a commit that referenced this pull request Nov 20, 2026
#8484 fixed the image tiles. transformers < 5.24 loads the dequantized checkpoint in mixed dtypes, and dequantizing
the MXFP8 experts drops their scales, which breaks DPO, KTO and GRPO on main too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants