Skip to content

Commit df6fd15

Browse files
authored
Remove unused find_name_or_class_matches util (#488)
* remove Signed-off-by: Kyle Sayers <kylesayrs@gmail.com> * fully remove Signed-off-by: Kyle Sayers <kylesayrs@gmail.com> --------- Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
1 parent a4aba3a commit df6fd15

File tree

1 file changed

+2
-28
lines changed
  • src/compressed_tensors/quantization/lifecycle

1 file changed

+2
-28
lines changed

src/compressed_tensors/quantization/lifecycle/apply.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import logging
1616
from collections import OrderedDict
1717
from copy import deepcopy
18-
from typing import Dict, Iterable, List, Optional
18+
from typing import Dict, List, Optional
1919
from typing import OrderedDict as OrderedDictType
2020
from typing import Union
2121

@@ -34,7 +34,7 @@
3434
KV_CACHE_TARGETS,
3535
is_kv_cache_quant_scheme,
3636
)
37-
from compressed_tensors.utils.helpers import deprecated, replace_module
37+
from compressed_tensors.utils.helpers import replace_module
3838
from compressed_tensors.utils.match import match_named_modules, match_targets
3939
from compressed_tensors.utils.offload import update_parameter_data
4040
from compressed_tensors.utils.safetensors_load import get_safetensors_folder
@@ -45,7 +45,6 @@
4545
__all__ = [
4646
"load_pretrained_quantization_parameters",
4747
"apply_quantization_config",
48-
"find_name_or_class_matches",
4948
]
5049

5150
from compressed_tensors.quantization.utils.helpers import is_module_quantized
@@ -208,31 +207,6 @@ def process_kv_cache_config(
208207
return config
209208

210209

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-
236210
def _load_quant_args_from_mapping(
237211
base_name: str, module_name: str, module: Module, mapping: Dict
238212
):

0 commit comments

Comments
 (0)