Skip to content

Show the auto-opt deprecation notice and clean up CLI debug output - #2738

Merged
Jambay Kinley (jambayk) merged 2 commits into
microsoft:mainfrom
Iyanuoluwa007:review-quick-fixes
Oct 30, 2026
Merged

Jambay Kinley (jambayk) merged 2 commits into
microsoft:mainfrom
Iyanuoluwa007:review-quick-fixes

Conversation

@Iyanuoluwa007

Copy link
Copy Markdown
Contributor

Describe your changes

Picks up three of the CLI quick fixes listed in the codebase review (#2516) that are still present on main:

  • auto-opt deprecation was invisible. AutoOptCommand.run emitted it with logger.warning, but the default --log_level is 3 (ERROR), so it never showed. It is now printed to stderr, so it shows regardless of log level. The auto-opt how-to page and the CLI reference now carry a deprecation note pointing to optimize.
  • quantize debug prints. olive quantize printed pass list: [...] and selected pass configs: {...} to stdout on every run. These are now logger.debug. The "requires dataset" warning goes to stderr instead of stdout.
  • run-pass error output. When --list_passes fails to load the pass configs, the error lines go to stderr (exit code was already 1).

Other review items (ruff target-version, which would reformat roughly 1000 lines, kebab/snake case flag cleanup, dependency upper bounds) are larger changes and are not part of this PR. The capture-onnx-graph bool parsing item is already covered by #2647.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass. (pytest test/cli/test_cli.py: new tests pass and fail without the fix. The only failures in my env are the 11 tests that spawn the olive console script, which is not on PATH because my venv is not activated. They fail the same way on main.)
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a (ruff 0.15.11 check and format on olive/cli and test/cli)
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.
    olive auto-opt now always shows its deprecation notice, and olive quantize no longer prints internal pass configuration to stdout.

(Optional) Issue link

Part of #2516

Copilot AI balanced review requested due to automatic review settings October 16, 2026 19:20
From the CLI quick fixes in the codebase review:

- The auto-opt deprecation warning was emitted through logger.warning, which
  the default --log_level (ERROR) hides, so users never saw it. Print it to
  stderr instead, and add a deprecation note to the auto-opt how-to page and
  the CLI reference.
- quantize printed internal "pass list" and "selected pass configs" debug
  output to stdout. Log them at debug level instead, and send the
  dataset-required warning to stderr.
- run-pass --list_passes now prints its error message to stderr.

Part of microsoft#2516
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Quantization debug diagnostics remain suppressed even when users explicitly request debug logging.

1 open finding
What changed in this PR

This PR improves Olive CLI diagnostics and documents the migration from auto-opt to optimize.

Changes:

  • Sends deprecation notices and selected errors/warnings to stderr.
  • Moves quantization diagnostics to debug logging.
  • Adds regression tests and deprecation documentation.
File Description
test/​cli/​test_cli.py Tests deprecation visibility and clean quantization stdout.
olive/​cli/​run_pass.py Sends pass-listing errors to stderr.
olive/​cli/​quantize.py Uses debug logging and redirects dataset warnings.
olive/​cli/​auto_opt.py Makes the deprecation notice independent of logging level.
docs/​source/​reference/​cli.rst Adds a deprecation warning.
docs/​source/​how-to/​cli/​cli-auto-opt.md Directs users to optimize.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread olive/cli/quantize.py Resolved
The quantize debug diagnostics are logged while the run config is generated,
but the requested log level was only applied later by the workflow runner
(and never for dry runs), so `--log_level 0` still dropped them. Set the
Olive logger level at the start of _run_workflow.
@jambayk
Jambay Kinley (jambayk) merged commit 53da4cf into microsoft:main Oct 30, 2026
17 checks passed
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