Skip to content

test(vlm): realign pretokenized expectations with #4889 pad stripping - #5535

Merged
Qubitium merged 1 commit into
mainfrom
test/vlm-pretokenized-4889-realign
Nov 19, 2026
Merged

Qubitium merged 1 commit into
mainfrom
test/vlm-pretokenized-4889-realign

Conversation

@ZX-ModelCloud

Copy link
Copy Markdown
Collaborator

Summary

#4889 (perf(calibration): strip pre-padded rows before sorting and batching)
removes a leading slot whose attention_mask is 0 before the rows are sorted
and batched. Four VLM contract tests still asserted the pre-#4889 rows, so they
fail on current main:

assert [[[100, 101, ... 206, ...]]] == [[[100, 101, ... 204, 205, ...]]]
At index 1 diff: [[201, 202, ...]] != [[200, 201, ...]]

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 of 200..244 with a leading 0.
  • test_vlm_pretokenized_calibration.py: expect (1, 12) for the padded row
    and 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 below
    the bare tensor, so the sorted batch order swaps and the short row is
    re-padded.

Tests

cd tests
python -m pytest test_vlm_prepare_dataset_contract_4633.py \
  test_vlm_pretokenized_calibration.py test_gemma3_vl_support.py \
  test_qwen3_5_moe_multimodal_support.py -o addopts= -q --timeout=900
# before (ddf11fcc6): 81 failed
# after:              214 passed

A whole-tree comparison over the affected families on ddf11fcc6 gives
106 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).

  • Unit tests have been executed and passed, or the reason they are not applicable is documented.
  • I added a new simple/fast unit test for this change, or documented why that is not applicable.

Not applicable: this PR only corrects expectations that contradict shipped
behaviour; the coverage already exists.

#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
Qubitium marked this pull request as ready for review November 19, 2026 10:39
@Qubitium
Qubitium merged commit 95c4ad9 into main Nov 19, 2026
6 checks passed
@Qubitium
Qubitium deleted the test/vlm-pretokenized-4889-realign branch November 19, 2026 10:40
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.
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