Skip to content

Fix oob dereference - #29012

Merged
apsonawane merged 1 commit into
mainfrom
asonawane/oob
Jun 11, 2026
Merged

Fix oob dereference#29012
apsonawane merged 1 commit into
mainfrom
asonawane/oob

Conversation

@apsonawane

Copy link
Copy Markdown
Contributor

This pull request strengthens shape inference validation for several custom BERT-related ONNX operators by adding explicit rank checks for input tensors. These changes ensure that input tensors meet minimum rank requirements, improving error messaging and preventing incorrect shape propagation.

Enhanced shape validation for custom ONNX operators:

RelativePositionBias and GatedRelativePositionBias:

  • Added checks to ensure bias_table (for RelativePositionBias) and token_offset (for GatedRelativePositionBias) inputs have rank ≥ 2, with clear error messages if not. [1] [2]

CausalConvWithState:

  • Added checks to ensure both input and weight tensors have rank ≥ 2, failing shape inference with descriptive errors if violated.

LinearAttention:

  • Added checks to ensure query and value tensors have rank ≥ 3 for both output and state shape inference, with early returns or errors if requirements are not met. [1] [2]

SkipLayerNormalization:

  • Added a check to ensure the input tensor has rank ≥ 1, improving error reporting for invalid input shapes.

@apsonawane
apsonawane enabled auto-merge (squash) June 11, 2026 19:32
@apsonawane
apsonawane merged commit b823aec into main Jun 11, 2026
94 of 97 checks passed
@apsonawane
apsonawane deleted the asonawane/oob branch June 11, 2026 22:39
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