Native fused LayerNorm / GELU / softmax / conv1d kernels for the JNI and FFM tiers
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
- Domain
- machine-learning, performance
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
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, matchingFp32reference to 1 ULP where the DSL promises exactness), rowsoftmax(max-subtract, exp, normalize), andconv1d(direct or im2col + the FP32 matmul kernel). - JNI entries +
JniKernelProviderregistrations; FFM bindings on the JVM tier for parity with the existing pattern. - Parity tests against the scalar Kotlin implementations on device.
-
simpleperfbefore/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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SKaiNET-developers/SKaiNET
-
coding good first issue size:xs skill:kotlin-core sub-issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
SKaiNET-developers/SKaiNET#1323 ·
Maintainers usually reply within 1 day
-
coding good first issue platform size:xs skill:js sub-issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SKaiNET-developers/SKaiNET#1232 ·
Maintainers usually reply within 1 day
-
skeep tracking
Difficulty 5/5 Over a week Newbie friendliness 15/100
SKaiNET-developers/SKaiNET#1331 ·
Maintainers usually reply within 1 day
-
assessment size:s skill:review sub-issue
Difficulty 4/5 1-2 days Newbie friendliness 18/100
SKaiNET-developers/SKaiNET#1330 ·
Maintainers usually reply within 1 day
-
documentation good first issue size:s skill:docs sub-issue
Difficulty 3/5 1-2 days Newbie friendliness 78/100
SKaiNET-developers/SKaiNET#1329 ·
Maintainers usually reply within 1 day
All issues in SKaiNET-developers/SKaiNET
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 73/100
tortuvshin/open-apps#377 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
supabase-community/supabase-kt#1413 ·
Maintainers usually reply within 5 days
-
Type: Possible bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
spacecowboy/Feeder#1258 ·
Maintainers usually reply within 1 day
-
[Submission] 抖音火山版Opensubmit-adaption submit-adaption-pre
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
BetterAndroid/android-notification-icon-project#744 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
utopia-rise/godot-jvm#1004 ·
Maintainers usually reply within 1 day