Skip to content

Allow non-MLLM calibration datasets when not quantizing vision#2065

Open
aquilarubra wants to merge 2 commits into
intel:mainfrom
aquilarubra:pr/mllm-dataset-fix
Open

Allow non-MLLM calibration datasets when not quantizing vision#2065
aquilarubra wants to merge 2 commits into
intel:mainfrom
aquilarubra:pr/mllm-dataset-fix

Conversation

@aquilarubra

Copy link
Copy Markdown

Summary

Standalone fix, no dependency on the other PRs in this stack.

MLLMCalibrator unconditionally routes to get_mllm_dataloader whenever the model is multimodal, which KeyErrors on any dataset not in its MLLM_DATASET registry (its own os.path.isfile(dataset) or dataset in MLLM_DATASET guard still indexes MLLM_DATASET with the raw file path). But a local text dataset (file/dir/HF text set) is perfectly valid calibration for a VLM whose non-text modules are not being quantized (quant_nontext_module=False): the full-model forward runs text-only, and the loop's generic-dict branch already just feeds model(**batch) regardless of dataset shape.

Change

When quant_nontext_module is False and the dataset isn't a known MLLM_DATASET entry, use the standard text get_dataloader() instead of falling through to get_mllm_dataloader.

@aquilarubra
aquilarubra force-pushed the pr/mllm-dataset-fix branch from 79d663a to 589feba Compare July 19, 2026 14:20
…vision

MLLMCalibrator unconditionally routed to get_mllm_dataloader whenever
the model was multimodal, which KeyErrors on any dataset not in its
MLLM_DATASET registry (its own "os.path.isfile(dataset) or dataset in
MLLM_DATASET" guard still indexes MLLM_DATASET with the raw file
path). But a local text dataset (file/dir/HF text set) is perfectly
valid calibration for a VLM whose non-text modules are NOT being
quantized (quant_nontext_module=False): the full-model forward runs
text-only, and the loop's generic-dict branch already just feeds
model(**batch) regardless of dataset shape.

When quant_nontext_module is False and the dataset isn't a known
MLLM_DATASET entry, use the standard text get_dataloader() instead of
falling through to get_mllm_dataloader.

Signed-off-by: Fabrizio del Tin <devotedmystic@gmail.com>
@aquilarubra
aquilarubra force-pushed the pr/mllm-dataset-fix branch from 589feba to 123b0e7 Compare July 19, 2026 14:31
@aquilarubra

Copy link
Copy Markdown
Author

/azp run Performance-Test-AutoRound

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 2065 in repo intel/auto-round

The prior /azp run Performance-Test-AutoRound comment failed with
'Commenter does not have sufficient privileges' (external contributors can't
trigger Azure Pipelines re-runs by comment on this repo). Pushing an empty
commit instead, since a new commit re-runs CI regardless of commenter
privileges. See PR discussion: the only failing check (Qwen3_W4A16 peak VRAM,
+4.11%% vs baseline) is on a non-multimodal model that never exercises this
PR's is_mllm=True-gated change in calibration/mllm.py.

Signed-off-by: Fabrizio del Tin <devotedmystic@gmail.com>
@chensuyue
chensuyue requested a review from n1ck-guo July 20, 2026 02:11
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