Panama FP32 matmul: first call in a JVM differs by an ULP from later calls (JIT-dependent reduceLanes order)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- kotlin
- Domain
- performance
Research direction
Start with PanamaVectorMatmulKernel and inspect its FloatVector.reduceLanes(ADD) reduction, then read DirectCpuExecutionContextScheduleTest for the existing warm-up behavior. Reproduce the first-call versus later-call difference on the same context with identical inputs. Done when repeated calls produce consistent results regardless of whether the JVM has compiled the intrinsic.
Written by the indexing model from the issue text.
Description
Summary
On a fresh DirectCpuExecutionContext() the first dense FP32 matmul in a JVM process produces results that differ by 1 ULP (in ~37k of 153k elements for m=300, k=64, n=512) from every later call on the same context with the same inputs. After that first call the results are stable and independent of threading or schedule.
Observed while writing SKEEP-005 parity tests (DirectCpuExecutionContextScheduleTest): probe output
same-ctx twice diff=37355 (first call vs second call)
seq twice diff=0
par-vs-seq diff=0
Likely cause
PanamaVectorMatmulKernel reduces with FloatVector.reduceLanes(ADD), whose lane-reduction order is unspecified and differs between the interpreter/C1 fallback and the C2 intrinsic. The first call runs before the intrinsic is compiled.
Why it matters
- Golden-token parity gates (
*GoldenTokenParityTestin SKaiNET-transformers) assert exact llama.cpp text equality; a warm-up-dependent ULP can flip a greedy argmax. - Any test comparing two contexts must warm up first (the SKEEP-005 tests now do).
Options
- Replace
reduceLaneswith an explicit fixed-order tree reduction (reduceLanesToLong-style) or accumulate into a vector and reduce with a deterministic scalar loop. - Document the property and add a warm-up helper for parity tests.
Not fixed in feature/skeep-005-schedules; the schedule tests warm up before comparing.
- Dominant language
- Kotlin
- Stars
- 52
- Forks
- 15
- Avg merge
- 23h 34m
- Merged PRs (30d)
- 45
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
-
native-cpu: -Wreturn-type in skainet_row_threads.c:150 (worker fn has no return)Possibly taken @Doomguy-BFG9000 claimed this today. Opengood first issue size:xs skill:native
Difficulty 1/5 Under an hour Newbie friendliness 78/100
SKaiNET-developers/SKaiNET#1358 · 1 comment ·
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
-
Ternary decode on 4× Cortex-A78C: row-thread pool only 40–60 % busy, 1.8 tok/s (BitNet 2B4T) — dispatch-bound, not bandwidth-boundPossibly taken A pull request linked to this issue is open or already merged. Opencompute-backend research skill:native
Difficulty 4/5 3-5 days Newbie friendliness 45/100
SKaiNET-developers/SKaiNET#1357 · 2 comments ·
Maintainers usually reply within 1 day
-
bug platform skill:native
Difficulty 4/5 3-5 days Newbie friendliness 58/100
SKaiNET-developers/SKaiNET#1356 ·
Maintainers usually reply within 1 day
-
enhancement platform skill:native sub-issue
Difficulty 4/5 3-5 days Newbie friendliness 52/100
SKaiNET-developers/SKaiNET#1301 ·
Maintainers usually reply within 1 day
All issues in SKaiNET-developers/SKaiNET
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
afk-ok area:agents size:S
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
enorm-labs/event-junkie#3523 ·
Maintainers usually reply within 1 day
-
submit-adaption submit-adaption-pre
Difficulty 1/5 Under an hour Newbie friendliness 82/100
BetterAndroid/android-notification-icon-project#750 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
openbase/planetsudo.engine#107 ·
Maintainers usually reply within 1 day
-
bug core p3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
RunanywhereAI/runanywhere-sdks#1142 ·
Maintainers usually reply within 1 day