es-ude / es-ude/OnDeviceTraining

Epic: ODT Python Pipeline — Providers, ir2c, Resource Estimation

Open
#58 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

# Epic: ODT Python Pipeline — Providers, ir2c, Resource Estimation

Counterpart to [es-ude/elastic-ai.creator#848](https://github.com/es-ude/elastic-ai.creator/issues/848).
Everything below is **ODT's responsibility** — creator defines protocols and IR schema, ODT implements them.

## System Boundary

```
elastic-ai.creator this repo (ODT)
───────────────── ──────────────────
torch2ir → IR + shapes
→ apply_training_provider ──────────────► TrainingImplementationProvider
→ apply_inference_provider ─────────────► InferenceImplementationProvider
→ ir2resources.estimate ────────────────► ResourceEstimator
ir2c (C code generation)
C training framework (existing)
```

## Quantization Types

| ODT QType | Provider | Native C Ops | ASYM Strategy |
|-----------|----------|-------------|---------------|
| `FLOAT32` | `Float32Provider` | All layers natively | — |
| `SYM_INT32` | `SymInt32Provider` | All layers natively (integer-only) | — |
| `ASYM` | `AsymProvider` | No native HW support | Insert conversion layers (ASYM ↔ Float32/SymInt32) at layer boundaries |

ASYM is a software abstraction: the provider inserts quantization/dequantization nodes around native-format layer ops. No embedded hardware supports ASYM natively.

## Dependency Graph

```
#59 Scaffolding
├──► #60 Training Providers ──┐
├──► #61 Inference Providers ─┼──► #62 ir2c ──► #64 E2E Tests
└──► #63 Resource Estimator │
```

## Decisions

| Question | Resolution |
|----------|-----------|
| Jinja2 vs C-AST for ir2c | **Deferred** to #62 — spike both approaches before committing |
| Asym quantization | **Full provider** — inserts conversion nodes at layer boundaries, delegates to Float32/SymInt32 native ops |
| Single file vs split output | **Single file for v1**, but generation internally modular (separate functions per section) so splitting later is trivial |
| IR schema versioning | **Pinned creator dependency + contract tests** in ODT |

## Out of Scope

- Conv1d/Conv2d/Pooling/Batchnorm providers (blocked on C framework — Jan Koch's thesis)
- Hardware-in-the-loop tests on actual MCU
- Gradient checkpointing integration

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.