Skip to content

Commit 04dea55

Browse files
[Hotfix] _match_name hotfix (#2447)
SUMMARY: To account for exposing `match_name` in compressed-tensors PR in * vllm-project/compressed-tensors#607 TEST PLAN: tests pass Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
1 parent 6d73ce6 commit 04dea55

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/llmcompressor/entrypoints/model_free/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Mapping, TypeVar
55

66
import torch
7-
from compressed_tensors.utils.match import _match_name
7+
from compressed_tensors.utils.match import match_name
88
from loguru import logger
99
from transformers.file_utils import CONFIG_NAME
1010

@@ -84,7 +84,7 @@ def natural_key(s: str) -> list[str | int]:
8484
for name in names:
8585
# match until we get a full set
8686
for target in targets:
87-
if _match_name(name, target):
87+
if match_name(name, target):
8888
if matches[target] is None:
8989
matches[target] = name
9090
else:

src/llmcompressor/entrypoints/model_free/process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import torch
77
from compressed_tensors.quantization import QuantizationScheme
8-
from compressed_tensors.utils.match import _match_name
8+
from compressed_tensors.utils.match import match_name
99
from safetensors.torch import load_file, save_file
1010
from torch.nn import Module
1111

@@ -31,7 +31,7 @@ def iter_quantizable_tensors(
3131
for name in list(tensors.keys()):
3232
module_name, param_name = name.rsplit(".", 1)
3333
is_linear_weight = param_name == "weight" and not module_name.endswith("norm")
34-
is_ignored = any(_match_name(module_name, ign) for ign in ignore)
34+
is_ignored = any(match_name(module_name, ign) for ign in ignore)
3535
if not is_linear_weight or is_ignored:
3636
continue
3737

0 commit comments

Comments
 (0)