File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,8 @@ def apply_quantization_config(
148
148
):
149
149
# mark modules to be quantized by adding
150
150
# 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 )
152
153
if (
153
154
run_compressed
154
155
and config .format != CompressionFormat .dense .value
Original file line number Diff line number Diff line change @@ -146,11 +146,7 @@ def match_targets(
146
146
targets = sorted (targets , key = lambda x : ("re:" in x , x ))
147
147
matched_targets = []
148
148
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 ):
154
150
matched_targets .append (target )
155
151
156
152
return matched_targets
You can’t perform that action at this time.
0 commit comments