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] quantize() crashes on datasets.IterableDataset / any iterable without len(), although the calibration helper accepts them #4192
Severity: medium (documented input type crashes) Version: 7.11.0 @ 9dad249
Summary
looper/loop_processor.py:432-439 calls len(calibration_dataset) on the raw input before prepare_dataset runs.
CalibrationInputType / prepare_calibration_dataset (utils/calibration.py:61-67, :161-168) explicitly accept HFIterableDataset and generic iterables, via list(...).
The Qwen3-VL prepare_dataset (base_qwen3_vl.py:547-557) is written to keep image iterators lazy, so that path can't be reached either.
datasets 5.2 IterableDataset has no __len__.
Reproduce
fromgptqmodelimportGPTQModel, QuantizeConfigmodel=GPTQModel.load("facebook/opt-125m", QuantizeConfig(bits=4, group_size=32))
texts= ["Once upon a time there was a little girl who loved to play in the park. "*3] *8classStream: # same contract as datasets.IterableDatasetdef__iter__(self): returniter({"text": t} fortintexts)
model.quantize(Stream())
# TypeError: object of type 'Stream' has no len() (loop_processor.py:434)
Expected
Materialise or prepare the dataset first, then run the size and average-length checks on the prepared batches.
Found during an AI-assisted review (Claude Code) of 9dad249; repros were run on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Activity
fix(looper): accept calibration inputs without len() (#4192) (#4291)