PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度
rename the base rotation (deterministic/random hadamard) directory name. (#1956)
lkk45dcb1987367
diff --git a/auto_round/__init__.py b/auto_round/__init__.pyindex d1eb92d06..031e205ff 100644--- a/auto_round/__init__.py+++ b/auto_round/__init__.py@@ -22,7 +22,7 @@ from auto_round.algorithms.quantization.sign_round.config import (SignRoundV2Config,)from auto_round.algorithms.transforms.awq.config import AWQConfig-from auto_round.algorithms.transforms.quarot.config import RotationConfig+from auto_round.algorithms.transforms.hadamard.config import RotationConfigfrom auto_round.algorithms.transforms.spinquant.preprocessor import SpinQuantConfigfrom auto_round.schemes import QuantizationSchemefrom auto_round.auto_scheme import AutoSchemediff --git a/auto_round/algorithms/transforms/__init__.py b/auto_round/algorithms/transforms/__init__.pyindex f7efbfbea..14aaac44a 100644--- a/auto_round/algorithms/transforms/__init__.py+++ b/auto_round/algorithms/transforms/__init__.py@@ -20,7 +20,7 @@ quantisation step to improve numerical properties.Current algorithms------------------* **hadamard** – Block-diagonal Hadamard rotations (QuaRot / SpinQuant style).- See :mod:`auto_round.algorithms.transforms.quarot`.+ See :mod:`auto_round.algorithms.transforms.hadamard`.* **spinquant** – SpinQuant/QuaRot multi-level rotation (R1–R4) with optionalonline hooks, trainable rotations, and known Hadamard matrices for non-pow2.See :mod:`auto_round.algorithms.transforms.spinquant`.@@ -53,7 +53,7 @@ from auto_round.algorithms.transforms.base import (check_supported_schemes,_ensure_registry_populated,)-from auto_round.algorithms.transforms.quarot import (+from auto_round.algorithms.transforms.hadamard import (HadamardRotation,apply_rotation_transform,normalize_rotation_config as _normalize_hadamard_config,@@ -430,8 +430,8 @@ def apply_rotation_hooks_from_config(if isinstance(quantization_config, dict)else getattr(quantization_config, "data_type", "mx_fp"))- from auto_round.algorithms.transforms.quarot.apply import apply_rotation_transform- from auto_round.algorithms.transforms.quarot.config import RotationConfig as _RC+ from auto_round.algorithms.transforms.hadamard.apply import apply_rotation_transform+ from auto_round.algorithms.transforms.hadamard.config import RotationConfig as _RCcfg = _RC(block_size=rotation_config["block_size"],diff --git a/auto_round/algorithms/transforms/base.py b/auto_round/algorithms/transforms/base.pyindex 4a36b8080..4b58195b7 100644--- a/auto_round/algorithms/transforms/base.py+++ b/auto_round/algorithms/transforms/base.py@@ -174,7 +174,7 @@ def _ensure_registry_populated() -> None:# Import each sub-package here. Add new entries as more algorithms land.import importlib- for sub in ("quarot", "spinquant"):+ for sub in ("hadamard", "spinquant"):try:importlib.import_module(f"auto_round.algorithms.transforms.{sub}")except ImportError:diff --git a/auto_round/algorithms/transforms/quarot/__init__.py b/auto_round/algorithms/transforms/hadamard/__init__.pysimilarity index 85%rename from auto_round/algorithms/transforms/quarot/__init__.pyrename to auto_round/algorithms/transforms/hadamard/__init__.pyindex 3faf385e4..54b749f98 100644--- a/auto_round/algorithms/transforms/quarot/__init__.py+++ b/auto_round/algorithms/transforms/hadamard/__init__.py@@ -13,15 +13,15 @@# limitations under the License."""Hadamard rotation sub-package for ``algorithms/transforms``."""-from auto_round.algorithms.transforms.quarot.apply import (+from auto_round.algorithms.transforms.hadamard.apply import (HadamardRotation,apply_rotation_transform,)-from auto_round.algorithms.transforms.quarot.config import (+from auto_round.algorithms.transforms.hadamard.config import (RotationConfig,normalize_rotation_config,)-from auto_round.algorithms.transforms.quarot.transforms import (+from auto_round.algorithms.transforms.hadamard.transforms import (HADAMARDS,HadamardTransform,RandomHadamardTransform,diff --git a/auto_round/algorithms/transforms/quarot/apply.py b/auto_round/algorithms/transforms/hadamard/apply.pysimilarity index 92%rename from auto_round/algorithms/transforms/quarot/apply.pyrename to auto_round/algorithms/transforms/hadamard/apply.pyindex 41402cd8a..63379bbb6 100644--- a/auto_round/algorithms/transforms/quarot/apply.py+++ b/auto_round/algorithms/transforms/hadamard/apply.py@@ -30,8 +30,8 @@ import torch.nn as nnimport tqdmfrom auto_round.algorithms.transforms.base import BaseRotation, SerializerMixin-from auto_round.algorithms.transforms.quarot.config import RotationConfig, normalize_rotation_config-from auto_round.algorithms.transforms.quarot.transforms import build_hadamard_transform+from auto_round.algorithms.transforms.hadamard.config import RotationConfig, normalize_rotation_config+from auto_round.algorithms.transforms.hadamard.transforms import build_hadamard_transformfrom auto_round.compressors.utils import is_nv_fpfrom auto_round.experimental.qmodules.base import QModuleBasefrom auto_round.utils import logger@@ -48,7 +48,7 @@ def _triton_available(data_type: str = "mx_fp") -> bool:if not torch.cuda.is_available():return False- from auto_round.algorithms.transforms.quarot.utils.triton.mxfp4 import ( # noqa: F401+ from auto_round.algorithms.transforms.hadamard.utils.triton.mxfp4 import ( # noqa: F401mxfp4_forward_kernel_wrapper,)@@ -74,7 +74,7 @@ class HadamardRotation(BaseRotation, SerializerMixin):Or directly::- from auto_round.algorithms.transforms.quarot import apply_rotation_transform+ from auto_round.algorithms.transforms.hadamard import apply_rotation_transformmodel = apply_rotation_transform(model, config=RotationConfig(), need_calibration=True)"""@@ -116,13 +116,13 @@ class HadamardRotation(BaseRotation, SerializerMixin):# Dispatch by backend. The transform backend (triton-fused per-Linear)# is implemented below; the inplace (QuaRot) backend is delegated to- # :mod:`auto_round.algorithms.transforms.quarot.inplace`.- from auto_round.algorithms.transforms.quarot.dispatcher import resolve_hadamard_backend+ # :mod:`auto_round.algorithms.transforms.hadamard.inplace`.+ from auto_round.algorithms.transforms.hadamard.dispatcher import resolve_hadamard_backendbackend = resolve_hadamard_backend(cfg, data_type)if backend == "inplace":import auto_round.envs as envs- from auto_round.algorithms.transforms.quarot.inplace import apply_rotation_transform as _inplace_apply+ from auto_round.algorithms.transforms.hadamard.inplace import apply_rotation_transform as _inplace_apply# Resolve fuse flag: explicit > env var > default(False).fuse_online_to_weight = cfg.fuse_online_to_weight@@ -257,7 +257,7 @@ def _apply_to_module(def _apply_input_transform(module: torch.nn.Module, config: RotationConfig, data_type: str = "mx_fp") -> None:"""Register a forward pre-hook that applies the Hadamard to the input activation."""- from auto_round.algorithms.transforms.quarot.utils.matrix import multihead_matmul+ from auto_round.algorithms.transforms.hadamard.utils.matrix import multihead_matmulinp_transform = build_hadamard_transform(**config.model_dump(),@@ -273,7 +273,7 @@ def _apply_input_transform(module: torch.nn.Module, config: RotationConfig, datahadamard_weight = Noneif _triton_available(data_type):- from auto_round.algorithms.transforms.quarot.utils.triton.mxfp4 import mxfp4_forward_kernel_wrapper+ from auto_round.algorithms.transforms.hadamard.utils.triton.mxfp4 import mxfp4_forward_kernel_wrapperdef _input_hook(self, args):x = args[0]@@ -308,7 +308,7 @@ def _apply_weight_transform(config: RotationConfig,) -> None:"""Fuse or patch the Hadamard rotation into the weight of *module*."""- from auto_round.algorithms.transforms.quarot.patch import (+ from auto_round.algorithms.transforms.hadamard.patch import (patch_quantlinear,patch_wrapperlinear_to_apply_transform,patch_wrapperwalayer_forward_to_apply_transform,@@ -324,7 +324,7 @@ def _apply_weight_transform(# For random Hadamard, save the matrix as a submodule for serialisation.if config.hadamard_type == "random_hadamard":- from auto_round.algorithms.transforms.quarot.patch import patch_quantlinear as _patch_ql+ from auto_round.algorithms.transforms.hadamard.patch import patch_quantlinear as _patch_ql_patch_ql(w_transform)diff --git a/auto_round/algorithms/transforms/quarot/config.py b/auto_round/algorithms/transforms/hadamard/config.pysimilarity index 98%rename from auto_round/algorithms/transforms/quarot/config.pyrename to auto_round/algorithms/transforms/hadamard/config.pyindex 5763054f9..9e46ce0ff 100644--- a/auto_round/algorithms/transforms/quarot/config.py+++ b/auto_round/algorithms/transforms/hadamard/config.py@@ -19,13 +19,13 @@ schema.Two implementation backends share this one schema (method B):* ``backend="inplace"`` – QuaRot-style residual-stream rotation, implemented- under :mod:`auto_round.algorithms.transforms.quarot.inplace`. Works for any+ under :mod:`auto_round.algorithms.transforms.hadamard.inplace`. Works for anyweight/activation dtype and can optionally fuse the online Hadamard intoweights (``fuse_online_to_weight=True``).* ``backend="transform"`` – Per-Linear weight + activation Hadamard with afused triton kernel, implemented under- :mod:`auto_round.algorithms.transforms.quarot.apply`. Supports only+ :mod:`auto_round.algorithms.transforms.hadamard.apply`. Supports onlyMXFP4 / NVFP4 and cannot fuse online to weight.* ``backend="auto"`` – dispatcher picks inplace when a fused online rotationdiff --git a/auto_round/algorithms/transforms/quarot/dispatcher.py b/auto_round/algorithms/transforms/hadamard/dispatcher.pysimilarity index 93%rename from auto_round/algorithms/transforms/quarot/dispatcher.pyrename to auto_round/algorithms/transforms/hadamard/dispatcher.pyindex b5c1b090e..6ae4fdbad 100644--- a/auto_round/algorithms/transforms/quarot/dispatcher.py+++ b/auto_round/algorithms/transforms/hadamard/dispatcher.py@@ -9,11 +9,11 @@Two backend implementations exist:-* ``inplace`` – :mod:`auto_round.algorithms.transforms.quarot.inplace`+* ``inplace`` – :mod:`auto_round.algorithms.transforms.hadamard.inplace`QuaRot-style residual-stream rotation. Works for any weight/activationdtype. Optionally fuses the online Hadamard into weights(``fuse_online_to_weight=True``).-* ``transform`` – :mod:`auto_round.algorithms.transforms.quarot`+* ``transform`` – :mod:`auto_round.algorithms.transforms.hadamard`Per-Linear weight + activation Hadamard with a fused triton kernel.Only supports MXFP4 / NVFP4 and **cannot** fuse online to weight.@@ -33,7 +33,7 @@ from typing import Any, Unionimport torchimport auto_round.envs as envs-from auto_round.algorithms.transforms.quarot.config import RotationConfig, normalize_rotation_config+from auto_round.algorithms.transforms.hadamard.config import RotationConfig, normalize_rotation_configfrom auto_round.compressors.utils import is_mx_fp, is_nv_fpfrom auto_round.utils import logger@@ -123,7 +123,7 @@ def apply_hadamard_rotation(if backend == "inplace":logger.warning("this backend does not support real exporting, please export the model to fake format")- from auto_round.algorithms.transforms.quarot.inplace import apply_rotation_transform+ from auto_round.algorithms.transforms.hadamard.inplace import apply_rotation_transform# block_size -> group_size (None / -1 / 0 means full-dimension)bs = config.block_size@@ -145,7 +145,7 @@ def apply_hadamard_rotation(supported_hadamard_types = ("hadamard", "random_hadamard")if config.hadamard_type not in supported_hadamard_types:raise ValueError("this backend only supports hadamard or random_hadamard")- from auto_round.algorithms.transforms.quarot.apply import apply_rotation_transform+ from auto_round.algorithms.transforms.hadamard.apply import apply_rotation_transformreturn apply_rotation_transform(model, config, data_type=data_type)else:diff --git a/auto_round/algorithms/transforms/quarot/inplace/__init__.py b/auto_round/algorithms/transforms/hadamard/inplace/__init__.pysimilarity index 56%rename from auto_round/algorithms/transforms/quarot/inplace/__init__.pyrename to auto_round/algorithms/transforms/hadamard/inplace/__init__.pyindex 53fa25fc1..ffe8eb4d6 100644--- a/auto_round/algorithms/transforms/quarot/inplace/__init__.py+++ b/auto_round/algorithms/transforms/hadamard/inplace/__init__.py@@ -5,7 +5,7 @@Canonical home of the residual-stream Hadamard rotation implementation."""-from auto_round.algorithms.transforms.quarot.inplace.apply import apply_rotation_transform # noqa: F401-from auto_round.algorithms.transforms.quarot.inplace.hooks import clear_random_hadamard_cache # noqa: F401+from auto_round.algorithms.transforms.hadamard.inplace.apply import apply_rotation_transform # noqa: F401+from auto_round.algorithms.transforms.hadamard.inplace.hooks import clear_random_hadamard_cache # noqa: F401__all__ = ["apply_rotation_transform", "clear_random_hadamard_cache"]diff --git a/auto_round/algorithms/transforms/quarot/inplace/apply.py b/auto_round/algorithms/transforms/hadamard/inplace/apply.pysimilarity index 99%rename from auto_round/algorithms/transforms/quarot/inplace/apply.pyrename to auto_round/algorithms/transforms/hadamard/inplace/apply.pyindex 8093ead98..d2adb7508 100644--- a/auto_round/algorithms/transforms/quarot/inplace/apply.py+++ b/auto_round/algorithms/transforms/hadamard/inplace/apply.py@@ -14,7 +14,7 @@ from typing import Dict, Unionimport torchimport tqdm-from auto_round.algorithms.transforms.quarot.inplace.hooks import (+from auto_round.algorithms.transforms.hadamard.inplace.hooks import (CrossHeadOnlineHadamardHook,FullOnlineHadamardHook,GroupOnlineHadamardHook,@@ -29,7 +29,7 @@ from auto_round.algorithms.transforms.quarot.inplace.hooks import (get_hadK,get_or_create_random_hadamard,)-from auto_round.algorithms.transforms.quarot.inplace.model_config import (+from auto_round.algorithms.transforms.hadamard.inplace.model_config import (MAPPING_REGISTRY,RotationMapping,_resolve,diff --git a/auto_round/algorithms/transforms/quarot/inplace/hooks.py b/auto_round/algorithms/transforms/hadamard/inplace/hooks.pysimilarity index 99%rename from auto_round/algorithms/transforms/quarot/inplace/hooks.pyrename to auto_round/algorithms/transforms/hadamard/inplace/hooks.pyindex c2f73e62c..057d881d2 100644--- a/auto_round/algorithms/transforms/quarot/inplace/hooks.py+++ b/auto_round/algorithms/transforms/hadamard/inplace/hooks.py@@ -311,7 +311,7 @@ def register_online_had_hooks(model, mapping=None, fp32_had=False, use_fast_had=list of hook handles (call ``handle.remove()`` to detach)."""if mapping is None:- from auto_round.algorithms.transforms.quarot.inplace.model_config import infer_mapping_from_model+ from auto_round.algorithms.transforms.hadamard.inplace.model_config import infer_mapping_from_modelmapping = infer_mapping_from_model(model)@@ -368,7 +368,7 @@ def get_hadK(n: int, transpose=False) -> (torch.Tensor, int):K = 1return hadK, Kelse:- from auto_round.algorithms.transforms.quarot.utils.math import _fetch_hadamard_divisor+ from auto_round.algorithms.transforms.hadamard.utils.math import _fetch_hadamard_divisorhadK = _fetch_hadamard_divisor(n, torch.float, torch.device("cpu"))if transpose:diff --git a/auto_round/algorithms/transforms/quarot/inplace/model_config.py b/auto_round/algorithms/transforms/hadamard/inplace/model_config.pysimilarity index 100%rename from auto_round/algorithms/transforms/quarot/inplace/model_config.pyrename to auto_round/algorithms/transforms/hadamard/inplace/model_config.pydiff --git a/auto_round/algorithms/transforms/quarot/patch.py b/auto_round/algorithms/transforms/hadamard/patch.pysimilarity index 100%rename from auto_round/algorithms/transforms/quarot/patch.pyrename to auto_round/algorithms/transforms/hadamard/patch.pydiff --git a/auto_round/algorithms/transforms/quarot/transforms.py b/auto_round/algorithms/transforms/hadamard/transforms.pysimilarity index 97%rename from auto_round/algorithms/transforms/quarot/transforms.pyrename to auto_round/algorithms/transforms/hadamard/transforms.pyindex 71320e61e..890fc5870 100644--- a/auto_round/algorithms/transforms/quarot/transforms.py+++ b/auto_round/algorithms/transforms/hadamard/transforms.py@@ -27,11 +27,11 @@ from typing import Any, Callable, Dictimport torchimport torch.nn as nn-from auto_round.algorithms.transforms.quarot.utils.math import (+from auto_round.algorithms.transforms.hadamard.utils.math import (deterministic_hadamard_matrix,random_hadamard_matrix,)-from auto_round.algorithms.transforms.quarot.utils.matrix import apply_transform_weight+from auto_round.algorithms.transforms.hadamard.utils.matrix import apply_transform_weight__all__ = ["HadamardTransform",diff --git a/auto_round/algorithms/transforms/quarot/utils/__init__.py b/auto_round/algorithms/transforms/hadamard/utils/__init__.pysimilarity index 100%rename from auto_round/algorithms/transforms/quarot/utils/__init__.pyrename to auto_round/algorithms/transforms/hadamard/utils/__init__.pydiff --git a/auto_round/algorithms/transforms/quarot/utils/hadamards.safetensors b/auto_round/algorithms/transforms/hadamard/utils/hadamards.safetensorssimilarity index 100%rename from auto_round/algorithms/transforms/quarot/utils/hadamards.safetensorsrename to auto_round/algorithms/transforms/hadamard/utils/hadamards.safetensorsdiff --git a/auto_round/algorithms/transforms/quarot/utils/math.py b/auto_round/algorithms/transforms/hadamard/utils/math.pysimilarity index 100%rename from auto_round/algorithms/transforms/quarot/utils/math.pyrename to auto_round/algorithms/transforms/hadamard/utils/math.pydiff --git a/auto_round/algorithms/transforms/quarot/utils/matrix.py b/auto_round/algorithms/transforms/hadamard/utils/matrix.pysimilarity index 100%rename from auto_round/algorithms/transforms/quarot/utils/matrix.pyrename to auto_round/algorithms/transforms/hadamard/utils/matrix.pydiff --git a/auto_round/algorithms/transforms/quarot/utils/triton/__init__.py b/auto_round/algorithms/transforms/hadamard/utils/triton/__init__.pysimilarity index 100%rename from auto_round/algorithms/transforms/quarot/utils/triton/__init__.pyrename to auto_round/algorithms/transforms/hadamard/utils/triton/__init__.pydiff --git a/auto_round/algorithms/transforms/quarot/utils/triton/mxfp4.py b/auto_round/algorithms/transforms/hadamard/utils/triton/mxfp4.pysimilarity index 100%rename from auto_round/algorithms/transforms/quarot/utils/triton/mxfp4.pyrename to auto_round/algorithms/transforms/hadamard/utils/triton/mxfp4.pydiff --git a/auto_round/algorithms/transforms/spinquant/inplace/__init__.py b/auto_round/algorithms/transforms/spinquant/inplace/__init__.pyindex ac3071a93..fd17b5fbc 100644--- a/auto_round/algorithms/transforms/spinquant/inplace/__init__.py+++ b/auto_round/algorithms/transforms/spinquant/inplace/__init__.py@@ -4,7 +4,7 @@"""SpinQuant in-place application sub-package.-Follows the same structure as ``auto_round.algorithms.transforms.quarot.inplace``.+Follows the same structure as ``auto_round.algorithms.transforms.hadamard.inplace``."""from auto_round.algorithms.transforms.spinquant.inplace.apply import (diff --git a/auto_round/algorithms/transforms/spinquant/inplace/apply.py b/auto_round/algorithms/transforms/spinquant/inplace/apply.pyindex f4e7cba9f..18c857434 100644--- a/auto_round/algorithms/transforms/spinquant/inplace/apply.py+++ b/auto_round/algorithms/transforms/spinquant/inplace/apply.py@@ -6,7 +6,7 @@ SpinQuant in-place application utilities.This module provides ``apply_spinquant_in_place`` and hook registrationthat follow the same patterns used by AutoRound's-``auto_round.algorithms.transforms.quarot.inplace`` package.+``auto_round.algorithms.transforms.hadamard.inplace`` package.R3 rotation uses the architecture-generic monkeypatch approach from QuaRot/Quark:we replace ``apply_rotary_pos_emb`` in the attention forward's globals with adiff --git a/auto_round/algorithms/transforms/spinquant/rotation_utils.py b/auto_round/algorithms/transforms/spinquant/rotation_utils.pyindex 857cc45bc..6f5cd91ae 100644--- a/auto_round/algorithms/transforms/spinquant/rotation_utils.py+++ b/auto_round/algorithms/transforms/spinquant/rotation_utils.py@@ -154,7 +154,7 @@ def matmul_hadU(X: torch.Tensor, hadamard_K: Optional[torch.Tensor] = None, K: O# the fallback implementations below are used.# ---------------------------------------------------------------------------try:- from auto_round.algorithms.transforms.quarot.utils.matrix import apply_transform_weight+ from auto_round.algorithms.transforms.hadamard.utils.matrix import apply_transform_weightexcept ImportError:# Fallback for standalone usage.def apply_transform_weight(@@ -462,7 +462,7 @@ def fuse_rmsnorm_in_model(model: nn.Module) -> None:"""# Attempt to use AutoRound's model_config layer discovery if available.try:- from auto_round.algorithms.transforms.quarot.inplace.model_config import get_scaling_layers+ from auto_round.algorithms.transforms.hadamard.inplace.model_config import get_scaling_layerslayer_paths = get_scaling_layers(model.config.model_type if hasattr(model, "config") else "")if layer_paths:@@ -756,7 +756,7 @@ def get_model_arch_info(model: nn.Module) -> dict:def get_attention_layers(model: nn.Module):"""Yield attention modules using model_config if available, else fall back."""try:- from auto_round.algorithms.transforms.quarot.inplace.model_config import get_attention_layers as _get+ from auto_round.algorithms.transforms.hadamard.inplace.model_config import get_attention_layers as _getreturn _get(model)except ImportError:diff --git a/auto_round/cli/algorithms.py b/auto_round/cli/algorithms.pyindex 37692d03a..cb18306e5 100644--- a/auto_round/cli/algorithms.py+++ b/auto_round/cli/algorithms.py@@ -398,7 +398,7 @@ class Hadamard(AlgorithmHandler):)def build(self, args, common_kwargs: dict[str, Any]):- from auto_round.algorithms.transforms.quarot.config import RotationConfig+ from auto_round.algorithms.transforms.hadamard.config import RotationConfighadamard_type = getattr(args, "rotation_hadamard_type", None) or "hadamard"return RotationConfig(@@ -414,7 +414,7 @@ def _register_builtin_algorithm_factories() -> None:from auto_round.algorithms.quantization.rtn.config import RTNConfigfrom auto_round.algorithms.quantization.sign_round.config import SignRoundConfigfrom auto_round.algorithms.transforms.awq.config import AWQConfig- from auto_round.algorithms.transforms.quarot.config import RotationConfig+ from auto_round.algorithms.transforms.hadamard.config import RotationConfigregister_algorithm("rtn", aliases=("rtn",), config_factory=RTNConfig, cli_handler=RTN, summary=RTN.summary)register_algorithm(diff --git a/auto_round/compressors/entry.py b/auto_round/compressors/entry.pyindex 1770b88b4..380f1dc4f 100644--- a/auto_round/compressors/entry.py+++ b/auto_round/compressors/entry.py@@ -13,7 +13,7 @@ from auto_round.algorithms.quantization.sign_round.config import SignRoundConfigfrom auto_round.algorithms.registry import normalize_algorithm_config, resolve_alg_configfrom auto_round.algorithms.transforms import normalize_rotation_config as _normalize_rotation_alg_configfrom auto_round.algorithms.transforms.awq.config import AWQConfig-from auto_round.algorithms.transforms.quarot.config import RotationConfig as _NewArchRotationConfig+from auto_round.algorithms.transforms.hadamard.config import RotationConfig as _NewArchRotationConfigfrom auto_round.auto_scheme.gen_auto_scheme import AutoSchemefrom auto_round.compressors.base import BaseCompressorfrom auto_round.compressors.data_driven import CalibratedRTNCompressor, DataDrivenCompressordiff --git a/auto_round/experimental/apply_rotation_transform.py b/auto_round/experimental/apply_rotation_transform.pyindex c04da06af..2d6956528 100644--- a/auto_round/experimental/apply_rotation_transform.py+++ b/auto_round/experimental/apply_rotation_transform.py@@ -3,10 +3,10 @@"""Backward-compat re-export shim.The canonical implementation now lives in-:mod:`auto_round.algorithms.transforms.quarot.dispatcher`.+:mod:`auto_round.algorithms.transforms.hadamard.dispatcher`."""-from auto_round.algorithms.transforms.quarot.dispatcher import ( # noqa: F401+from auto_round.algorithms.transforms.hadamard.dispatcher import ( # noqa: F401apply_hadamard_rotation,resolve_hadamard_backend,)diff --git a/auto_round/experimental/utils.py b/auto_round/experimental/utils.pyindex 29509020b..c9a5dd2aa 100644--- a/auto_round/experimental/utils.py+++ b/auto_round/experimental/utils.py@@ -16,7 +16,7 @@ from typing import Anyimport torch-from auto_round.algorithms.transforms.quarot import HADAMARDS, RotationConfig+from auto_round.algorithms.transforms.hadamard import HADAMARDS, RotationConfigfrom auto_round.compressors.utils import is_mx_fp, is_nv_fpfrom auto_round.utils import logger@@ -128,7 +128,7 @@ def is_triton_kernel_available(data_type: str) -> bool:return Falsetry:- from auto_round.algorithms.transforms.quarot.utils.triton.mxfp4 import ( # pylint: disable=E0401+ from auto_round.algorithms.transforms.hadamard.utils.triton.mxfp4 import ( # pylint: disable=E0401mxfp4_forward_kernel_wrapper,)except Exception:@@ -138,19 +138,19 @@ def is_triton_kernel_available(data_type: str) -> bool:def dump_group_size_to_rotation_config(rotation_config: str | dict | RotationConfig, group_size: int):- from auto_round.algorithms.transforms.quarot.config import dump_group_size_to_rotation_config as _impl+ from auto_round.algorithms.transforms.hadamard.config import dump_group_size_to_rotation_config as _implreturn _impl(rotation_config, group_size)def to_dict_rotation_config(rotation_config: str | dict | RotationConfig):- from auto_round.algorithms.transforms.quarot.config import to_dict_rotation_config as _impl+ from auto_round.algorithms.transforms.hadamard.config import to_dict_rotation_config as _implreturn _impl(rotation_config)def normalize_rotation_config(rotation_config: str | dict | RotationConfig | None, data_type: str) -> dict[str, Any]:- from auto_round.algorithms.transforms.quarot.config import normalize_rotation_config as _impl+ from auto_round.algorithms.transforms.hadamard.config import normalize_rotation_config as _implreturn _impl(rotation_config, data_type)diff --git a/setup.py b/setup.pyindex bac4362f7..9cf654d81 100644--- a/setup.py+++ b/setup.py@@ -187,7 +187,7 @@ if __name__ == "__main__":package_data={"": ["mllm/templates/*.json",- "algorithms/transforms/quarot/utils/hadamards.safetensors",+ "algorithms/transforms/hadamard/utils/hadamards.safetensors",]},)