Skip to content

Commit c782627

Browse files
committed
formatting
Summary Signed-off-by: HDCharles <[email protected]>
1 parent 4a45eca commit c782627

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

src/llmcompressor/modifiers/awq/base.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,11 @@ def _set_resolved_mappings(self, model: Module) -> None:
362362
)
363363

364364
continue
365-
else:
366-
# for multiple balance layers, find lowest common parent
367-
ancestor_name = get_lowest_common_ancestor_name(balance_names)
368-
ancestor_name, ancestor = get_lowest_non_module_list_ancestor(
369-
ancestor_name, model
370-
)
365+
366+
ancestor_name = get_lowest_common_ancestor_name(balance_names)
367+
ancestor_name, ancestor = get_lowest_non_module_list_ancestor(
368+
ancestor_name, model
369+
)
371370

372371
resolved_mappings.append(
373372
ResolvedMapping(

src/llmcompressor/utils/pytorch/module.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ def get_module_to_name_dict(model: Module) -> dict[Module:str]:
378378
if module in module_to_name:
379379
logger.info(
380380
f"Warning, {name} and {module_to_name[module]} both "
381-
"share the same module the same module, "
382-
"may have trouble resolving mappings."
381+
"share the same module, which can result in unexpected behavior"
383382
)
384383
module_to_name[module] = name
385384
return module_to_name

tests/llmcompressor/pytorch/modifiers/logarithmic_equalization/test_pytorch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ def test_log_equalization_mapping(state):
1919
mapping = modifier.resolved_mappings_[0]
2020
assert mapping.smooth_name == mappings[0][1]
2121
assert isinstance(mapping.smooth_layer, Linear)
22-
assert isinstance(mapping.balance_layers[0], Linear)
22+
assert isinstance(mapping.balance_layers[0], Linear)

tests/llmcompressor/pytorch/modifiers/smoothquant/test_pytorch.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
from llmcompressor.modifiers.smoothquant import SmoothQuantModifier
55

66

7-
import pytest
8-
from torch.nn import Linear
9-
10-
from llmcompressor.modifiers.smoothquant import SmoothQuantModifier
11-
12-
137
@pytest.mark.unit
148
def test_smooth_quant_mapping(state):
159
mappings = [(["seq.fc1"], "seq.fc2")]
@@ -23,4 +17,4 @@ def test_smooth_quant_mapping(state):
2317
mapping = modifier.resolved_mappings_[0]
2418
assert mapping.smooth_name == mappings[0][1]
2519
assert isinstance(mapping.smooth_layer, Linear)
26-
assert isinstance(mapping.balance_layers[0], Linear)
20+
assert isinstance(mapping.balance_layers[0], Linear)

0 commit comments

Comments
 (0)