Skip to content

Conversation

chilo-ms
Copy link
Contributor

@chilo-ms chilo-ms commented Jul 16, 2025

Enable free dimension override even when the graph optimization level is 0.
If the optimization level is above 0, the override will be applied during level 1 optimization.

Copilot

This comment was marked as outdated.

@jywu-msft jywu-msft requested a review from skottmckay July 16, 2025 19:54
@chilo-ms chilo-ms requested a review from Copilot July 16, 2025 21:04
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

The PR enables free dimension override at graph optimization level 0 by extending the transformer registration loop and adding a Default case in the transformer generator.

  • Iterate transformers from Default through MaxLevel in AddPredefinedTransformers
  • Introduce special handling to apply free dimension overrides at optimization level 0
  • Add a case TransformerLevel::Default branch in GenerateTransformers

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
core/session/inference_session.cc Expand transformer loop to include Default and register override even at level 0
core/optimizer/graph_transformer_utils.cc Add Default case to push FreeDimensionOverrideTransformer
Comments suppressed due to low confidence (1)

onnxruntime/core/optimizer/graph_transformer_utils.cc:223

  • Add or update unit tests to verify that free dimension overrides are applied when the optimization level is Default.
    case TransformerLevel::Default: {

@skottmckay
Copy link
Contributor

Can we add a unit test to validate? There should already be free dimension override tests that we can leverage.

@chilo-ms
Copy link
Contributor Author

Can we add a unit test to validate? There should already be free dimension override tests that we can leverage.

unit tests added

Copy link
Contributor

@skottmckay skottmckay left a comment

Choose a reason for hiding this comment

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

:shipit:

@jywu-msft jywu-msft merged commit 819f32f into main Jul 17, 2025
90 checks passed
@jywu-msft jywu-msft deleted the chi/enable_free_dim_override_if_graph_opt_level_0 branch July 17, 2025 22:31
@snnn
Copy link
Member

snnn commented Jul 25, 2025

Hi there! We haven't cut the release branch for this version yet, so I'm removing the release:1.23.0 label for now to keep things tidy. Thanks so much for your contribution! We'll make sure this gets included when the release is prepared. 🤖

qti-yuduo pushed a commit to CodeLinaro/onnxruntime that referenced this pull request Aug 8, 2025
…oft#25425)

Enable free dimension override even when the graph optimization level is
0.
If the optimization level is above 0, the override will be applied
during level 1 optimization.
sanketkaleoss pushed a commit to sanketkaleoss/onnxruntime that referenced this pull request Aug 11, 2025
…oft#25425)

Enable free dimension override even when the graph optimization level is
0.
If the optimization level is above 0, the override will be applied
during level 1 optimization.
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.

4 participants