Skip to content

feat(io-onnx): import ONNX ConvTranspose as real convTranspose1d/2d ops - #1468

Merged
michalharakal merged 1 commit into
developfrom
feature/1406-onnx-convtranspose
Nov 5, 2026
Merged

michalharakal merged 1 commit into
developfrom
feature/1406-onnx-convtranspose

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Closes #1406 (sub-issue of #1400).

What

  • OnnxImport.toOperation(): ConvTranspose now maps to the real convTranspose1d / convTranspose2d tensor ops instead of OnnxPlaceholderOperation. Spatial rank is taken from kernel_shape / strides / dilations / pads or the weight initializer's rank.
  • Supported forms: auto_pad=NOTSET, symmetric pads (ONNX pads are [begins..., ends...] while the SKaiNET ops take one symmetric padding per axis), no output_shape attribute. Anything else keeps the placeholder so execution fails loudly instead of producing wrong values.
  • New OnnxConvTranspose1dOperation / OnnxConvTranspose2dOperation carry shape inference: out = (in − 1)·stride − 2·padding + dilation·(k − 1) + outputPadding + 1, with C_out = weight[1] · groups.
  • ComputeGraphExecutor: new convTranspose1d / convTranspose2d dispatch arms calling the TensorOps methods (merged in feat(ops): implement convTranspose2d — CPU kernel, backward and StableHLO lowering #1464), with a small intPair helper that accepts the per-axis parameters as a Pair, a two-element list (KSP traces and the importer both record lists), or a single number.

Tests

OnnxConvTransposeExecuteTest (jvmTest, CPU backend): one-node import + execute with value assertions for 2D default attributes, stride 2 + bias, symmetric pads, and 1D; placeholder + fail-loud paths for auto_pad=SAME_UPPER and asymmetric pads.

./gradlew :skainet-io:skainet-io-onnx:jvmTest :skainet-compile:skainet-compile-dag:jvmTest apiCheck checkUnmarkedStubs — green (no public API change).

…ps (#1406)

Map ConvTranspose nodes to the convTranspose1d / convTranspose2d tensor ops
(auto_pad=NOTSET, symmetric pads, no output_shape; other forms keep the
fail-loud placeholder) and add the matching ComputeGraphExecutor dispatch
arms, parsing stride/padding/outputPadding/dilation from both KSP-trace
lists and importer parameters. Import + execute tests cover 1D, 2D default,
stride+bias, symmetric pads and the unsupported fallbacks.
@michalharakal
michalharakal merged commit e77091f into develop Nov 5, 2026
17 checks passed
@michalharakal
michalharakal deleted the feature/1406-onnx-convtranspose branch November 5, 2026 10:23
@michalharakal michalharakal mentioned this pull request Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Lane 2 · kotlin-core] ONNX importer — import ONNX ConvTranspose as a real op

2 participants