TensorDump forward hook + TensorCompare CLI: localise numeric divergence between two runs
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
调研方向
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 内容生成。
描述
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
.vmfbparity acceptance (#1148) or the JNI parity tests read/write this format instead of bespoke arrays.
Acceptance
- A dump from an Android
androidTestrun 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-truthtooling.
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 小时
- 30 天内合并 PR
- 36
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SKaiNET-developers/SKaiNET 的其他 Issue
-
coding good first issue size:xs skill:kotlin-core sub-issue
难度 2/5 1-3 小时 新手友好度 88/100
SKaiNET-developers/SKaiNET#1323 ·
维护者通常 1 天内回复
-
coding good first issue platform size:xs skill:js sub-issue
难度 2/5 1-3 小时 新手友好度 72/100
SKaiNET-developers/SKaiNET#1232 ·
维护者通常 1 天内回复
-
skeep tracking
难度 5/5 一周以上 新手友好度 15/100
SKaiNET-developers/SKaiNET#1331 ·
维护者通常 1 天内回复
-
assessment size:s skill:review sub-issue
难度 4/5 1-2 天 新手友好度 18/100
SKaiNET-developers/SKaiNET#1330 ·
维护者通常 1 天内回复
-
documentation good first issue size:s skill:docs sub-issue
难度 3/5 1-2 天 新手友好度 78/100
SKaiNET-developers/SKaiNET#1329 ·
维护者通常 1 天内回复
查看 SKaiNET-developers/SKaiNET 的全部 Issue
相似的 Issue
-
submit-adaption submit-adaption-pre
难度 2/5 1-3 小时 新手友好度 62/100
BetterAndroid/android-notification-icon-project#744 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 64/100
utopia-rise/godot-jvm#1004 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
pedroSG94/RootEncoder#2213 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
dzid26/TeslaBatteryBLE#183 ·
维护者通常 1 天内回复