Skip to content

Commit eb46da0

Browse files
justinchubyCopilotCopilot
authored
docs: update stale opset 23 references to opset 24 (#165)
## Summary `OPSET_VERSION` is already `24` in `_constants.py`. This PR cleans up all remaining stale `opset 23` references. ## Code fixes - **`_pixtral_vision_test.py`**: `opset_imports={"":23}` → `{"":24}` - **`tests/integration_test.py`**: Remove stale positional `23` arg from `QwenImageVAETask._build_decoder_graph` and `_build_encoder_graph` calls — those methods no longer accept an opset version argument (was a silent bug) ## Documentation updates (comments/docstrings) - `components/_vision.py`, `_qwen3_vl_vision.py`, `_rotary_embedding.py`, `_audio.py`, `_codec_transformer.py`, `_rms_norm.py`, `_pixtral_vision.py` - `models/gemma.py` (2 occurrences) - `rewrite_rules/_separate_rope.py` ## Testing 2391 tests pass, lintrunner clean. --------- Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
1 parent 0df5e3f commit eb46da0

11 files changed

Lines changed: 14 additions & 13 deletions

File tree

src/mobius/components/_audio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def forward(self, op: builder.OpBuilder, x: ir.Value):
345345
class ConformerAttention(nn.Module):
346346
"""Multi-head attention with relative position bias.
347347
348-
Uses the ONNX Attention op (opset 23) with separate Q/K/V/O projections.
348+
Uses the ONNX Attention op (opset 24) with separate Q/K/V/O projections.
349349
The T5 relative bias is passed as ``attn_mask`` (attention bias) to the
350350
Attention op.
351351
"""

src/mobius/components/_codec_transformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class _CodecDecoderAttention(nn.Module):
119119
"""Multi-head attention with RoPE for the codec decoder transformer.
120120
121121
Uses ``op.RotaryEmbedding`` on Q and K before passing them
122-
to the ONNX ``Attention`` op (opset 23).
122+
to the ONNX ``Attention`` op (opset 24).
123123
124124
Parameters:
125125
hidden_size: Model hidden dimension.

src/mobius/components/_pixtral_vision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def forward(
178178
# Bidirectional attention (no causal mask, no KV cache).
179179
# Use com.microsoft.MultiHeadAttention for all EPs that support
180180
# custom-domain ops (it has fused kernels on CUDA/DML and runs
181-
# correctly on CPU). Fall back to standard opset-23 Attention
181+
# correctly on CPU). Fall back to standard opset-24 Attention
182182
# for onnx-standard EP which prohibits custom-domain ops.
183183
scale = float(1.0 / (self._head_dim**0.5))
184184
if ep_capabilities().name == "onnx-standard":

src/mobius/components/_pixtral_vision_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import onnxruntime as ort
1111

1212
from mobius._configs import ArchitectureConfig, VisionConfig
13+
from mobius._constants import OPSET_VERSION
1314
from mobius.components._pixtral_vision import (
1415
Mistral3MultiModalProjector,
1516
Mistral3PatchMerger,
@@ -154,7 +155,7 @@ def test_patch_merger_matches_hf_unfold_ordering():
154155
outputs=[],
155156
nodes=[],
156157
name="test_merge_ordering",
157-
opset_imports={"": 23},
158+
opset_imports={"": OPSET_VERSION},
158159
)
159160
gb = GraphBuilder(graph)
160161
op = gb.op

src/mobius/components/_qwen3_vl_vision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class Qwen3VLVisionAttention(nn.Module):
143143
"""Packed bidirectional multi-head attention for the vision encoder.
144144
145145
Iterates over sub-sequences delimited by ``cu_seqlens`` and applies
146-
standard ONNX Attention (opset 23) to each independently. This avoids
146+
standard ONNX Attention (opset 24) to each independently. This avoids
147147
cross-image attention while processing all patches in a single flat
148148
sequence.
149149
"""

src/mobius/components/_rms_norm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
class RMSNorm(nn.Module):
14-
"""RMS Layer Normalization using the ONNX RMSNormalization op (opset 23)."""
14+
"""RMS Layer Normalization using the ONNX RMSNormalization op (opset 24)."""
1515

1616
def __init__(self, hidden_size: int, eps: float = 1e-6):
1717
super().__init__()

src/mobius/components/_rotary_embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def apply_rotary_pos_emb(
6161
):
6262
"""Apply Rotary Positional Embedding (RoPE) to the input.
6363
64-
Uses the ONNX opset 23 ``RotaryEmbedding`` op with pre-gathered
64+
Uses the ONNX opset 24 ``RotaryEmbedding`` op with pre-gathered
6565
cos/sin embeddings (3D tensors without position_ids).
6666
6767
Args:

src/mobius/components/_vision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def forward(self, op: builder.OpBuilder, pixel_values: ir.Value):
8989
class VisionAttention(nn.Module):
9090
"""Bidirectional multi-head attention for vision encoders.
9191
92-
Uses the ONNX Attention op (opset 23). Unlike text attention,
92+
Uses the ONNX Attention op (opset 24). Unlike text attention,
9393
this has no causal mask and no KV cache.
9494
"""
9595

src/mobius/models/gemma.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class Gemma2Attention(Attention):
127127
128128
This bounds attention weights to [-softcap, softcap], preventing
129129
extreme attention concentrations. Uses the ONNX Attention op's
130-
native ``softcap`` attribute (opset 23).
130+
native ``softcap`` attribute (opset 24).
131131
132132
Also uses ``query_pre_attn_scalar`` for attention scaling instead
133133
of the default ``1/sqrt(head_dim)``.
@@ -185,7 +185,7 @@ def forward(
185185
interleaved=self._rope_interleave,
186186
)
187187

188-
# ONNX Attention op (opset 23) with native softcap support
188+
# ONNX Attention op (opset 24) with native softcap support
189189
attn_output, present_key, present_value = op.Attention(
190190
query_states,
191191
key_states,

src/mobius/rewrite_rules/_separate_rope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
3232
The ``position_ids`` graph input is looked up by name and used to index
3333
into the cosine/sine cache tables before applying the standard
34-
``RotaryEmbedding`` op (standard ONNX opset 23).
34+
``RotaryEmbedding`` op (standard ONNX opset 24).
3535
3636
These rules are applied automatically by
3737
:func:`~mobius._optimizations.optimize_model` for EPs that do not support

0 commit comments

Comments
 (0)