Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

TensorDump forward hook + TensorCompare CLI: localise numeric divergence between two runs

オープン
#1,280 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
kotlin, python

調査の方向性

Start by reading the existing ForwardHooks, ExecutionObserver, and TraceSink APIs to understand how a tensor dump could integrate with current execution. The scope spans a versioned cross-platform format, filtering, comparison metrics and CLI, documentation, and in-tree parity-test use. Done means Android and JVM dumps compare in one command and identify the first tensor over tolerance, with the format documented and a Python reader.

索引モデルが issue の本文から書いたものです。

説明

enhancement skill:kotlin-core skill:numerics

Context

The most expensive part of bringing a large model to a phone is not the port, it is finding where numerics diverge between two executions of the same model: FP32 reference vs a quantized or FP16 backend, desktop vs device, eager vs compiled. The downstream Whisper-on-LiteRT case study needed ad-hoc per-block probes to localise an FP16 LayerNorm overflow to block 31 of 32 and an INT8 projection error to the block-0 K projection — all built by hand, twice, in Python and in Kotlin.

SKaiNET has the hooks (ForwardHooks, ExecutionObserver, TraceSink) but no standard artifact that two runs can exchange, and no standard comparison.

Scope

  • TensorDump: a forward hook that writes named intermediate tensors (by module path and op index) to one compact binary file — header with name, shape, dtype/encoding, then payload — appendable, streaming, no heap copy of the whole run. Works on JVM, Android and Kotlin/Native.
  • TensorCompare: a library function + CLI (skainet-plan-style) taking two dumps and reporting per tensor: cosine, RMSE, max abs diff, index of first divergence above a tolerance, and a summary that names the first tensor that crosses the tolerance (the localisation answer).
  • Filters: dump only tensors matching a module-path glob, every N-th op, or a shape predicate, so a 32-layer encoder does not produce gigabytes.
  • Documented recipe in the how-to section: "compare a device run against a desktop reference" with the two commands.
  • Used in-tree at least once: the .vmfb parity acceptance (#1148) or the JNI parity tests read/write this format instead of bespoke arrays.

Acceptance

  • A dump from an Android androidTest run and a dump from a JVM test of the same model compare in one command and point at the first divergent tensor.
  • Format documented and versioned; readable from Python with a short reference reader in ground-truth tooling.

Related

  • #1148 — eager vs compiled parity acceptance
  • #1261 — ULP-level JIT drift, the kind of thing this tool should make a one-liner to see
主要言語
Kotlin
スター
52
フォーク
15
平均マージ
1日 15時間
マージ済み PR(30日)
36

環境構築

はじめの一歩

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

SKaiNET-developers/SKaiNET のほかの issue

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

似ている issue

Kotlin の issue をもっと見る

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

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