test(e2e): add dynamic-axes e2e tests for export, config, build, perf#1127
Merged
Conversation
Cover the shared --dynamic-axes option across the four commands that support it, using microsoft/resnet-50: export marks the named input axis symbolic (dim_param) and propagates it to logits, config records the mapping under export.dynamic_axes, the symbolic batch dim survives a full build, and perf re-exports so the benchmarked model exposes a dynamic batch axis.
KayMKM
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds end-to-end coverage for the shared
--dynamic-axesoption, which had no e2e tests. The flag is exposed by four commands —export,config,build, andperf— and this PR exercises each withmicrosoft/resnet-50(singlepixel_valuesinput,logitsoutput).--dynamic-axestakes a JSON mapping of tensor name →{axis: symbolic_name}and marks those axes as symbolic (dim_param) in the exported ONNX instead of fixed integers.What's covered
Each test lives in the existing per-command e2e file, reusing its helpers/fixtures:
test_export_e2e.py→TestExportDynamicAxesdim_param="batch") and propagates tologits; channel/spatial dims stay static.[1, 3, 224, 224].batch/height/width).test_config_e2e.py→TestConfigDynamicAxesexport.dynamic_axes; absent by default; multi-axis mapping preserved.test_build_e2e.py→TestBuildDynamicAxestest_perf_e2e.py→TestPerfDynamicAxes--ignore-cache --no-skip-buildre-exports, so the benchmarked model reports a dynamic (None) batch axis and the running ONNX carriesdim_param="batch".Note:
quantizealso has a "dynamic" concept, but that is a quantization mode (dynamic quantization) and not--dynamic-axes, so it is intentionally excluded.Notes
pixel_values, consistent with the existing resnet-50 e2e suite.uv run pytest -m e2e ...);ruff checkis clean.