Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,276 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, kotlin

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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)
Lingua principale
Kotlin
Stelle
52
Fork
15
Merge medio
1g 8h
PR unite (30g)
37

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SKaiNET-developers/SKaiNET

Tutte le issue di SKaiNET-developers/SKaiNET

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.