Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Panama FP32 matmul: first call in a JVM differs by an ULP from later calls (JIT-dependent reduceLanes order)

未关闭
#1,261 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
kotlin
领域
performance

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

bug compute-backend skill:numerics

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 (*GoldenTokenParityTest in 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 reduceLanes with 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.

主要语言
Kotlin
星标
52
派生
15
平均合并
1 天 15 小时
30 天内合并 PR
36

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SKaiNET-developers/SKaiNET 的其他 Issue

查看 SKaiNET-developers/SKaiNET 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。