Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
89fcb80
update
wenhuach21 Jul 10, 2026
7fd8e31
refine calibration
wenhuach21 Jul 10, 2026
9879bdf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
dda7019
update
wenhuach21 Jul 10, 2026
c3b8d65
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 10, 2026
a434d30
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
9de04c7
update
wenhuach21 Jul 10, 2026
59fc3e1
delete calibrated compressor
wenhuach21 Jul 10, 2026
1f00668
Merge branch 'main' into refine_calib
wenhuach21 Jul 10, 2026
f3a39c0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
03d54f8
update
wenhuach21 Jul 10, 2026
ffece56
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 10, 2026
b52c7ba
update
wenhuach21 Jul 10, 2026
d5df818
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
a85831e
update
wenhuach21 Jul 13, 2026
fbde68c
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 13, 2026
e2a1a2a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 13, 2026
13dba59
fix
wenhuach21 Jul 13, 2026
f902622
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 13, 2026
6370a91
fix
wenhuach21 Jul 13, 2026
854bdba
fix
wenhuach21 Jul 13, 2026
cd8e38d
fix
wenhuach21 Jul 13, 2026
84eda88
fix
wenhuach21 Jul 13, 2026
5d41cf4
Merge branch 'main' into refine_calib
wenhuach21 Jul 13, 2026
d0227e9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 13, 2026
21655c6
trigger ut
wenhuach21 Jul 13, 2026
4e03283
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 13, 2026
6f5f61c
fix mllm ut
wenhuach21 Jul 13, 2026
98a0511
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 13, 2026
b0e0f54
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 13, 2026
136729e
fix ut
wenhuach21 Jul 13, 2026
3c1f9d5
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 13, 2026
02c1436
Merge branch 'main' into refine_calib
wenhuach21 Jul 13, 2026
fba33de
fix some ut issues
wenhuach21 Jul 13, 2026
8134744
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 13, 2026
ee7f5a0
fix some uts
wenhuach21 Jul 13, 2026
0744571
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 13, 2026
db5ea9d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 13, 2026
ac3f5ad
fix one issue
wenhuach21 Jul 14, 2026
3a4d354
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 14, 2026
12af12d
try to fix ut
wenhuach21 Jul 14, 2026
1d05a82
update
wenhuach21 Jul 14, 2026
5c45b57
fix
wenhuach21 Jul 14, 2026
d0cd22b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 14, 2026
66d663c
update
wenhuach21 Jul 14, 2026
6add45f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 14, 2026
01d1b42
update
wenhuach21 Jul 14, 2026
ef073fc
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 14, 2026
9d6dec2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 14, 2026
001e4d3
adjust
wenhuach21 Jul 14, 2026
ad79ee5
update
wenhuach21 Jul 14, 2026
4486175
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 14, 2026
aa5d2f0
update
wenhuach21 Jul 14, 2026
6c9efd8
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 14, 2026
4237f49
update
wenhuach21 Jul 14, 2026
ebcfee7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 14, 2026
03b68da
try to fix some uts
wenhuach21 Jul 14, 2026
8fa6f5d
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 14, 2026
229124b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 14, 2026
3dfe627
update
wenhuach21 Jul 14, 2026
c04181b
add comments
wenhuach21 Jul 14, 2026
eac9d90
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 14, 2026
f06557b
Merge branch 'main' into refine_calib
wenhuach21 Jul 14, 2026
1b2ff27
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 14, 2026
a3ce2ec
try to fix uts
wenhuach21 Jul 15, 2026
6140268
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 15, 2026
7764862
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 15, 2026
87e37e8
fix
wenhuach21 Jul 15, 2026
da688b9
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 15, 2026
64bbbaf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 15, 2026
83c7dad
update
wenhuach21 Jul 15, 2026
1e92dfb
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 15, 2026
8f2b7be
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 15, 2026
2ea2773
update
wenhuach21 Jul 15, 2026
6d7c4f1
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 15, 2026
4f1fdaf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 15, 2026
cb14e05
fix gguf vram issue
wenhuach21 Jul 15, 2026
2fc5b6d
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 15, 2026
e994c95
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 15, 2026
31525dd
update
wenhuach21 Jul 15, 2026
6aca8f6
fix
wenhuach21 Jul 15, 2026
00685d0
Merge branch 'main' into refine_calib
wenhuach21 Jul 15, 2026
3135c0e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 15, 2026
1c1ea73
fix
wenhuach21 Jul 16, 2026
38ba7fd
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 16, 2026
9cc928c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 16, 2026
edb7368
update
wenhuach21 Jul 16, 2026
8892ce2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 16, 2026
0c348ae
优化内存清理逻辑以确保内存监控的一致性
xin3he Jul 16, 2026
6b970ce
try to decouple calib with compressor
wenhuach21 Jul 16, 2026
4d2b537
try to decouple calib with compressor
wenhuach21 Jul 16, 2026
a11f099
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 16, 2026
b06cae6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 16, 2026
4260616
comment some uts
wenhuach21 Jul 16, 2026
bbbaa88
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 16, 2026
c13c619
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 16, 2026
836197d
fix
wenhuach21 Jul 16, 2026
3d202fc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 16, 2026
4629958
fix
wenhuach21 Jul 16, 2026
aef674b
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 16, 2026
111a4bc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 16, 2026
19f4272
update
wenhuach21 Jul 17, 2026
23c4735
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 17, 2026
4b0459a
update
wenhuach21 Jul 17, 2026
f885616
update
wenhuach21 Jul 17, 2026
2c01cf0
update
wenhuach21 Jul 17, 2026
bfae627
update
wenhuach21 Jul 17, 2026
c58ca83
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 17, 2026
051582a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 17, 2026
00fd21b
fix
wenhuach21 Jul 17, 2026
05e47c1
Merge branch 'refine_calib' of https://github.com/intel/auto-round in…
wenhuach21 Jul 17, 2026
47f47bb
update
wenhuach21 Jul 17, 2026
b601152
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 17, 2026
70dee51
fix
wenhuach21 Jul 17, 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
51 changes: 2 additions & 49 deletions auto_round/algorithms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,17 @@
# limitations under the License.


