You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] VLM calibration silently drops pixel_values / image_grid_thw from processor-produced rows (regression from 2b51d4d, #4311) #4371
Severity: low-medium: the calibration data silently changes. Status: confirmed on CPU; A/B tested against 842d666. Kind: regression from 2b51d4d.
Where
gptqmodel/models/definitions/_vlm_calibration.py:39-54 (is_pretokenized_sample). It is used by split_calibration_dataset for qwen2-vl, gemma3, llava, ovis2, minicpm*, lfm2_vl and qwen2.5-omni.
Description
Any mapping that contains input_ids is now classified as pre-tokenized text and routed to the base text path.
That path keeps only input_ids and attention_mask.
So a row produced by processor(text=..., images=...) keeps its image placeholder tokens but silently loses pixel_values.
Before 2b51d4d, such a row went to the conversation path and failed loudly.
Repro
importtorchfromgptqmodel.models.definitions._vlm_calibrationimportsplit_calibration_datasetrow= {"input_ids": [...], "attention_mask": [...], "pixel_values": torch.randn(16, 1176), "image_grid_thw": torch.tensor([[1, 4, 4]])}
split_calibration_dataset([row], label="Qwen2VL") # then prepare_calibration_dataset(...) on the result
Actual (HEAD): the row is classified as pre-tokenized, and the prepared keys are ['attention_mask', 'input_ids'].
At 842d666: the row goes to the conversation path, which errors.
Expected:
Treat a row as pre-tokenized text only when its extra columns are text-only (token_type_ids, labels, …).
For rows carrying multimodal tensors, either route them to a path that forwards those tensors, or reject them with a clear error.
Found during an AI-assisted review (Claude Code, round 12) of def6e61; repros were run at that commit (A/B against 842d666 where noted) on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Taking this. I'll investigate against current main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.
Activity
Qubitium commentedon Nov 16, 2026
Taking this. I'll investigate against current
main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.fix(vlm): reject calibration rows that carry multimodal tensors (#4371)…