es-ude / es-ude/OnDeviceTraining

layer/arithmetic: 2D sliding-window layer family for image recognition (epic)

Open
#330 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C
Stars
1
Forks
3
Avg merge
1d 1h
Merged PRs (30d)
8

Description

## Motivation

Image-recognition models need 2D versions of the sliding-window family plus the arithmetic underneath. Today only the 1D family exists (Conv1d, ConvTranspose1d, MaxPool1d, AvgPool1d, AdaptiveAvgPool1d on top of SlidingWindow1d / Conv1dKernel / ConvTranspose1dKernel). The input side is already prepared: datasets deliver `[C, H, W]` per the data-shape convention, and the MNIST loader + examples exist as an acceptance vehicle.

## Scope (each line ≈ one sub-issue / PR)

- **arithmetic**: SlidingWindow2d + Conv2dKernel (+ ConvTranspose2dKernel), 2D adaptive windowing
- **layer**: Conv2d, MaxPool2d, AvgPool2d, AdaptiveAvgPool2d, ConvTranspose2d (forward + backward each)
- **norms**: verify LayerNorm/GroupNorm generality over `[C, H, W]`; generalize if rank assumptions bite
- FLOAT32 arms first; SYM arms follow the established kernel contract: int32 accumulators only, int12 operand rule (#227), EXPLICIT padding preferred over SAME (same semantics decisions as 1D — documented in docs/conventions)
- Gold values via the PyTorch generator pipeline (CMake+uv, `torch.allclose` self-check); mutation-tested like the 1D family
- Output-length/geometry helpers centralized from the start (the 1D lesson from #233)

## Relation

- ResNet/DenseNet **2D** variants need this epic *plus* the topology epic #329; the plain 2D layers themselves are independent of #329 and can ship first.
- Natural acceptance example: a small MNIST-2D CNN with PyTorch-twin bit-parity, like the existing examples.

Contributor guide

Open the contributing guide

Research direction

Start by reading the existing 1D sliding-window and layer family, then review docs/conventions and the MNIST examples. Use the CMake+uv PyTorch generator pipeline and its torch.allclose self-check to understand the gold-value workflow. Done means the 2D arithmetic, layers, forward and backward paths, geometry helpers, and stated FLOAT32/SYM checks are covered and mutation-tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake, pytorch
Domain
embedded-iot, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.