Skip to content

Disable opset lowering by default - #281

Merged
justinchuby merged 1 commit into
mainfrom
disable-opset-lowering-default
May 6, 2026
Merged

justinchuby merged 1 commit into
mainfrom
disable-opset-lowering-default

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Change ort_lower_opset_for_ep default from True to False.

ORT now has kernel registrations for opset 24 standard ops, so the workaround of lowering the opset declaration to 23 is no longer needed by default. Users on older ORT builds can re-enable with MOBIUS_ORT_LOWER_OPSET_FOR_EP=1.

Changes

  • _flags.py: Default False, updated docstring to reflect new default and how to re-enable

Testing

All 1202 tests pass.

ORT now has kernel registrations for opset 24 standard ops, so the
workaround of lowering the opset declaration to 23 is no longer needed
by default. Users on older ORT builds can re-enable it with
MOBIUS_ORT_LOWER_OPSET_FOR_EP=1.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 8542e9f → 560c378

Model Sub-model Changes Status
gemma4 (gemma4) decoder 0 ⚪
gemma4 (gemma4) embedding 0 ⚪
gemma4 (gemma4) vision_encoder 52 🟡
gemma4_text model 0 ⚪
gemma4 (gemma4) / vision_encoder — 52 change(s)

Op summary: 176 → 190 nodes

--- base
+++ head
@@ -33,12 +33,18 @@
 Where
 Unsqueeze
 RMSNormalization
+Clip
 Transpose
 MatMul
+Clip
+Clip
 Transpose
 MatMul
+Clip
+Clip
 Transpose
 MatMul
+Clip
 Reshape
 Reshape
 Reshape
@@ -106,19 +112,27 @@
 MatMul
 Transpose
 Reshape
+Clip
 Transpose
 MatMul
+Clip
 RMSNormalization
 Add
 RMSNormalization
+Clip
 Transpose
 MatMul
+Clip
 Gelu
+Clip
 Transpose
 MatMul
+Clip
 Mul
+Clip
 Transpose
 MatMul
+Clip
 RMSNormalization
 Add
 Unsqueeze

Added nodes:

  • + Clip
  • + Clip
  • + Clip
  • + Clip
  • + Clip
  • + Clip
  • + Clip
  • + Clip
  • + Clip
  • + Clip
  • + Clip
  • + Clip
  • + Clip
  • + Clip

Modified attributes:

  • node[59] Gather: axis: 0 → 2
  • node[144] Constant: value_int: None → 1, value_ints: [1] → None
  • node[156] Constant: value_int: None → 0, value_ints: [0, 1] → None
  • node[162] Constant: value_floats: [0.0, 0.1111111111111111] → None, value_ints: None → [1]

Connectivity changes:

  • node[1] CastLike: input_ids [33, 0] → [61, 0]
  • node[3] CastLike: input_ids [35, 0] → [63, 0]
  • node[4] Mul: input_ids [0, 34] → [0, 62]
  • node[5] Sub: input_ids [37, 36] → [65, 64]
  • node[7] MatMul: input_ids [38, 39] → [66, 67]
  • node[9] Gather: input_ids [1, 41] → [1, 69]
  • node[11] Equal: input_ids [42, 43] → [70, 71]
  • node[13] Clip: input_ids [1, 45] → [1, 73]
  • node[15] Gather: input_ids [46, 47] → [74, 75]
  • node[17] Gather: input_ids [46, 49] → [74, 77]
  • node[19] Gather: input_ids [2, 51] → [2, 79]
  • node[21] Gather: input_ids [2, 53] → [2, 81]
  • node[22] Gather: input_ids [52, 48] → [80, 76]
  • node[23] Gather: input_ids [54, 50] → [82, 78]
  • node[24] Add: input_ids [55, 56] → [83, 84]
  • node[25] CastLike: input_ids [4, 57] → [4, 85]
  • node[26] Not: input_ids [44] → [72]
  • node[27] Unsqueeze: input_ids [59, 5] → [87, 5]
  • node[28] Where: input_ids [60, 57, 58] → [88, 85, 86]
  • node[29] Add: input_ids [40, 61] → [68, 89]
  • node[30] CastLike: input_ids [6, 62] → [6, 90]
  • node[31] CastLike: input_ids [4, 62] → [4, 90]
  • node[32] Where: input_ids [44, 63, 64] → [72, 91, 92]
  • node[33] Unsqueeze: input_ids [65, 7] → [93, 7]
  • node[34] RMSNormalization: input_ids [62, 8] → [90, 8]
  • node[59] Gather: input_ids [10, 88] → [1, 119]
  • node[75] Slice: input_ids [98, 18, 22, 20] → [131, 34, 31, 32]
  • node[79] Mul: input_ids [98, 95] → [138, 128]
  • node[90] Slice: input_ids [100, 18, 22, 20] → [133, 34, 31, 32]
  • node[94] Mul: input_ids [100, 95] → [153, 128]
  • node[106] Transpose: input_ids [138] → [114]
  • node[161] Add: input_ids [191, 193] → [220, 221]
  • node[169] Mul: input_ids [199, 201] → [228, 229]

Initializer changes:

  • count 31 → 59; dtype distribution: FLOAT: 22 → 50

Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

Performance Comparison

Comparing 8542e9f → 560c378

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0% ⚪
bert (feature-extraction) num_nodes 60 60 +0.0% ⚪
falcon model_size_bytes 364 KB 364 KB +0.0% ⚪
falcon num_nodes 66 66 +0.0% ⚪
gemma2 model_size_bytes 428 KB 428 KB +0.0% ⚪
gemma2 num_nodes 107 107 +0.0% ⚪
gpt2 model_size_bytes 388 KB 388 KB +0.0% ⚪
gpt2 num_nodes 53 53 +0.0% ⚪
llama model_size_bytes 425 KB 425 KB +0.0% ⚪
llama num_nodes 61 61 +0.0% ⚪
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
llama (static-cache) num_nodes 58 58 +0.0% ⚪
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0% ⚪
mamba (ssm-text-generation) num_nodes 98 98 +0.0% ⚪
phi3 model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 num_nodes 59 59 +0.0% ⚪
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 (static-cache) num_nodes 56 56 +0.0% ⚪
qwen2 model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 num_nodes 61 61 +0.0% ⚪
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 (static-cache) num_nodes 58 58 +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) num_nodes 275 275 +0.0% ⚪
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0% ⚪
qwen3_5_text (hybrid-text-generation) num_nodes 129 129 +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) num_nodes 408 408 +0.0% ⚪
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0% ⚪
t5 (seq2seq) num_nodes 166 166 +0.0% ⚪
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0% ⚪
whisper (speech-to-text) num_nodes 128 128 +0.0% ⚪

No performance regressions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Mobius’ runtime flag defaults to stop automatically lowering the ONNX default-domain opset to 23 for non-CPU ORT execution providers, reflecting that newer ORT builds now register opset 24 kernels for standard ops.

Changes:

  • Changed ort_lower_opset_for_ep default from True to False.
  • Updated the flag’s documentation to describe the new default and how to re-enable it via MOBIUS_ORT_LOWER_OPSET_FOR_EP=1.

Comment thread src/mobius/_flags.py Resolved
@codecov

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@justinchuby
justinchuby merged commit 96957d9 into main May 6, 2026
25 checks passed
@justinchuby
justinchuby deleted the disable-opset-lowering-default branch May 6, 2026 23:51
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.

2 participants