Skip to content

test(vlm): adopt the #4946 edge-pad strip in pretokenized calibration tests (#5325) - #6265

Merged
Qubitium merged 1 commit into
mainfrom
fix/5325-vlm-issue
Nov 29, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/5325-vlm-issue

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Part of #5325 (items A6, A13)

Status: A6/A13 are already green on main

Both items were fixed by #5535 (95c4ad9faa, "test(vlm): realign pretokenized expectations with #4889 pad stripping"), merged 2026-11-19, and are green at current main (2d3261d):

  • A6: test_gemma3_vl_support.py 18/18, test_qwen3_5_moe_multimodal_support.py 16/16.
  • A13: test_vlm_prepare_dataset_contract_4633.py 119/119, test_vlm_pretokenized_calibration.py 84/84. The two A13 test functions collect 74 + 17 = 91 nodes today (62 + 17 at triage; the VLM definition list grew from 31 to 37).
  • Broader VLM calibration family: 143/143.

Red-before is reproducible with the pre-#5535 test content from ddf11fcc6 run against current product code: 2/2 A6 nodes fail and 91/91 A13 nodes fail, all on the same #4946 edge-pad strip ((1, 12) expected vs (1, 11) prepared, plus the stripped row's changed sort order).

What this PR adds

#4946 strips contiguous pad positions at either edge, keeps an interior mask zero verbatim, and drops an all-padding row. The realigned tests cover the leading edge, the interior mask, and one qwen3.5 trailing case, but nothing asserts the trailing edge or the all-pad drop across every VLM prepare_dataset override.

test_both_edge_pads_are_stripped_and_all_pad_rows_dropped closes that gap over the same introspection-discovered definition set (37 definitions -> 37 nodes). It asserts:

  • trailing pads are stripped and the row keeps its real length,
  • an interior mask zero is a caller mask, not padding, and survives verbatim,
  • an all-padding row is dropped instead of reaching the looper empty.

With the strip disabled the new node fails 37/37; with it, 37/37 pass.

Tests

cd tests
PYTHONPATH=..:. CUDA_VISIBLE_DEVICES="" python -m pytest \
  test_gemma3_vl_support.py test_qwen3_5_moe_multimodal_support.py \
  test_vlm_prepare_dataset_contract_4633.py test_vlm_pretokenized_calibration.py \
  -q -p no:cacheprovider
# 274 passed

Broader VLM calibration family: 143 passed. ruff check clean.

No production code changes.

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.
@Qubitium
Qubitium marked this pull request as ready for review November 29, 2026 08:34
@Qubitium
Qubitium merged commit 63088ed into main Nov 29, 2026
6 checks passed
@Qubitium
Qubitium deleted the fix/5325-vlm-issue branch November 29, 2026 08:34
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.

1 participant