Skip to content

Commit

Permalink
apply style and quality (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylesayrs authored Nov 1, 2024
1 parent 37df2dd commit a43dad2
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/compressed_tensors/quantization/lifecycle/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from functools import wraps
from math import ceil
from typing import Callable, Optional
from typing import Optional

import torch
from compressed_tensors.quantization.quant_args import (
Expand All @@ -28,7 +28,7 @@
calculate_range,
compute_dynamic_scales_and_zp,
)
from compressed_tensors.utils import safe_permute, update_parameter_data
from compressed_tensors.utils import safe_permute
from torch.nn import Module


Expand Down
2 changes: 0 additions & 2 deletions src/compressed_tensors/quantization/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ def iter_named_leaf_modules(model: Module) -> Generator[Tuple[str, Module], None
named_children, children = zip(*list(submodule.named_children()))
has_non_observer_children = False
for i in range(len(children)):
child = children[i]
child_name = named_children[i]

if "observer" not in child_name:
Expand Down Expand Up @@ -268,7 +267,6 @@ def iter_named_quantizable_modules(
has_non_observer_children = False
for i in range(len(children)):
child_name = named_children[i]
child = children[i]

if "observer" not in child_name:
has_non_observer_children = True
Expand Down
5 changes: 0 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@
# limitations under the License.

from math import ceil
from typing import Any, Iterable, Optional, Union

import pytest
import torch
from compressed_tensors.quantization.quant_args import (
QuantizationArgs,
QuantizationStrategy,
)
from compressed_tensors.quantization.utils import calculate_qparams
from compressed_tensors.utils.offload import update_parameter_data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
QuantizationStatus,
QuantizationStrategy,
apply_quantization_config,
apply_quantization_status,
)
from compressed_tensors.quantization.lifecycle.forward import fake_quantize
from safetensors.torch import save_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
QuantizationScheme,
QuantizationStatus,
apply_quantization_config,
apply_quantization_status,
)
from compressed_tensors.quantization.lifecycle.forward import fake_quantize
from compressed_tensors.quantization.quant_args import ActivationOrdering
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
QuantizationStatus,
QuantizationStrategy,
apply_quantization_config,
apply_quantization_status,
)
from compressed_tensors.utils import mask_creator, merge_names
from torch.nn.modules import Linear, Sequential
Expand Down
1 change: 0 additions & 1 deletion tests/test_quantization/lifecycle/test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from copy import deepcopy

import pytest
import torch
from compressed_tensors.quantization.lifecycle.initialize import (
initialize_module_for_quantization,
Expand Down

0 comments on commit a43dad2

Please sign in to comment.