Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Native fused LayerNorm / GELU / softmax / conv1d kernels for the JNI and FFM tiers

Open
#1,276 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
c, kotlin

Research direction

Start with the existing matmul kernels in skainet-backend-native-cpu/native/src/, then trace the scalar Kotlin implementations and the JNI and FFM registration patterns. Add on-device parity tests for the four operations, checking the stated precision requirements. Done means the kernels are registered for both tiers and simpleperf measurements compare a whisper-tiny encoder step before and after.

Written by the indexing model from the issue text.

Description

compute-backend enhancement skill:android skill:native

Context

Companion to the dense FP32 JNI matmul issue. #949 measured that ~83% of Android eager decode time was non-matmul overhead and fixed the boxed per-element paths by hoisting the primitive FloatArray loops into shared code. That closed the boxing problem; the ops are still scalar Kotlin loops on ART, where there is no Vector API.

For a Whisper-class encoder that matters: per layer there are two LayerNorms over [1500,1280], a GELU over [1500,5120], 20 softmaxes over [1500,1500], and the stem is two conv1d layers (k=3, stride 1 and 2) over [128,3000]. skainet-backend-native-cpu/native/src/ contains matmul kernels only.

Scope

  • Native C kernels (NEON bodies gated on __ARM_NEON, scalar fallback) for: layerNorm (fused mean/var/normalize/affine, FP32 accumulation), gelu (tanh approximation and erf variants, matching Fp32 reference to 1 ULP where the DSL promises exactness), row softmax (max-subtract, exp, normalize), and conv1d (direct or im2col + the FP32 matmul kernel).
  • JNI entries + JniKernelProvider registrations; FFM bindings on the JVM tier for parity with the existing pattern.
  • Parity tests against the scalar Kotlin implementations on device.
  • simpleperf before/after on a whisper-tiny encoder step, the way #949 did for decode, so the remaining overhead is named.

Acceptance

  • Results match the scalar path within 1 ULP (GELU/softmax) or bit-identically (LayerNorm with FP32 accumulation, conv1d).
  • Combined with the dense FP32 matmul issue: whisper-tiny encoder ≥ 5× faster than 0.54.0 on a Pixel-class phone.

Related

  • #949 — boxed element access on Android (closed; this is the SIMD follow-up)
  • #910 — vectorized eager kernels for Kotlin/Native targets (same kernels, different binding)
Dominant language
Kotlin
Stars
52
Forks
15
Avg merge
1d 15h
Merged PRs (30d)
36

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SKaiNET-developers/SKaiNET

All issues in SKaiNET-developers/SKaiNET

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.