Skip to content

[Lane 2 · kotlin-core] ONNX importer — streaming tensor loading in OnnxModelReader #1407

Open

Description

@michalharakal

Sub-issue of #1400 ([Feature]: ONNX importer — replace placeholder ops with real operations, stream tensors in OnnxModelReader).

Lane: 2 · Kotlin core
Skill needed: Kotlin; protobuf wire format basics.
Size: m (1–2 days)
Blocked by: nothing

What to do

  1. Implement OnnxModelReader.loadTensor (skainet-io/skainet-io-onnx/src/commonMain/kotlin/sk/ainet/io/onnx/OnnxModelReader.kt) and populate tensors / metadata by recording initializer offsets with ProtobufWireReader instead of materialising everything.
  2. Use the GGUF streaming reader (StreamingGgufParametersLoader) as the pattern for lazy loading.
  3. Remove the file's line from config/stub-allowlist.txt and run ./gradlew :skainet-io:skainet-io-onnx:jvmTest checkUnmarkedStubs.

Acceptance

  • Initializers of a small test model load lazily with correct values
  • checkUnmarkedStubs passes without the allowlist entry
  • Result reported back on the parent issue

Notes

If something here turns out to be wrong or much bigger than the size label, comment on this issue or open a specific bug instead of blocking the parent.

Coverage matrix: docs/modules/ROOT/pages/reference/ops-status-matrix.adoc · How lanes work: Issue taxonomy

Metadata

Metadata

Assignees

No one assigned

    Labels

    codingImplementation task (DARC: C)size:m1-2 daysskill:kotlin-coreKotlin implementation in commonMainsub-issueSub-issue of a tracking issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions