Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,280 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
kotlin, python
Lĩnh vực
machine-learning, tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Kotlin
Star
52
Fork
15
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
36

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của SKaiNET-developers/SKaiNET

Tất cả issue của SKaiNET-developers/SKaiNET

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.