fix(testing): Fix LayoutXLM tokenization test and LightOnOCR SDPA flash test failures on main CI#43988
Open
harshaljanjani wants to merge 1 commit intohuggingface:mainfrom
Conversation
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.
What does this PR do?
The following failing tests were identified and fixed in this PR:
→ LayoutXLM: This PR (rm slow tokenizers) changed models/auto/tokenization_auto.py to map configs to single tokenizer classes instead of (slow, fast) tuples. It did touch
tests/test_tokenization_common.py; having said that, it didn't update themerge_model_tokenizer_mappingsfn so the [0] and [1] subscripts fail now.→ LightOnOCR: This commit (Add LightOnOCR model implementation) added the LightOnOCR model which internally uses Pixtral's vision encoder. The skip list for
test_sdpa_can_dispatch_on_flashalready included "pixtral" (added on Jun 27, 2025), but LightOnOCR was not added to the same list despite having identical behavior (internally generates a block attention mask incompatible with Flash Attention), this should fix that :)cc: @Rocketknight1
→ After: Both tests correctly skip gracefully (ref screenshots).
merge_model_tokenizer_mappingsshould handle V5's single-class tokenizer mapping, andlighton_ocrshould be skipped intest_sdpa_can_dispatch_on_flashalongside pixtral!CI Failures:
Before the fix (feel free to cross-check; these errors are reproducible):
After the fix (feel free to cross-check):
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.