Skip to content

Add ARM64 NEON SIMD kernels for gelu, sigmoid, silu, softmax, layer_norm, and adam_step #6

Open

Description

@voidstackloop

Difficulty: Medium (help wanted)
Mentorship: Yes — comment on this issue or ask in GitHub Discussions anytime for feedback on intrinsics, dispatch, or benchmarks.
Contribution Guidelines: Please see CONTRIBUTING.md (dual-licensed under MIT OR Apache-2.0, no CLA required).

What Is Asked

crates/oxideon-core/src/backend/simd_arm.rs currently accelerates add, sub, mul, div, sum, relu, exp, and tanh using ARM64 NEON (std::arch::aarch64), while simd_x86.rs also has AVX2+FMA kernels for gelu, gelu_backward, sigmoid, silu, softmax_row_f32, layer_norm_row_f32, layer_norm_row_bwd_f32, and adam_step_f32_slice.

We want to implement NEON (aarch64) equivalents for those remaining hot f32 kernels and wire them into backend/cpu.rs so Apple Silicon and ARM64 Linux servers get matching speedups.

Expected Outcome

  • NEON f32 kernels in simd_arm.rs for gelu, sigmoid, silu, softmax_row, layer_norm_row, and adam_step.
  • Clean cfg(target_arch = "aarch64") dispatch in backend/cpu.rs (preserving portable fallback on other targets and passing cargo clippy --workspace --all-targets -- -D warnings).
  • Numerical accuracy verified against f64 reference tests in crates/oxideon-core/tests/simd_accuracy.rs.

Implementation Guidance

  • Follow the pattern already in simd_arm.rs (#[cfg(target_arch = "aarch64")] mod neon_impl { ... }).
  • Look at how sigmoid_f32_avx2_impl and softmax_row_f32 in simd_x86.rs structure fast exp + horizontal max/sum reductions (vmaxvq_f32 / vaddvq_f32 on aarch64).
  • You can test non-aarch64 compilation locally on x86/Windows and validate aarch64 via the CI wheel/test matrix.

Activity

  1. added
    enhancement
    help wanted
    medium
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wantedmedium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions