Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update vlm #223

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions configs/quantization/methods/Awq/awq_w_only_vlm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
base:
seed: &seed 42
model:
type: model_type
path: model path
tokenizer_mode: slow
torch_dtype: auto
calib:
name: vlm_datastes
type: img_txt
download: False
path: calib data path
n_samples: 128
bs: -1
seq_len: 512
preproc: vlm_general
padding: True
seed: *seed
eval:
eval_pos: [pretrain, fake_quant]
type: img_txt
name: MME
download: False
path: MME dataset path
bs: 16
inference_per_block: False
quant:
method: Awq
quant_objects: [vision, language] # default is [language]
weight:
bit: 4
symmetric: False
granularity: per_group
group_size: 128
special:
trans: True
# The options for "trans_version" include "v1" and "v2".
# But their results don't differ significantly.
trans_version: v2
weight_clip: True
# For 2-bit quantization, setting "clip_sym: False" will yield better results.
clip_sym: True
save:
save_trans: False
save_fake: False
save_path: /path/to/save/
1 change: 1 addition & 0 deletions llmc/models/internvl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,6 @@ def get_vision_subsets_in_block(self, block):
'inspect': block.mlp.fc2,
'has_kwargs': False,
'is_mlp': True,
'do_trans': False
},
]
1 change: 1 addition & 0 deletions llmc/models/llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,6 @@ def get_vision_subsets_in_block(self, block):
'inspect': block.mlp.fc2,
'has_kwargs': False,
'is_mlp': True,
'do_trans': False
},
]
1 change: 1 addition & 0 deletions llmc/models/qwen2vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def get_vision_subsets_in_block(self, block):
'inspect': block.mlp.fc2,
'has_kwargs': False,
'is_mlp': True,
'do_trans': False
},
]

Expand Down
Loading