Repository navigation
[tests] Fix integration test golden values broken by fast image processor default (PR #41388) - #48637
Conversation
…ssor default (PR #41388) PR #41388 switched all models to use fast image processors by default, but 10 integration tests still had golden logit/embedding values from the slow image processors. This updates the expected values (and in one case, relaxes tolerance) to match the fast image processor outputs. Tests fixed: - `FlavaModelIntegrationTest::test_inference` — image_embeddings and multimodal_embeddings sums - `HieraModelIntegrationTest::test_inference_image_classification_head` — top-5 logit slice - `LlavaNextForConditionalGenerationIntegrationTest::test_small_model_integration_test` — pixel values tolerance 1e-2 → 0.1 - `OwlViTModelIntegrationTest::test_inference_interpolate_pos_encoding` — logits + box slice, box tolerance 1e-4 → 1e-3 - `OwlViTModelIntegrationTest::test_inference_object_detection` — box slice, tolerance 1e-4 → 1e-3 - `OwlViTModelIntegrationTest::test_inference_one_shot_object_detection` — box slice, tolerance 1e-4 → 1e-3 - `PixioModelIntegrationTest::test_inference_no_head` — last_hidden_state slice - `DonutModelIntegrationTest::test_inference_docvqa` — step 1 logits + step 2 generation scores - `DonutModelIntegrationTest::test_inference_cordv2` — step 1 logits + step 2 generation scores - `DonutModelIntegrationTest::test_inference_rvlcdip` — step 1 logits + step 2 generation scores All 10 tests verified passing on GPU runner. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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. |
…lclose) with assert_close - OwlViT box checks: confirm 1e-3 tolerance is needed (genuine GPU non-determinism of ~1e-3 verified by running twice; 1e-4 fails with max diff 0.0011) - VisionEncoderDecoder: replace self.assertTrue(torch.allclose(..., atol=1e-4)) with torch.testing.assert_close(..., rtol=1e-4, atol=1e-4) for all 4 score checks (docvqa, cordv2, rvlcdip donut models + nougat) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… 1e-4 tolerance The previous expected values were captured from a standalone script (fresh GPU), but the pytest context (3 tests run sequentially, prior models in GPU memory) produces slightly different but fully deterministic float32 values. Captured correct values by running 5 consecutive pytest invocations — all identical (max diff = 0.0). Updated expected values to match pytest context and restored the tight 1e-4 tolerance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
[For maintainers] Suggested jobs to run (before merge) run-slow: flava, hiera, llava_next, owlvit, pixio, vision_encoder_decoder |
CI recapDashboard: View test results in Grafana |
|
run-slow: flava, hiera, llava_next, owlvit, pixio, vision_encoder_decoder |
|
This comment contains models: ["models/flava", "models/hiera", "models/llava_next", "models/owlvit", "models/pixio", "models/vision_encoder_decoder"] |
|
This comment contains models: ["models/flava", "models/hiera", "models/llava_next", "models/owlvit", "models/pixio", "models/vision_encoder_decoder"] |
CI Results (AMD)Commit Info
Model CI Report❌ 1 new failed tests from this PR 😭
|
CI ResultsCommit Info
Model CI Report❌ 2 new failed tests from this PR 😭
|
…ssor default (PR huggingface#41388) (huggingface#48637) * [tests] Fix integration test golden values broken by fast image processor default (PR huggingface#41388) PR huggingface#41388 switched all models to use fast image processors by default, but 10 integration tests still had golden logit/embedding values from the slow image processors. This updates the expected values (and in one case, relaxes tolerance) to match the fast image processor outputs. Tests fixed: - `FlavaModelIntegrationTest::test_inference` — image_embeddings and multimodal_embeddings sums - `HieraModelIntegrationTest::test_inference_image_classification_head` — top-5 logit slice - `LlavaNextForConditionalGenerationIntegrationTest::test_small_model_integration_test` — pixel values tolerance 1e-2 → 0.1 - `OwlViTModelIntegrationTest::test_inference_interpolate_pos_encoding` — logits + box slice, box tolerance 1e-4 → 1e-3 - `OwlViTModelIntegrationTest::test_inference_object_detection` — box slice, tolerance 1e-4 → 1e-3 - `OwlViTModelIntegrationTest::test_inference_one_shot_object_detection` — box slice, tolerance 1e-4 → 1e-3 - `PixioModelIntegrationTest::test_inference_no_head` — last_hidden_state slice - `DonutModelIntegrationTest::test_inference_docvqa` — step 1 logits + step 2 generation scores - `DonutModelIntegrationTest::test_inference_cordv2` — step 1 logits + step 2 generation scores - `DonutModelIntegrationTest::test_inference_rvlcdip` — step 1 logits + step 2 generation scores All 10 tests verified passing on GPU runner. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [tests] Fix owlvit box tolerance and replace self.assertTrue(torch.allclose) with assert_close - OwlViT box checks: confirm 1e-3 tolerance is needed (genuine GPU non-determinism of ~1e-3 verified by running twice; 1e-4 fails with max diff 0.0011) - VisionEncoderDecoder: replace self.assertTrue(torch.allclose(..., atol=1e-4)) with torch.testing.assert_close(..., rtol=1e-4, atol=1e-4) for all 4 score checks (docvqa, cordv2, rvlcdip donut models + nougat) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [tests] Update owlvit box golden values to pytest-context values, use 1e-4 tolerance The previous expected values were captured from a standalone script (fresh GPU), but the pytest context (3 tests run sequentially, prior models in GPU memory) produces slightly different but fully deterministic float32 values. Captured correct values by running 5 consecutive pytest invocations — all identical (max diff = 0.0). Updated expected values to match pytest context and restored the tight 1e-4 tolerance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * format --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Summary
PR #41388 ("Default to fast image processors for all models", Jan 2025) switched models to use fast image processors by default. This broke 10 integration tests whose expected golden values were captured with slow image processors — causing slightly different numerical outputs.
This PR updates the expected values (and loosens tolerance in one case) to match the fast image processor outputs. All 10 tests verified passing on GPU runner.
Tests fixed:
FlavaModelIntegrationTest::test_inference— image/multimodal embedding sumsHieraModelIntegrationTest::test_inference_image_classification_head— top-5 logit sliceLlavaNextForConditionalGenerationIntegrationTest::test_small_model_integration_test— pixel values tolerance tightened toatol=0.05(fast vs slow processor produces slightly different normalization; max observed diff ~0.03)OwlViTModelIntegrationTest::test_inference_interpolate_pos_encoding— logits + box sliceOwlViTModelIntegrationTest::test_inference_object_detection— box sliceOwlViTModelIntegrationTest::test_inference_one_shot_object_detection— box slicePixioModelIntegrationTest::test_inference_no_head— last_hidden_state sliceDonutModelIntegrationTest::test_inference_docvqa— step 1 logits + step 2 generation scoresDonutModelIntegrationTest::test_inference_cordv2— step 1 logits + step 2 generation scoresDonutModelIntegrationTest::test_inference_rvlcdip— step 1 logits + step 2 generation scoresTest plan
10 passed in 33s)Known pre-existing failures not fixed here
The following tests are failing in CI but are not caused by PR #41388 and are out of scope for this PR:
FlavaForPreTrainingIntegrationTest::test_inferenceandFlavaForPreTrainingIntegrationTest::test_inference_with_itm_labels— failing since 2025-01-25, over a year before 🚨Default to fast image processors for all models #41388 landed. Unrelated root cause.NougatModelIntegrationTest::test_forward_passandNougatModelIntegrationTest::test_generation— failing due to a missing test artifact (nougat_pdf.png, 404 error). Unrelated to image processor changes.TrOCRModelIntegrationTest— failing due to a tokenizer class mismatch (MODELS_WITH_INCORRECT_HUB_TOKENIZER_CLASS). Fixed in PR [fix] Remove vision-encoder-decoder from MODELS_WITH_INCORRECT_HUB_TOKENIZER_CLASS #48628.🤖 Generated with Claude Code