Skip to content

Commit 606f177

Browse files
cleanup
Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
1 parent 78d274d commit 606f177

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/compressed_tensors/quantization/lifecycle/apply.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ def apply_quantization_config(
148148
):
149149
# mark modules to be quantized by adding
150150
# quant scheme to the matching layers
151-
scheme = _scheme_from_targets(target_to_scheme, scheme.targets, name)
151+
matched_targets = match_targets(name, submodule, target_to_scheme)
152+
scheme = _scheme_from_targets(target_to_scheme, matched_targets, name)
152153
if (
153154
run_compressed
154155
and config.format != CompressionFormat.dense.value

src/compressed_tensors/utils/match.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,7 @@ def match_targets(
146146
targets = sorted(targets, key=lambda x: ("re:" in x, x))
147147
matched_targets = []
148148
for target in targets:
149-
if _match_name(name, target):
150-
matched_targets.append(target)
151-
152-
for target in targets:
153-
if _match_class(module, target) and target not in matched_targets:
149+
if _match_name(name, target) or _match_class(module, target):
154150
matched_targets.append(target)
155151

156152
return matched_targets

0 commit comments

Comments
 (0)