SIGN IN SIGN UP

Cortex-M backend: lower quantized GELU via the activation LUT (#21025)

### Summary
Extend the existing sigmoid/tanh/silu activation-LUT path to GELU: add
an exact (erf) _gelu to _ACTIVATION_FNS, register aten.gelu in the
quantizer's ACTIVATION_OP_PATTERNS (the generic CortexMActivationCheck
needs no change), and add aten.gelu to the quantized_activation dialect
substitution. Unlike silu, aten.gelu is a core-aten op that survives
to_edge unchanged, so no to_edge preservation is required.
build_activation_lut only sees the op target, so the table is always the
exact/erf GELU regardless of the approximate kwarg.

### Test plan
Verified test-first (RED->GREEN) with five nn.GELU() dialect cases (ramp
/ saturating / asymmetric-zp / zero) whose numerics are validated
against the reference (qtol=1); the full cortex_m op dialect suite still
passes (177 passed).

Authored with Claude Code.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
R
RJ Ascani committed
7628aa6b88e499b53a47bd2bc776a234279a21f3
Parent: 53180df
Committed by GitHub <noreply@github.com> on 7/22/2026, 2:12:28 PM