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

fix module was skipped but still be looped #806

Merged
merged 2 commits into from
Dec 9, 2024
Merged
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
8 changes: 7 additions & 1 deletion gptqmodel/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ def store_input_hook(_, args, kwargs):
full = find_layers(layer)
for names in layer_modules:
subset = {n: full[n] for n in names if n in full}
skipped_modules = []
gptq = {}
for name in subset:
bits = self.quantize_config.bits
Expand All @@ -513,7 +514,9 @@ def store_input_hook(_, args, kwargs):
layer_name = f"{self.layers_node}.{i}.{name}"

if self.quantize_config.dynamic_get(layer_name=layer_name) == False: # noqa: E712
logger.info(f"skip layer: {layer_name}")
logger.info(f"skip module: {layer_name}")

skipped_modules.append(name)
continue

bits = self.quantize_config.dynamic_get(layer_name, "bits", bits)
Expand All @@ -526,6 +529,9 @@ def store_input_hook(_, args, kwargs):
mse=False,
)

for name in skipped_modules:
subset.pop(name)

if len(gptq) == 0:
continue

Expand Down