Skip to content

fix(perf): honor configured input value ranges - #1309

Draft
ssss141414 wants to merge 1 commit into
microsoft:mainfrom
ssss141414:perf-input-value-ranges
Draft

fix(perf): honor configured input value ranges#1309
ssss141414 wants to merge 1 commit into
microsoft:mainfrom
ssss141414:perf-input-value-ranges

Conversation

@ssss141414

@ssss141414 ssss141414 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes classic winml perf honor input_value_ranges persisted in winml_build_config.json when generating random model inputs.

This generic Perf behavior fix was originally extracted from #1299 because it applies to every model that declares input ranges, not only VitPose. It is now rebased on the merged #1299.

Changes

  • Load persisted input ranges as floating-point bounds in WinMLSession.
  • Forward per-input ranges into the generic spec-driven random input generator.
  • Preserve the existing behavior for models with no declared range.

Compatibility

There is no public API change. Perf input distributions intentionally change for models whose build config declares a range; their generated inputs now match that contract instead of silently using the default range. Historical Perf measurements for those models may therefore differ.

Validation

  • tests/unit/commands/test_perf_cli.py: 122 passed
  • Rebased integration suite (test_perf_cli.py, test_perf_genai.py, test_winml_session.py): 288 passed, 6 skipped
  • Ruff check: passed
  • Ruff format check: passed

Follow-up to merged #1299.

@ssss141414 ssss141414 added the model-scale-by-skill Model support PR created or maintained by the adding-model-support skill label Aug 14, 2026
ssss141414 added a commit that referenced this pull request Aug 14, 2026
## Summary

Adds CPU fp32/fp16 recipes for `nielsr/vitpose-base-simple` and fixes
recipe-free VitPose input generation.

Optimum's `VitPoseDummyInputGenerator` inherits a static Vision
generator that reloads preprocessors and indexes the result with `[-1]`.
Config-only resolution has no loaded processor, so that path raises
`IndexError`. A WinML `VitPoseIOConfig` now preserves Optimum's VitPose
I/O declarations and model patcher while replacing only its dummy
generator with the config-driven `DummyVisionInputGenerator`.

The workaround is contained in the existing VitPose model adapter.
Generic export I/O behavior is unchanged.

The generic Perf range-consumption change was split into #1309. The
VitPose evaluator processor fallback was split into #1310.

## Baseline and outcome

Without a recipe, current-main baseline export resolves
`VitPoseOnnxConfig` but fails while its static dummy generator loads an
empty processor list:

```text
Error: Build failed: list index out of range
```

With this change, recipe-free input resolution produces `pixel_values`
`[1, 3, 256, 192]`. The checked-in recipes represent verified CPU
fp32/fp16 coverage.

## Validation

- Final head: `5635a06aee12a2dfe3d2f0a4e7c92dc8ac00f8f1`
- Recipe-free CPU fp32 `winml build`: passed; `pixel_values` `[1, 3,
256, 192]` float32 -> `heatmaps`; final `model.onnx` generated
- Checked-in CPU fp32 recipe `winml build`: exit 0; completed in 73.5s;
final `model.onnx` generated
- Checked-in CPU fp16 recipe `winml build`: exit 0; completed in 82.7s
(Export 38.0s, Optimize 35.3s, FP16 8.8s); final `model.onnx` generated
- `tests/unit/export/test_io.py` +
`tests/unit/models/test_vitpose_mapping.py`: 101 passed
- Ruff check: passed
- Ruff format check: passed
- GitHub checks: 9/9 passed
- Recipe README remains unchanged

## Files

-
`examples/recipes/nielsr_vitpose-base-simple/cpu/cpu/keypoint-detection_fp32_config.json`
-
`examples/recipes/nielsr_vitpose-base-simple/cpu/cpu/keypoint-detection_fp16_config.json`
- `src/winml/modelkit/models/hf/vitpose.py`
- `tests/unit/models/test_vitpose_mapping.py`
@ssss141414
ssss141414 force-pushed the perf-input-value-ranges branch from c572c66 to d5b62bd Compare August 14, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model-scale-by-skill Model support PR created or maintained by the adding-model-support skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant