Skip to content

fix(cosmos3_edge): bump backend_equivalence_atol for Pillow 13.x (miss from #50105) - #50327

Merged
ydshieh merged 1 commit into
mainfrom
fix-cosmos3edge-backend-equivalence-atol
Nov 3, 2026
Merged

ydshieh merged 1 commit into
mainfrom
fix-cosmos3edge-backend-equivalence-atol

Conversation

@ydshieh

@ydshieh ydshieh commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

🤗 Transformers CI

What does this PR do?

cosmos3_edge was missing the backend_equivalence_atol = 0.5 override added in #50105 for Pillow 13.x compatibility.

Pillow 13.x changed the order of bicubic resize passes (see python-pillow/Pillow#9549), producing slightly different pixels vs torchvision. The test was failing ~50% of the time with PIL 13.0.

Verified locally:

  • PIL 12.3 + no fix: 200/200 passed ✅
  • PIL 13.0 + no fix: 99/200 failed (~50% failure rate) ❌
  • PIL 13.0 + fix: 200/200 passed ✅

…bic change (#50105 miss)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ydshieh
ydshieh force-pushed the fix-cosmos3edge-backend-equivalence-atol branch from 14744c8 to 69d424c Compare November 3, 2026 19:49
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: cosmos3_edge

@HuggingFaceDocBuilderDev

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.

@ydshieh
ydshieh merged commit 9719c27 into main Nov 3, 2026
36 checks passed
@ydshieh
ydshieh deleted the fix-cosmos3edge-backend-equivalence-atol branch November 3, 2026 19:59
ydshieh added a commit that referenced this pull request Nov 9, 2026
…) (#50510)

* Fix flaky backend equivalence tests with Pillow 13 (follow-up of #50105)

Pillow >= 13 can reverse the order of the two bicubic resize passes, which gives isolated pixel differences vs
torchvision above the default `atol=0.1`. #50105 (and #50170, #50327) set `backend_equivalence_atol = 0.5` for the
affected models; bridgetower, poolformer, deepseek_ocr2, got_ocr2, hunyuan_vl and levit were missed.

bridgetower, deepseek_ocr2 and got_ocr2 override the backend equivalence tests and call
`_assert_tensors_equivalence` without `atol`, which ignored `backend_equivalence_atol`. Make the helper default to
the class attribute (same value as before when it's not set), so those tests (and e.g. flava's
`test_slow_fast_equivalence`) also use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Pass `backend_equivalence_atol` explicitly instead of changing the helper default

Keep `_assert_tensors_equivalence` unchanged and pass `atol=self.backend_equivalence_atol` to the pixel value
comparisons of the overridden backend equivalence tests (bridgetower, deepseek_ocr2, got_ocr2, and flava, which
already sets `backend_equivalence_atol = 0.5`). Masks are still compared with the default tolerance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
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.

2 participants