- 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/.
Summary
Add a lightweight ONNX loader (using pbandk), float tensor decoding, and a proto-agnostic importer scaffold that maps ONNX graphs to
ComputeGraphwith initial support stubs for common ops.Acceptance Criteria
OnnxLoader.fromModelSourceand access both parsed proto and raw bytes.TensorProto.toTensor().ComputeGraphwith:Tasks
OnnxImport.kt(ensureConv,MatMul,Add,Mul,Relu,Sigmoid,Softmax,Reshape,Transpose,MaxPool,Upsamplealign with existing tensor ops and shape semantics).tools/.