You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cortex-M backend: lower quantized GELU via the activation LUT (pytorch#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>
0 commit comments