Skip to content

refactor scheme,layer_config and formats#2013

Open
n1ck-guo wants to merge 10 commits into
mainfrom
hengguo/refactor_707
Open

refactor scheme,layer_config and formats#2013
n1ck-guo wants to merge 10 commits into
mainfrom
hengguo/refactor_707

Conversation

@n1ck-guo

@n1ck-guo n1ck-guo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Please briefly describe your main changes, the motivation.

Type of Change

Refactor

Related Issues

Fixes or relates to #

Checklist Before Submitting

  • My code has been tested locally.
  • Documentation has been updated as needed.
  • New or updated tests are included where applicable.
  • The CUDA CI has passed. You can trigger it by commenting /azp run Unit-Test-CUDA-AutoRound.

Signed-off-by: n1ck-guo <heng.guo@intel.com>
@n1ck-guo n1ck-guo added the draft label Jul 7, 2026
@n1ck-guo n1ck-guo changed the title [WIP} refactor scheme,layer_config and formats [WIP] refactor scheme,layer_config and formats Jul 7, 2026
n1ck-guo added 5 commits July 8, 2026 12:18
Signed-off-by: n1ck-guo <heng.guo@intel.com>
…round into hengguo/refactor_622

# Conflicts:
#	auto_round/autoround.py
#	auto_round/compressors/base.py
#	auto_round/compressors/entry.py
#	auto_round/compressors/utils.py
#	auto_round/formats.py
#	test/test_cpu/utils/test_layer_config_resolution.py
# Conflicts:
#	auto_round/compressors/entry.py
#	auto_round/compressors/utils.py
#	auto_round/formats.py
#	test/test_cpu/core/test_pipeline_fail_fast.py
Signed-off-by: n1ck-guo <heng.guo@intel.com>
# Conflicts:
#	auto_round/compressors/utils.py
Signed-off-by: n1ck-guo <heng.guo@intel.com>
@n1ck-guo n1ck-guo removed the draft label Jul 21, 2026
@n1ck-guo n1ck-guo changed the title [WIP] refactor scheme,layer_config and formats refactor scheme,layer_config and formats Jul 21, 2026
n1ck-guo added 3 commits July 21, 2026 10:06
Signed-off-by: n1ck-guo <heng.guo@intel.com>
Signed-off-by: n1ck-guo <heng.guo@intel.com>
- planning/contracts.py: register a global copy.deepcopy dispatch for
  types.MappingProxyType so any object graph containing one of our frozen
  layer-config mappings (e.g. a full compressor duck-typed as a scheme by
  legacy callers) can be deep-copied instead of raising
  TypeError: cannot pickle 'mappingproxy' object.
- compressors/base.py: configure_layer_config() now resolves the scheme
  first if it hasn't been (idempotent, only for fully-initialized
  compressors) so external callers invoking it directly (e.g. llm-compressor's
  AutoRoundModifier) never hit a None scheme_context.
- layer_config/resolver.py: defensive fallback to a default QuantizationScheme
  when _resolve_layer_config_presets() receives no resolved scheme, avoiding
  a TypeError from asdict(None).
- test/test_cpu/utils/test_utils.py: fix stale mock target
  (set_layer_config -> resolve_layer_config, matching the current function
  name) and its return value shape.
- test/test_cpu/export/test_export.py: migrate legacy get_formats(fmt, ar)
  calls to the new scheme-centric signature
  get_formats(fmt, scheme, model=..., scale_dtype=...) returning a 5-tuple,
  per the intentional API change described in test_format_decoupling.py.

Signed-off-by: n1ck-guo <heng.guo@intel.com>
@AutoRoundBot

Copy link
Copy Markdown
Collaborator

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants