Skip to content

ONNX I/O module MVP: #230

Description

@michalharakal
  • loader,
  • decoders
  • importer scaffold

Summary

Add a lightweight ONNX loader (using pbandk), float tensor decoding, and a proto-agnostic importer scaffold that maps ONNX graphs to ComputeGraph with initial support stubs for common ops.

  • Why: Establishes the foundation for importing ONNX models into SKaiNET’s compute graph to enable wider model interoperability.

Acceptance Criteria

  • Can load an ONNX model via OnnxLoader.fromModelSource and access both parsed proto and raw bytes.
  • Float tensor initializers convert to internal tensors via TensorProto.toTensor().
  • Importer constructs a ComputeGraph with:
    • Initializers surfaced as constant nodes.
    • Declared inputs/outputs wired into the graph.
  • Unit tests validate loader and basic importer workflows.

Tasks

  • Review/complete op mappings in OnnxImport.kt (ensure Conv, MatMul, Add, Mul, Relu, Sigmoid, Softmax, Reshape, Transpose, MaxPool, Upsample align with existing tensor ops and shape semantics).
  • Expand dtype support (currently only FLOAT) and endianness handling; add tests for each dtype path.
  • Add error reporting for missing/ambiguous inputs/attributes and unsupported ops (clear messages and remediation hints).
  • Document how protobuf classes were generated and how to re-generate them via tools/.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions