Skip to content

[Lane 2 · kotlin-core] TransposedConv2d — promote convTranspose2d to a @Diff op with backward rule #1374

Open

Description

@michalharakal

Sub-issue of #1371 ([Feature]: TransposedConv2d — convTranspose2d op, CPU kernel, backward and StableHLO lowering).

Lane: 2 · Kotlin core
Skill needed: Kotlin; some familiarity with the SKaiNET autodiff tape helps (it is small). No numerics research needed.
Size: s (a few hours)
Blocked by: #1373

What to do

  1. Turn TensorOps.convTranspose2d into an abstract @Diff method like convTranspose1d (delete the throwing default). Fix every implementer the compiler complains about: VoidTensorOps (shape only — copy convTranspose1d and calculateConvTranspose1dShape), RecordingExecution, test fakes such as the one in ComputeGraphExecutorTest.
  2. Add convTranspose2d to the conv-op bias list in skainet-lang/skainet-lang-ksp-processor/.../TracingWrapperProcessor.kt (search for convTranspose1d).
  3. Add convTranspose2dBackward in skainet-compile/skainet-compile-dag/src/commonMain/kotlin/sk/ainet/lang/graph/DefaultExecutionTape.kt by copying convTranspose1dBackward, and register it in backwardDispatch (AutodiffCoverageTest fails until you do).
  4. Run ./gradlew :skainet-compile:skainet-compile-dag:jvmTest :skainet-lang:skainet-lang-core:jvmTest apiDump, regenerate the matrix (./gradlew :skainet-compile:skainet-compile-hlo:jvmTest --tests '*HloCoverageDumpTest' :skainet-compile:skainet-compile-dag:jvmTest --tests '*BackwardCoverageDumpTest' generateDocs) and commit it.

Acceptance

  • Backward column shows ✅ for convTranspose2d
  • A gradient test compares against finite differences or PyTorch autograd
  • 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:sA few hoursskill: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