Skip to content

Commit 8995d84

Browse files
committed
fix style
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
1 parent 05237b2 commit 8995d84

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/compressed_tensors/quantization/lifecycle/initialize.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
FP8_E4M3_DATA,
2828
ActivationOrdering,
2929
DynamicType,
30-
KVCacheScaleType,
3130
QuantizationArgs,
3231
QuantizationMetadata,
3332
QuantizationScheme,

src/compressed_tensors/quantization/quant_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def from_pretrained(
171171
:param model: model to calculate quantization scheme of
172172
:return: filled out QuantizationScheme for the input model
173173
"""
174-
from compressed_tensors.quantization.lifecycle.initialize import ( # circular import, move to utils later
174+
from compressed_tensors.quantization.lifecycle.initialize import (
175175
is_attention_module,
176176
)
177177

src/compressed_tensors/quantization/utils/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import logging
1616
import math
17-
from typing import Generator, List, Optional, Tuple
17+
from typing import Generator, Optional, Tuple
1818

1919
import torch
2020
from compressed_tensors.quantization.quant_args import (

tests/test_modeling/test_attention_and_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_attention_cache():
4949
assert torch.equal(outputs.logits, true_outputs.logits)
5050
assert all(k_called) and all(v_called)
5151

52-
## apply attention quantization after kv cache quantization ##
52+
""" apply attention quantization after kv cache quantization """
5353

5454
# check if hooks work
5555
q_called = [False for _ in range(len(layers))]

tests/test_quantization/lifecycle/test_apply.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ def test_multi_apply_quantization_config():
367367
and weight_zero_point.shape == torch.Size([1])
368368
)
369369

370+
370371
@requires_accelerate()
371372
def test_apply_kv_cache():
372373
from accelerate import init_empty_weights
@@ -376,7 +377,7 @@ def test_apply_kv_cache():
376377

377378
args = QuantizationArgs(num_bits=8, type="float", strategy="tensor")
378379
config = QuantizationConfig(config_groups={}, kv_cache_scheme=args)
379-
380+
380381
apply_quantization_config(model, config)
381382

382383
for layer in model.model.layers:
@@ -397,11 +398,11 @@ def test_apply_attention():
397398
input_activations=QuantizationArgs(num_bits=8, type="float", strategy="tensor"),
398399
)
399400
config = QuantizationConfig(config_groups={"attention": scheme})
400-
401+
401402
apply_quantization_config(model, config)
402403

403404
for layer in model.model.layers:
404405
assert getattr(layer.self_attn, "quantization_scheme") == scheme
405406
assert hasattr(layer.self_attn, "q_scale")
406407
assert hasattr(layer.self_attn, "k_scale")
407-
assert hasattr(layer.self_attn, "v_scale")
408+
assert hasattr(layer.self_attn, "v_scale")

0 commit comments

Comments
 (0)