refactor scheme,layer_config and formats#2013
Open
n1ck-guo wants to merge 10 commits into
Open
Conversation
Signed-off-by: n1ck-guo <heng.guo@intel.com>
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
# Conflicts: # auto_round/compressors/utils.py
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>
Collaborator
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please briefly describe your main changes, the motivation.
Type of Change
Refactor
Related Issues
Fixes or relates to #
Checklist Before Submitting
/azp run Unit-Test-CUDA-AutoRound.