Skip to content

refactor algorithm cli - #2140

Open
n1ck-guo wants to merge 8 commits into
mainfrom
hengguo/refactor_cli
Open

refactor algorithm cli#2140
n1ck-guo wants to merge 8 commits into
mainfrom
hengguo/refactor_cli

Conversation

@n1ck-guo

@n1ck-guo n1ck-guo commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

refactor algorithm config and cli

  1. add register_args in alg config, automatically parses parameters, no need to manually add them in the CLI.
  2. remove deprecated args: algorithm
  3. remove rotation_config, pass by alg_config
old new
AutoRound(m, rotation_config="quarot") AutoRound(m, alg_configs=["auto_round", "quarot"])
AutoRound(m, rotation_config="default") AutoRound(m, alg_configs=["auto_round", "hadamard"])
AutoRound(m, rotation_config="random_hadamard") AutoRound(m, alg_configs=["auto_round", "random_hadamard"])
AutoRound(m, rotation_config=SpinQuantConfig(...)) AutoRound(m, alg_configs=["auto_round", SpinQuantConfig(...)])
AutoRound(m, rotation_config={"algorithm": "spinquant", ...}) dictionary format is no longer supported. construct SpinQuantConfig(...) directly and pass it to alg_configs.

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>
Signed-off-by: n1ck-guo <heng.guo@intel.com>
Signed-off-by: n1ck-guo <heng.guo@intel.com>
Signed-off-by: n1ck-guo <heng.guo@intel.com>
@chensuyue chensuyue added this to the 0.16.0 milestone Aug 11, 2026
Signed-off-by: n1ck-guo <heng.guo@intel.com>
Signed-off-by: n1ck-guo <heng.guo@intel.com>

# Conflicts:
#	test/unit/test_cuda/transform/test_spinquant.py
…d TypeError

- Revert the strict TypeError raised for kwargs that don't match the
  selected alg_configs (e.g. disable_opt_rtn passed with a non-RTN
  algorithm). This broke real callers (llm-compressor's AutoRoundModifier
  always passes disable_opt_rtn regardless of iters) and our own
  test_audio_model.py test. Log via logger.error and ignore instead, same
  as before the earlier hardening pass. The auto-discovery mechanism
  (_discover_alg_config_fields / _owning_algorithm_names) is unchanged.
- Remove the stray disable_opt_rtn=True left over from copy-paste in
  test_quantize_with_tuning (iters=1 selects SignRound, so the RTN-only
  flag never applied).
- Fix pylint line-too-long (148/120) in AWQConfig.register_args help text.

Signed-off-by: n1ck-guo <heng.guo@intel.com>
@n1ck-guo
n1ck-guo force-pushed the hengguo/refactor_cli branch from 7cee70a to 8c8dee3 Compare August 12, 2026 05:29
Signed-off-by: n1ck-guo <heng.guo@intel.com>

# Conflicts:
#	auto_round/autoround.py
#	auto_round/cli/algorithms.py
@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.

3 participants