Skip to content

feat: add --submodel to perf and build commands#1089

Open
xieofxie wants to merge 3 commits into
mainfrom
xieofxie-submodel-perf-build
Open

feat: add --submodel to perf and build commands#1089
xieofxie wants to merge 3 commits into
mainfrom
xieofxie-submodel-perf-build

Conversation

@xieofxie

Copy link
Copy Markdown
Contributor

Summary

Expands the --submodel capability (added to winml export in #1031) to the winml perf and winml build commands, letting users select a single sub-model of a composite model instead of processing all of them.

Changes

winml build (build.py)

  • Adds --submodel <name> option.
  • After the existing resolve_composite_components() detection, validates and filters the components dict, mirroring export:
    • --submodel on a non-composite model → BadParameter ("not a composite model").
    • Unknown name → BadParameter listing available sub-models.
    • Otherwise narrows the fan-out to just that one sub-model build.

winml perf (perf.py)

  • Adds --submodel <name> option and BenchmarkConfig.submodel field.
  • perf detects composites post-load, so _run_sub_models() filters the loaded sub_models dict to the requested name (unknown → UsageError), and run() errors when --submodel is passed for a non-composite model.

Tests

  • TestBuildSubmodel: filters to one component, rejects unknown name, rejects non-composite.
  • TestPerfSubmodelFilter: benchmarks only the requested sub-model, runs only that session, rejects unknown name, rejects non-composite.

Verification: ruff clean, mypy clean on both modules; build/perf-composite (119) and perf-cli (68) tests pass.

@xieofxie xieofxie requested a review from a team as a code owner July 10, 2026 07:45
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