Skip to content
Draft
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
7 changes: 5 additions & 2 deletions src/llmcompressor/modifiers/quantization/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
QuantizationStrategy,
)
from compressed_tensors.quantization.lifecycle.forward import forward_quantize
from compressed_tensors.utils import align_module_device, update_offload_parameter
from compressed_tensors.utils import (
align_module_device,
getattr_chain,
update_offload_parameter,
)
from loguru import logger
from torch.nn import Module

from llmcompressor.observers import Observer
from llmcompressor.utils.helpers import getattr_chain

__all__ = [
"initialize_observer",
Expand Down
2 changes: 1 addition & 1 deletion src/llmcompressor/pipelines/independent/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import TYPE_CHECKING

import torch
from compressed_tensors.utils import patch_attr
from loguru import logger
from torch.utils.data.dataloader import DataLoader

from llmcompressor.core import active_session
from llmcompressor.pipelines.registry import CalibrationPipeline
from llmcompressor.utils.helpers import patch_attr

if TYPE_CHECKING:
from llmcompressor.args.dataset_arguments import DatasetArguments
Expand Down
2 changes: 1 addition & 1 deletion src/llmcompressor/pipelines/sequential/ast_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from typing import List

import torch
from compressed_tensors.utils import patch_attr

from llmcompressor.pipelines.sequential.ast_utils.auto_wrapper import AutoWrapper
from llmcompressor.utils import patch_attr

__all__ = ["autowrap_forwards", "append_autowrap_source_on_fail"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import builtins
from typing import Set, Tuple

from llmcompressor.utils import patch_attr
from compressed_tensors.utils import patch_attr


class NameAnalyzer(ast.NodeVisitor):
Expand Down
3 changes: 2 additions & 1 deletion src/llmcompressor/pipelines/sequential/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from compressed_tensors.utils import (
has_offloaded_params,
offloaded_dispatch,
patch_attr,
remove_dispatch,
)
from compressed_tensors.utils.match import match_targets
Expand All @@ -24,7 +25,7 @@
from llmcompressor.modifiers import Modifier
from llmcompressor.modifiers.utils.hooks import HooksMixin
from llmcompressor.pipelines.sequential.transformers_helpers import HFTracer
from llmcompressor.utils.helpers import calibration_forward_context, patch_attr
from llmcompressor.utils.helpers import calibration_forward_context
from llmcompressor.utils.pytorch.module import get_no_split_params

from .ast_helpers import append_autowrap_source_on_fail, autowrap_forwards
Expand Down
4 changes: 1 addition & 3 deletions src/llmcompressor/utils/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
import torch
from accelerate import dispatch_model, infer_auto_device_map
from accelerate.utils import get_balanced_memory
from compressed_tensors.utils import remove_dispatch
from compressed_tensors.utils import patch_attr, remove_dispatch
from huggingface_hub import snapshot_download
from safetensors.torch import save_file
from transformers import AutoModelForCausalLM, PreTrainedModel
from transformers.modeling_utils import TORCH_INIT_FUNCTIONS
from transformers.utils import SAFE_WEIGHTS_INDEX_NAME, WEIGHTS_INDEX_NAME

from llmcompressor.utils.helpers import patch_attr

__all__ = [
"skip_weights_download",
"patch_transformers_logger_level",
Expand Down
Loading
Loading