es-ude / es-ude/OnDeviceTraining

Implement ResourceEstimator (cycles, memory, flash)

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

## Context

Sub-issue of #58.

**Blocked by:** #59 (scaffolding)

## Goal

Implement `ResourceEstimator` protocol to provide per-layer cost estimates for all three quantization types.

## Protocol (defined by creator)

```python
class ResourceEstimator(Protocol):
def estimate(self, sub_graph: DataGraph) -> ResourceEstimate: ...

@dataclass
class ResourceEstimate:
cycles: int
memory_bytes: int
flash_bytes: int
energy_uj: float | None
training_cycles: int | None
```

## Must Estimate Per Layer

- **Inference cycles**: operation count + quantization conversion overhead
- **Training cycles**: forward + backward + optimizer step
- **Peak memory**: activations + parameters + gradients (working set)
- **Flash**: parameter storage + code size

## Acceptance Criteria

- [ ] `ResourceEstimator` implementation for Float32, SymInt32, Asym
- [ ] Per-node breakdown + network totals via `ir2resources.estimate()`
- [ ] Estimates validated against profiling on host (order-of-magnitude correct)
- [ ] Linear, ReLU, Softmax layers covered

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.