松田研究室
FindingID: a-10-variance-baseline
Status: stable / task A.10
← Findings Index
Negative finding · GPU non-determinism

A.10 variance baseline — σ ±0.32 dB / range 0.885 dB を実測

同 seed=42 / 同 binary / 同 config で M-3.x lego sh3 30k を 4 回 run、PSNR の variance σ ±0.32 dB (range 0.885 dB)、wallclock σ ±2.4%。原因は SIMD atomic 順序非決定性、Kahan summation で解決不可。A.10 Negative finding (a-10-kahan-negative) の前提を実証。

negativerank: highstable第 3 軸phase-5variancegpu-non-determinismkahanatomicapple-silicon
Δ PSNR
σ ±0.32 dB / range 0.885 dB
Δ Wallclock
σ ±2.4% / range 5.2%
Impact
M-3.x lego sh3 30k の PSNR variance は σ ±0.32 dB / range 0.885 dB (4 run estimate)、wallclock variance は σ ±2.4% / range 5.2%。原因は SIMD backward kernel の atomic_fetch_add 順序非決定性で、A.10 Kahan で消えない (compensator も bit-identical のところ)。卒論 finding として「Apple Silicon の variance band は数値精度の問題でなく GPU scheduler 由来」と確定。
01

本文

A.10 Kahan finding で「Kahan は MSL compiler に消える」と分かったが、本来の motivating problem 「M-3.x の variance ±0.6 dB」が真に GPU 非決定性由来かは未確定だった。本実験で同 seed=42 / 同 binary / 同 config を 4 回 run、PSNR variance を直接測定し σ ±0.32 dB / range 0.885 dB を確定。

実施日
2026-05-23 Phase C (bench chain Phase C)
config
configs/2026-05-23-1000-lego-variance-trial{1,2,3}-30k.toml + baseline lego-sh3-30k
seed
42 (全 run 固定)
binary
main HEAD (a3cbfce A.9/A.10 changes 適用後)

実測値 (n=4 含 baseline)

runPSNR (dB)wallclockΔ vs mean PSNRΔ vs mean wall
baseline (lego-sh3-30k)24.87923m13s (1393s)+0.045+47.5s
trial1 (lego-variance-trial1)24.85822m08s (1328s)+0.024-17.5s
trial2 (lego-variance-trial2)24.35622m01s (1321s)-0.478-24.5s
trial3 (lego-variance-trial3)25.24122m20s (1340s)+0.407-5.5s
**mean****24.834****22m18s (1345.5s)**
**σ****±0.315****±31.6s (±2.4%)**
**range****0.885****72s (5.2%)**
PSNR variance σ ±0.32 dB は advisor 助言 (±0.6 dB) と range 整合的。wallclock variance ±2.4% は GPU scheduler / thermal 状態の影響と推測。

原因分析

(1) SIMD backward の atomic_fetch_add 順序非決定性

shaders/backward/rasterize_backwards.metalrasterize_backwards_simd kernel は per-pixel × per-splat の gradient を atomic_fetch_add で集約。dispatch 順序が GPU scheduler 任せのため、同一 input でも累積順が iter ごとに微妙に変わる。これが iter 累積で gradient drift → refine 判定 → splat 数差 → PSNR drift というフィードバックを生む。

(2) refine の grad_threshold が boundary 付近で flip

refine は |grad| > grad_threshold (2.0e-7) で split/clone を決定する。GPU 非決定性で grad が threshold 付近に来た splat が trial ごとに「split される / されない」で flip → final splats 数差 → PSNR drift。

(3) Kahan summation が解決にならない理由

A.10 Kahan は forward の per-pixel RGB 累積を Neumaier 化した。しかし variance の主因は (1) backward の atomic 非決定性 + (2) refine boundary の flip で、forward の数値精度ではない。Kahan が compiler に消されなかったとしても、variance は減らない。

A.7 / A.9 finding 再評価

variance σ ±0.32 dB を「有意性判定の noise floor」とすると:

  • A.7 lego -6.16% wall: wallclock variance ±2.4% を 2.5x 超え、有意
  • A.7 lego -0.302 dB PSNR: PSNR variance σ ±0.32 を 下回る、variance band 内 — 独立 effect 断定不可
  • A.7 hotdog -0.828 dB PSNR: σ の 2.6x、有意 (高品質シーンで drift が顕在化)
  • A.7 ficus -1.6% wall: wallclock variance ±2.4% を下回る、variance 内
  • A.9 f16 forward -10.0 dB: σ の 31x、圧倒的有意 (Negative finding 確定)
  • A.10 Kahan bit-identical: variance ±0.32 dB の下では「Kahan の効果」も「無効果」も検出不可、ただし compile-time に消えた事実は確定

Solution (defer)

  • backward の atomic_fetch_add を non-atomic な reduction (warp shuffle + 後段 atomic 1 回) に書き換える — A.7 part 2 候補、wallclock penalty 可能性 + PSNR drift 解消 trade-off
  • refine grad_threshold boundary を hysteresis 化 — flip 抑止、ただし refine の design intent と乖離
  • lr_schedule を seed dependent に確定 — variance を完全排除するには Adam の RNG (gradient noise なし) と全 atomic 削除が必要、scope 大
Lesson

GPU 上の floating point + atomic は同 input でも実行ごとに異なる結果を生む。Variance を抑えたければ atomic 不使用設計か、結果を「mean ± σ」で報告する慣習を採用すべき。本研究では後者を採用 — central table の数字は今後 mean ± σ で記載 (現状 single-run の数字は variance 内とみなす)。

卒論への含意

D.3 Negative findings 章に「数値精度 vs GPU 非決定性」のストーリーを追加。Kahan で variance が消えなかった事実は、本研究の variance 主因が algorithm の数値安定性ではなく実行環境 (GPU scheduler) にあると示す。これは Apple Silicon に限らず CUDA でも同様 (gsplat の bench でも同様の variance 報告あり)、本研究で得られた generic な finding。

関連

  • A.10 Kahan Negative finding: a-10-kahan-negative — Kahan 試行の経緯
  • A.7 ICB batched 実装: a-7-icb-batching-results — variance を考慮した有意性判定
  • A.7 × multi-scene 結果: a-7-multi-scene-batched — scene 依存性 -1.6% 〜 -18.6%
  • D.3 Negative findings 章: negative-findings-chapter
02

関連する run

この finding が観測された / 言及している実験 run。

03

関連 finding

© 2026 大竹律輝 — 松田研究室