Repository navigation
test(vlm): realign pretokenized expectations with #4889 pad stripping - #5535
Merged
Merged
Conversation
#4889 strips pre-padded rows before sorting and batching, so a row whose leading slot carries `attention_mask=0` is passed through without that slot. Four VLM contract tests still asserted the pre-#4889 rows and failed on main. Assert the stripped rows (and the re-padded batch on the sorted path). No production code changes. Red: 81 failed across the four files on ddf11fc. Green: 496 passed.
Qubitium
marked this pull request as ready for review
November 19, 2026 10:39
Qubitium
added a commit
that referenced
this pull request
Nov 29, 2026
A6/A13 were already realigned on main by #5535 (95c4ad9), which is why the pretokenized VLM calibration nodes are green today. The realigned tests cover the leading edge, an interior caller mask, and one qwen3.5 trailing case, but no test asserts the trailing edge or the all-padding drop across every VLM `prepare_dataset` override. Add `test_both_edge_pads_are_stripped_and_all_pad_rows_dropped` over the same introspection-discovered definition set. It asserts that a trailing tokenizer pad run is stripped, an interior mask zero survives verbatim, and an all-padding row is dropped instead of reaching the looper. With the strip disabled the new node fails 37/37, so it guards the #4946 contract rather than restating the shape oracle.
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.
Summary
#4889 (
perf(calibration): strip pre-padded rows before sorting and batching)removes a leading slot whose
attention_maskis 0 before the rows are sortedand batched. Four VLM contract tests still asserted the pre-#4889 rows, so they
fail on current
main:This realigns the expectations with the shipped behaviour. No production code
changes.
What Changed
test_vlm_prepare_dataset_contract_4633.py: expect the stripped row(
201..244, mask all ones) instead of200..244with a leading 0.test_vlm_pretokenized_calibration.py: expect(1, 12)for the padded rowand its stripped ids.
test_gemma3_vl_support.py: expect(1, 11)/(1, 12)and ids starting at 1.test_qwen3_5_moe_multimodal_support.py: the stripped row now sorts belowthe bare tensor, so the sorted batch order swaps and the short row is
re-padded.
Tests
A whole-tree comparison over the affected families on
ddf11fcc6gives106 failed / 561 passed before and 20 failed / 643 passed after, with no test
that fails only with the patch; the 20 remaining failures are pre-existing
environment gaps (no CUDA device in this container, no AVX512 CPU kernel).
Not applicable: this PR only corrects expectations that contradict shipped
behaviour; the coverage already exists.