Skip to content

onnx: add com.microsoft BiasGelu, FastGelu, QuickGelu handlers#2287

Merged
kali merged 1 commit into
sonos:mainfrom
czoli1976:feature/onnx-gelu-contrib
May 27, 2026
Merged

onnx: add com.microsoft BiasGelu, FastGelu, QuickGelu handlers#2287
kali merged 1 commit into
sonos:mainfrom
czoli1976:feature/onnx-gelu-contrib

Conversation

@czoli1976
Copy link
Copy Markdown
Contributor

Adds com.microsoft BiasGelu/FastGelu/QuickGelu importer handlers, lowered onto existing element-wise primitives. Validated bit-close (<=4e-7) vs onnxruntime across shapes/bias/alpha; no node-suite regression; clippy+fmt clean. Part of com.microsoft contrib-op coverage for ORT-exported LLMs (complements #2283/#2284).

Fused Gelu activations emitted by ORT-optimized / GenAI transformer
exports, lowered onto existing element-wise primitives:
  BiasGelu(x, bias)  = erf gelu of (x + bias)
  FastGelu(x, bias?) = tanh-approx gelu of (x + bias)
  QuickGelu(x)       = x * sigmoid(alpha * x)   (alpha attr, default 1.702)

Validated bit-close against onnxruntime (max |diff| <= 4e-7).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@czoli1976 czoli1976 force-pushed the feature/onnx-gelu-contrib branch from 959f0d6 to af52c2d Compare May 26, 2026 12:35
@czoli1976
Copy link
Copy Markdown
Contributor Author

These ONXX Compliance are all low priority, not even sure they are needed, tought would give it a try

@kali kali merged commit dcc7230 into sonos:main May 27, 2026
55 checks passed
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