Skip to content

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__.py
index 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 RotationConfig
from auto_round.algorithms.transforms.spinquant.preprocessor import SpinQuantConfig
from auto_round.schemes import QuantizationScheme
from auto_round.auto_scheme import AutoScheme
diff --git a/auto_round/algorithms/transforms/__init__.py b/auto_round/algorithms/transforms/__init__.py
index 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 optional
online 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 _RC
cfg = _RC(
block_size=rotation_config["block_size"],
diff --git a/auto_round/algorithms/transforms/base.py b/auto_round/algorithms/transforms/base.py
index 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__.py
similarity index 85%
rename from auto_round/algorithms/transforms/quarot/__init__.py
rename to auto_round/algorithms/transforms/hadamard/__init__.py
index 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.py
similarity index 92%
rename from auto_round/algorithms/transforms/quarot/apply.py
rename to auto_round/algorithms/transforms/hadamard/apply.py
index 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 nn
import tqdm
from 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_transform
from auto_round.compressors.utils import is_nv_fp
from auto_round.experimental.qmodules.base import QModuleBase
from 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: F401
mxfp4_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_transform
model = 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_backend
backend = 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_matmul
inp_transform = build_hadamard_transform(
**config.model_dump(),
@@ -273,7 +273,7 @@ def _apply_input_transform(module: torch.nn.Module, config: RotationConfig, data
hadamard_weight = None
if _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_wrapper
def _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.py
similarity index 98%
rename from auto_round/algorithms/transforms/quarot/config.py
rename to auto_round/algorithms/transforms/hadamard/config.py
index 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 any
weight/activation dtype and can optionally fuse the online Hadamard into
weights (``fuse_online_to_weight=True``).
* ``backend="transform"`` – Per-Linear weight + activation Hadamard with a
fused triton kernel, implemented under
- :mod:`auto_round.algorithms.transforms.quarot.apply`. Supports only
+ :mod:`auto_round.algorithms.transforms.hadamard.apply`. Supports only
MXFP4 / NVFP4 and cannot fuse online to weight.
* ``backend="auto"`` – dispatcher picks inplace when a fused online rotation
diff --git a/auto_round/algorithms/transforms/quarot/dispatcher.py b/auto_round/algorithms/transforms/hadamard/dispatcher.py
similarity index 93%
rename from auto_round/algorithms/transforms/quarot/dispatcher.py
rename to auto_round/algorithms/transforms/hadamard/dispatcher.py
index 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/activation
dtype. 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, Union
import torch
import 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_config
from auto_round.compressors.utils import is_mx_fp, is_nv_fp
from 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_transform
return 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__.py
similarity index 56%
rename from auto_round/algorithms/transforms/quarot/inplace/__init__.py
rename to auto_round/algorithms/transforms/hadamard/inplace/__init__.py
index 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.py
similarity index 99%
rename from auto_round/algorithms/transforms/quarot/inplace/apply.py
rename to auto_round/algorithms/transforms/hadamard/inplace/apply.py
index 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, Union
import torch
import 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.py
similarity index 99%
rename from auto_round/algorithms/transforms/quarot/inplace/hooks.py
rename to auto_round/algorithms/transforms/hadamard/inplace/hooks.py
index 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_model
mapping = infer_mapping_from_model(model)
@@ -368,7 +368,7 @@ def get_hadK(n: int, transpose=False) -> (torch.Tensor, int):
K = 1
return hadK, K
else:
- from auto_round.algorithms.transforms.quarot.utils.math import _fetch_hadamard_divisor
+ from auto_round.algorithms.transforms.hadamard.utils.math import _fetch_hadamard_divisor
hadK = _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.py
similarity index 100%
rename from auto_round/algorithms/transforms/quarot/inplace/model_config.py
rename to auto_round/algorithms/transforms/hadamard/inplace/model_config.py
diff --git a/auto_round/algorithms/transforms/quarot/patch.py b/auto_round/algorithms/transforms/hadamard/patch.py
similarity index 100%
rename from auto_round/algorithms/transforms/quarot/patch.py
rename to auto_round/algorithms/transforms/hadamard/patch.py
diff --git a/auto_round/algorithms/transforms/quarot/transforms.py b/auto_round/algorithms/transforms/hadamard/transforms.py
similarity index 97%
rename from auto_round/algorithms/transforms/quarot/transforms.py
rename to auto_round/algorithms/transforms/hadamard/transforms.py
index 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, Dict
import torch
import 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__.py
similarity index 100%
rename from auto_round/algorithms/transforms/quarot/utils/__init__.py
rename to auto_round/algorithms/transforms/hadamard/utils/__init__.py
diff --git a/auto_round/algorithms/transforms/quarot/utils/hadamards.safetensors b/auto_round/algorithms/transforms/hadamard/utils/hadamards.safetensors
similarity index 100%
rename from auto_round/algorithms/transforms/quarot/utils/hadamards.safetensors
rename to auto_round/algorithms/transforms/hadamard/utils/hadamards.safetensors
diff --git a/auto_round/algorithms/transforms/quarot/utils/math.py b/auto_round/algorithms/transforms/hadamard/utils/math.py
similarity index 100%
rename from auto_round/algorithms/transforms/quarot/utils/math.py
rename to auto_round/algorithms/transforms/hadamard/utils/math.py
diff --git a/auto_round/algorithms/transforms/quarot/utils/matrix.py b/auto_round/algorithms/transforms/hadamard/utils/matrix.py
similarity index 100%
rename from auto_round/algorithms/transforms/quarot/utils/matrix.py
rename to auto_round/algorithms/transforms/hadamard/utils/matrix.py
diff --git a/auto_round/algorithms/transforms/quarot/utils/triton/__init__.py b/auto_round/algorithms/transforms/hadamard/utils/triton/__init__.py
similarity index 100%
rename from auto_round/algorithms/transforms/quarot/utils/triton/__init__.py
rename to auto_round/algorithms/transforms/hadamard/utils/triton/__init__.py
diff --git a/auto_round/algorithms/transforms/quarot/utils/triton/mxfp4.py b/auto_round/algorithms/transforms/hadamard/utils/triton/mxfp4.py
similarity index 100%
rename from auto_round/algorithms/transforms/quarot/utils/triton/mxfp4.py
rename to auto_round/algorithms/transforms/hadamard/utils/triton/mxfp4.py
diff --git a/auto_round/algorithms/transforms/spinquant/inplace/__init__.py b/auto_round/algorithms/transforms/spinquant/inplace/__init__.py
index 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.py
index 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 registration
that 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 a
diff --git a/auto_round/algorithms/transforms/spinquant/rotation_utils.py b/auto_round/algorithms/transforms/spinquant/rotation_utils.py
index 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_weight
except 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_layers
layer_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 _get
return _get(model)
except ImportError:
diff --git a/auto_round/cli/algorithms.py b/auto_round/cli/algorithms.py
index 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 RotationConfig
hadamard_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 RTNConfig
from auto_round.algorithms.quantization.sign_round.config import SignRoundConfig
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 RotationConfig
register_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.py
index 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 SignRoundConfig
from auto_round.algorithms.registry import normalize_algorithm_config, resolve_alg_config
from auto_round.algorithms.transforms import normalize_rotation_config as _normalize_rotation_alg_config
from 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 _NewArchRotationConfig
from auto_round.auto_scheme.gen_auto_scheme import AutoScheme
from auto_round.compressors.base import BaseCompressor
from auto_round.compressors.data_driven import CalibratedRTNCompressor, DataDrivenCompressor
diff --git a/auto_round/experimental/apply_rotation_transform.py b/auto_round/experimental/apply_rotation_transform.py
index 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: F401
apply_hadamard_rotation,
resolve_hadamard_backend,
)
diff --git a/auto_round/experimental/utils.py b/auto_round/experimental/utils.py
index 29509020b..c9a5dd2aa 100644
--- a/auto_round/experimental/utils.py
+++ b/auto_round/experimental/utils.py
@@ -16,7 +16,7 @@ from typing import Any
import torch
-from auto_round.algorithms.transforms.quarot import HADAMARDS, RotationConfig
+from auto_round.algorithms.transforms.hadamard import HADAMARDS, RotationConfig
from auto_round.compressors.utils import is_mx_fp, is_nv_fp
from auto_round.utils import logger
@@ -128,7 +128,7 @@ def is_triton_kernel_available(data_type: str) -> bool:
return False
try:
- 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=E0401
mxfp4_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 _impl
return _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 _impl
return _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 _impl
return _impl(rotation_config, data_type)
diff --git a/setup.py b/setup.py
index 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",
]
},
)