Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ff91f07
tmp change
wenhuach21 Mar 31, 2026
65f7a6f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 31, 2026
267b6a2
o_proj quantization has not been handled
wenhuach21 Apr 7, 2026
9609db3
update
wenhuach21 Apr 7, 2026
c13d24b
update
wenhuach21 Apr 8, 2026
eb3ee0a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2026
f41771c
update
wenhuach21 Apr 8, 2026
1455702
Merge branch 'hadamard_change' of https://github.com/intel/auto-round…
wenhuach21 Apr 8, 2026
df14371
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2026
e3c1d93
support not using fast hadamard
wenhuach21 Apr 8, 2026
02ce508
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2026
a978b4c
update
wenhuach21 Apr 8, 2026
d790ce0
update
wenhuach21 Apr 8, 2026
936c2f5
support opt-125m by AI, it seems that the accuracy dropped after rota…
wenhuach21 Apr 8, 2026
8ca7973
update
wenhuach21 Apr 8, 2026
c07b3b1
update
wenhuach21 Apr 8, 2026
89516fe
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2026
3760a3b
update
wenhuach21 Apr 8, 2026
8ac1cee
Merge branch 'hadamard_change' of https://github.com/intel/auto-round…
wenhuach21 Apr 8, 2026
ccf8661
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2026
7a7276e
fix
wenhuach21 Apr 8, 2026
cb09ae5
Merge branch 'hadamard_change' of https://github.com/intel/auto-round…
wenhuach21 Apr 8, 2026
a009d9a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2026
8c1b4f6
Merge branch 'main' into hadamard_change
wenhuach21 Apr 9, 2026
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
1 change: 1 addition & 0 deletions auto_round/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ def tune(args):
model_dtype=args.model_dtype,
momentum=args.momentum,
trust_remote_code=not args.disable_trust_remote_code,
hadamard_config="default",
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This forces hadamard_config="default" for every CLI tune run, changing default behavior and (with the current BaseCompressor changes) triggering the hadamard path without actually applying it / initializing self.hadamard_config, which can lead to downstream failures during save/export. Consider making this opt-in via a CLI flag or keep the previous default None.

Suggested change
hadamard_config="default",
hadamard_config=None,

Copilot uses AI. Check for mistakes.
)

model_name = args.model.rstrip("/")
Expand Down
36 changes: 25 additions & 11 deletions auto_round/compressors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,18 +557,32 @@ def __init__(
except (ImportError, ModuleNotFoundError):
logger.error("algorithm extension import error, fallback to default mode")

# apply hadamard transform
hadamard_config = 1
if hadamard_config:
from auto_round.experimental.transform.apply import apply_hadamard_transform
from auto_round.experimental.utils import check_supported_schemes, normalize_hadamard_config

check_supported_schemes(self.scheme)

self.model = apply_hadamard_transform(
self.model, hadamard_config, need_calibration=True if self.iters > 0 else False
)

self.hadamard_config = normalize_hadamard_config(hadamard_config)
self.enable_hadamard = True
from auto_round.experimental.hadamard_inplace import apply_hadamard_rotation

# from auto_round.experimental.utils import normalize_hadamard_config

#
# _hcfg = normalize_hadamard_config(hadamard_config)
# if not isinstance(_hcfg, HadamardConfig):
# _hcfg = HadamardConfig(**_hcfg)
# group_size = _hcfg.block_size # e.g. 32 for MXFP4

self.model.to("cuda")
apply_hadamard_rotation(self.model)

# from auto_round.experimental.transform.apply import apply_hadamard_transform
# from auto_round.experimental.utils import check_supported_schemes, normalize_hadamard_config
#
# check_supported_schemes(self.scheme)
#
# self.model = apply_hadamard_transform(
# self.model, hadamard_config, need_calibration=True if self.iters > 0 else False
# )
#
# self.hadamard_config = normalize_hadamard_config(hadamard_config)

def _gen_auto_scheme(self) -> dict[str, dict]:
if self.mllm:
Expand Down
2 changes: 1 addition & 1 deletion auto_round/eval/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def run_model_evaluation(model, tokenizer, autoround, folders, formats, device_s
eval_gguf_model = any(file.endswith("gguf") for file in os.listdir(eval_folder))

# Determine if model instance evaluation is needed
need_model_instance = (autoround.act_bits <= 8 and formats[-1] == "fake") or eval_gguf_model
need_model_instance = (autoround.act_bits <= 8) or formats[-1] == "fake" or eval_gguf_model

if need_model_instance:
# Load or prepare model instance
Expand Down
12 changes: 12 additions & 0 deletions auto_round/experimental/hadamard_inplace/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# # Copyright (C) 2026 Intel Corporation
# # SPDX-License-Identifier: Apache-2.0

from auto_round.experimental.hadamard_inplace.apply_hadamard_rotation import apply_hadamard_rotation

# from auto_round.experimental.hadamard_inplace.model_config import (
# MAPPING_REGISTRY,
# RotationMapping,
# get_mapping,
# infer_mapping_from_model,
# register_mapping,
# )
Loading
Loading