Skip to content

Commit ad30022

Browse files
committed
Disable disk-offload shells for Qwen2-VL models
1 parent 6a0e539 commit ad30022

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

gptqmodel/models/definitions/base_qwen2_vl.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919
class BaseQwen2VLGPTQ(BaseQModel):
2020
loader = AutoModelForImageTextToText
21+
# Qwen2-VL placeholder-mask validation currently hits torch.nonzero() on
22+
# fake/meta tensors during LazyTurtle shell execution, so use direct CPU
23+
# loading instead of checkpoint-backed meta shells for quantization.
24+
support_offload_to_disk = False
2125

2226
pre_lm_head_norm_module = ["model.language_model.norm", "language_model.norm"]
2327

tests/test_qwen2_family_compat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ def test_qwen2_vl_image_only_process_vision_info_returns_image_list():
3636
assert image_inputs == [image]
3737

3838

39+
def test_qwen2_vl_disables_offload_to_disk_shell_loading():
40+
assert base_qwen2_vl.BaseQwen2VLGPTQ.support_offload_to_disk is False
41+
42+
3943
def test_qwen2_vl_pre_quantize_hooks_use_inner_model_layout():
4044
instance = object.__new__(base_qwen2_vl.BaseQwen2VLGPTQ)
4145
instance.model = types.SimpleNamespace(

0 commit comments

Comments
 (0)