Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,280 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
kotlin, python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Kotlin
Stelle
52
Fork
15
Merge medio
1g 15h
PR unite (30g)
36

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SKaiNET-developers/SKaiNET

Tutte le issue di SKaiNET-developers/SKaiNET

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.