from contextlib import contextmanager
from typing import Any

from auto_round.algorithms.registry import resolve_pipeline_member
from auto_round.schemes import QuantizationScheme


class BaseAlgorithm:
pass


# TODO later wenhuach may be deleted
class BasePipelineMember:
"""Shared interface for all members of a quantization pipeline."""

model_context = None
compress_context = None
_scheme_context_fields = set(QuantizationScheme.get_attributes())
bits: int | None
group_size: int | tuple | None
sym: bool | None
data_type: str | None
act_bits: int | None
act_group_size: int | None
act_sym: bool | None
act_data_type: str | None
act_dynamic: bool | None
super_bits: int | None
super_group_size: int | None
super_sym: bool | None
scale_dtype: str | None

def __init__(self, config: Any = None) -> None:
self.config = config
Expand All @@ -58,6 +39,7 @@ def from_config(cls, config: Any) -> "BasePipelineMember":

def bind(self, compressor: Any) -> None:
"""Wire shared context from the owning compressor."""
# self.compressor = compressor
self.model_context = compressor.model_context
self.compress_context = compressor.compress_context
self.scheme = getattr(compressor, "scheme_context", None)
Expand All @@ -66,35 +48,6 @@ def prepare_run(self, compressor: Any) -> None:
"""Model-level preparation called once before block iteration starts."""
return

def get_act_calib_policy(self, ctx: Any) -> Any:
"""Return the activation calibration policy for this block."""
from auto_round.algorithms.pipeline import ActCalibPolicy, CalibTiming, InputSource

return ActCalibPolicy(when=CalibTiming.SKIP, source=InputSource.FP_CACHE)

@contextmanager
def block_forward_hooks(self, ctx: Any) -> Any:
"""Register algorithm-specific forward hooks for the reference forward."""
yield []

def finalize_run(self, compressor: Any) -> None:
"""Model-level teardown called once after all blocks are processed."""
return


def _make_scheme_property(name):
def getter(self):
scheme = getattr(self, "scheme", None)
return getattr(scheme, name, None) if scheme is not None else None

def setter(self, value):
scheme = getattr(self, "scheme", None)
if scheme is None:
raise AttributeError(f"{type(self).__name__} has no bound scheme")
setattr(scheme, name, value)

return property(getter, setter)


for _scheme_field in QuantizationScheme.get_attributes():
setattr(BasePipelineMember, _scheme_field, _make_scheme_property(_scheme_field))
20 changes: 10 additions & 10 deletions auto_round/algorithms/config_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ def resolve_shared_config_values(configs: list[Any]) -> list[Any]:
return configs


def sync_shared_config_from(source_config: Any, target_configs: list[Any]) -> None:
"""Propagate resolved source values to targets that already define matching attrs."""
source_attrs = _public_config_attrs(source_config)
for target in _quantization_configs(target_configs):
if target is source_config:
continue
target_attrs = _public_config_attrs(target)
for attr_name, source_value in source_attrs.items():
if attr_name in target_attrs and source_value is not None:
setattr(target, attr_name, source_value)
# def sync_shared_config_from(source_config: Any, target_configs: list[Any]) -> None:
# """Propagate resolved source values to targets that already define matching attrs."""
# source_attrs = _public_config_attrs(source_config)
# for target in _quantization_configs(target_configs):
# if target is source_config:
# continue
# target_attrs = _public_config_attrs(target)
# for attr_name, source_value in source_attrs.items():
# if attr_name in target_attrs and source_value is not None:
# setattr(target, attr_name, source_value)
Loading
Loading