Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/llmcompressor/pipelines/layer_sequential/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import torch
import tqdm
from compressed_tensors.quantization import find_name_or_class_matches
from compressed_tensors.utils.match import match_targets
from torch.nn import Module
from torch.utils.data.dataloader import DataLoader

Expand Down Expand Up @@ -33,7 +33,7 @@ def match_modules(model: Module, target_names: List[str]) -> List[Module]:
names_layers = [
(name, module)
for name, module in model.named_modules()
if find_name_or_class_matches(name, module, target_names)
if match_targets(name, module, target_names)
]

names_layers = sorted(names_layers, key=lambda name_layer: name_layer[0])
Expand Down
4 changes: 2 additions & 2 deletions src/llmcompressor/pipelines/sequential/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

import torch
from accelerate.hooks import remove_hook_from_module
from compressed_tensors.quantization import find_name_or_class_matches
from compressed_tensors.utils import (
has_offloaded_params,
offloaded_dispatch,
remove_dispatch,
)
from compressed_tensors.utils.match import match_targets
from loguru import logger
from torch.fx import Graph, GraphModule, Node
from torch.fx.graph import PythonCode
Expand Down Expand Up @@ -424,7 +424,7 @@ def match_modules(model: Module, target_names: List[str]) -> Set[Module]:
return set(
module
for name, module in model.named_modules()
if find_name_or_class_matches(name, module, target_names)
if match_targets(name, module, target_names)
)


Expand Down