Skip to content

onnx: support tanh-approximate Gelu - #92

Merged
sbryngelson merged 2 commits into
sbryngelson:mainfrom
AnayGarodia:feat/onnx-gelu-tanh
Jul 22, 2026
Merged

onnx: support tanh-approximate Gelu#92
sbryngelson merged 2 commits into
sbryngelson:mainfrom
AnayGarodia:feat/onnx-gelu-tanh

Conversation

@AnayGarodia

Copy link
Copy Markdown
Contributor

Summary

  • lower ONNX Gelu nodes with approximate="tanh" into supported ANEForge primitives
  • preserve the existing exact Gelu path
  • add graph-shape and on-device numerical regression coverage

Verification

  • PYTHONPATH=. uv run pytest tests/test_onnx.py -q -k gelu (3 passed)
  • PYTHONPATH=. uv run python tests/run_corpus.py (90/90 variants green)
  • uv run ruff check aneforge/onnx.py tests/test_onnx.py
  • uv run pyright aneforge/onnx.py

On-device tests passed locally on Apple Silicon (arm64, macOS 26.5.1).

Closes #76

Signed-off-by: anay <agarodia98@gmail.com>
Copilot AI review requested due to automatic review settings July 22, 2026 22:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

onnx: Gelu with approximate='tanh'

3 participants