Skip to content

[Feature]: ONNX importer — replace placeholder ops with real operations, stream tensors in OnnxModelReader #1400

Open
0 of 7 issues completed

Description

@michalharakal

🧠 D: DOCUMENT — Problem & Opportunity

The ONNX graph importer (OnnxImport.kt) maps several common node types to OnnxPlaceholderOperation: the graph imports, but executing it throws. Today that includes LeakyRelu, Silu and BatchNormalization (all three have real SKaiNET ops), and every unlisted type such as Clip, Pad and ConvTranspose. Separately, OnnxModelReader.loadTensor is a TODO() and its tensors/metadata maps are always empty (listed in config/stub-allowlist.txt).

Recurrent/control-flow ops (LSTM, Gather, Where, If…) are tracked in #1279 and are out of scope here.

Summary: map the remaining simple node types to real operations and make OnnxModelReader actually stream tensors.


🔍 A: ASSESS — Feasibility & Impact

  • Feasibility: high for the op mappings (the SKaiNET ops exist); medium for streaming reads (ProtobufWireReader exists, the work is lazy offsets for initializers).

📚 R: RESEARCH — What Must Be Understood First?


🛠️ C: CODE — Implementation Plan

  • One lane per op mapping
  • Streaming OnnxModelReader.loadTensor

Acceptance Criteria

  • No OnnxPlaceholderOperation for the listed ops
  • OnnxModelReader returns initializers and metadata; its entry is removed from config/stub-allowlist.txt

Lane breakdown

Related: #1279 (LSTM, Gather, Unsqueeze/Squeeze, Cast, Where, If). Only Lane 2 applies.

New here? Read Getting started as a contributor and the Issue taxonomy. Lanes marked good first issue assume no prior SKaiNET codebase knowledge. The gap markers and the coverage matrix were introduced in #1370.

Metadata

Metadata

Assignees

No one assigned

    Labels

    darcFeature driven through the DARC workflow (Document / Assess / Research / Code)enhancementNew feature or requestfile-format:onnxONNX file formattrackingParent/tracking issue with sub-issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions