Skip to content

feat(config): add dynamic export controls to config command#1106

Open
xieofxie wants to merge 1 commit into
mainfrom
hualxie/dynamic_config
Open

feat(config): add dynamic export controls to config command#1106
xieofxie wants to merge 1 commit into
mainfrom
hualxie/dynamic_config

Conversation

@xieofxie

Copy link
Copy Markdown
Contributor

Summary

Adds the dynamic export controls (--input-specs, --export-config, --dynamic-axes) to winml config, bringing it to parity with winml build / winml perf / winml export. This is a follow-up to #1083, which introduced these controls for build/perf and the shared cli_utils option/loader helpers.

What changed

  • commands/config.py
    • Adds the three shared options (input_specs_option, export_config_option, dynamic_axes_option) and their params.
    • Loads a sparse override mapping via cli_utils.load_export_overrides (validates early, doesn't clobber auto-detected fields).
    • New _merge_export_overrides helper applies them via the shared merge_export_overrides, so --input-specs patches the auto-resolved input_tensors by name (unlisted inputs and their dtype/value_range preserved) and symbolic dims re-derive dynamic axes through WinMLExportConfig.__post_init__.
    • Wired into the single-config, --module list, and composite-pipeline paths.
    • Rejected for pre-exported ONNX inputs and for configs with export=null (clear UsageError).
    • Shows the provided files in the console summary; adds docstring examples.
  • docs/commands/config.md: three new flag rows, an example, and a pitfall note.
  • tests/unit/commands/test_config_cli.py: TestConfigExportControls — help visibility, override forwarding/parsing, no-op when absent, and ONNX rejection.

Verification

  • ruff check + ruff format clean.
  • tests/unit/commands/test_config_cli.py (55) and test_config_composite_resolution.py + test_config_value_priority.py (63) pass.
  • Doc flag-alignment check passes.

Mirror build/perf by adding --input-specs, --export-config, and
--dynamic-axes to `winml config`. Overrides are applied via the shared
merge_export_overrides helper so --input-specs patches auto-resolved
input tensors by name (preserving unlisted inputs and their
dtype/value_range) and symbolic dims re-derive dynamic axes. Wired into
the single, --module list, and composite-pipeline paths; rejected for
pre-exported ONNX inputs and configs with export=null.

Docs and config CLI tests updated.
@xieofxie xieofxie requested a review from a team as a code owner July 14, 2026 05:15
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.

1 participant