Skip to content

[Bugfix] Only quant-compress modules with weight quantization #387

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -747,12 +747,16 @@ def _replace_weights(self, dense_weight_generator, model: Module):

def map_module_to_scheme(model: Module) -> Dict[str, QuantizationScheme]:
"""
Returns a dictionary which maps quantized module names to their quantization schemes
Returns a dictionary which maps quantized module names to their quantization
schemes. Only includes modules with weight quantization
"""
return {
fix_fsdp_module_name(name): module.quantization_scheme
for name, module in model.named_modules()
if is_module_quantized(module)
if (
hasattr(module, "quantization_scheme") and
module.quantization_scheme.weights is not None
)
}


Expand Down