|
15 | 15 | import logging |
16 | 16 | from collections import OrderedDict |
17 | 17 | from copy import deepcopy |
18 | | -from typing import Dict, Iterable, List, Optional |
| 18 | +from typing import Dict, List, Optional |
19 | 19 | from typing import OrderedDict as OrderedDictType |
20 | 20 | from typing import Union |
21 | 21 |
|
|
34 | 34 | KV_CACHE_TARGETS, |
35 | 35 | is_kv_cache_quant_scheme, |
36 | 36 | ) |
37 | | -from compressed_tensors.utils.helpers import deprecated, replace_module |
| 37 | +from compressed_tensors.utils.helpers import replace_module |
38 | 38 | from compressed_tensors.utils.match import match_named_modules, match_targets |
39 | 39 | from compressed_tensors.utils.offload import update_parameter_data |
40 | 40 | from compressed_tensors.utils.safetensors_load import get_safetensors_folder |
|
45 | 45 | __all__ = [ |
46 | 46 | "load_pretrained_quantization_parameters", |
47 | 47 | "apply_quantization_config", |
48 | | - "find_name_or_class_matches", |
49 | 48 | ] |
50 | 49 |
|
51 | 50 | from compressed_tensors.quantization.utils.helpers import is_module_quantized |
@@ -208,31 +207,6 @@ def process_kv_cache_config( |
208 | 207 | return config |
209 | 208 |
|
210 | 209 |
|
211 | | -@deprecated( |
212 | | - message="This function is deprecated and will be removed in a future release." |
213 | | - "Please use `match_targets` from `compressed_tensors.utils.match` instead." |
214 | | -) |
215 | | -def find_name_or_class_matches( |
216 | | - name: str, module: Module, targets: Iterable[str], check_contains: bool = False |
217 | | -) -> List[str]: |
218 | | - """ |
219 | | - Returns all targets that match the given name or the class name. |
220 | | - Returns empty list otherwise. |
221 | | - The order of the output `matches` list matters. |
222 | | - The entries are sorted in the following order: |
223 | | - 1. matches on exact strings |
224 | | - 2. matches on regex patterns |
225 | | - 3. matches on module names |
226 | | - """ |
227 | | - if check_contains: |
228 | | - raise NotImplementedError( |
229 | | - "This function is deprecated, and the check_contains=True option has been" |
230 | | - " removed." |
231 | | - ) |
232 | | - |
233 | | - return match_targets(name, module, targets) |
234 | | - |
235 | | - |
236 | 210 | def _load_quant_args_from_mapping( |
237 | 211 | base_name: str, module_name: str, module: Module, mapping: Dict |
238 | 212 | ): |
|
0 commit comments