Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの 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 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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日 8時間
マージ済み PR(30日)
37

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SKaiNET-developers/SKaiNET のほかの issue

SKaiNET-developers/SKaiNET の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。