eval on DAG models: scheduler is rebuilt and the model re-validated for every sample
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 28/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c
- Domain
- machine-learning, performance
Research direction
Start from the eval paths in InferenceApi and TrainingLoopApi, then RematWireTable.c where the scheduler init calls modelRequireValid, and openGradOf for the quadratic edge loop. First reproduce the baseline: run eval on the FLOAT32 chain HAR model and record per-sample eval time and allocations so the before/after comparison exists. Done means one scheduler built per eval run, validation moved to the public entry, open-grad info computed at init, and bit-identical eval output verified against the recorded baseline.
Written by the indexing model from the issue text.
Description
Problem
Evaluating a model with skip connections repeats setup work for every sample:
- the eval scheduler is built again per sample (eval paths in InferenceApi and TrainingLoopApi, scheduler init in RematWireTable.c);
- each of these short-lived scheduler inits calls modelRequireValid again: 2 allocations and a qsort per sample.
Related, smaller: openGradOf is quadratic in the number of edges and runs again at every bind, also for chain models (about 80 iterations per call on HAR today). Harmless now, but it grows with the square of the model size, and the model-zoo models (#535) are deeper.
Why it matters
Evaluation time and heap churn on the MCU grow with the number of eval samples, although the model does not change between samples. Results are not affected.
Ideas
- build the eval scheduler once per evaluation run and reuse it;
- validate the model once at the public entry, not inside every scheduler init;
- compute the open-gradient information once at init instead of at every bind.
Done when
- a before/after measurement (eval time per sample and allocations per sample, compared to the FLOAT32 chain HAR model) is posted here;
- DAG eval does no per-sample allocation and no per-sample model validation;
- eval results are bit-identical to before.
Part of #329 / #535.
- Dominant language
- C
- Stars
- 2
- Forks
- 3
- Avg merge
- 13h 6m
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from es-ude/OnDeviceTraining
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
es-ude/OnDeviceTraining#549 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
es-ude/OnDeviceTraining#547 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
es-ude/OnDeviceTraining#536 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
es-ude/OnDeviceTraining#478 ·
Maintainers usually reply within 1 day
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
es-ude/OnDeviceTraining#459 ·
Maintainers usually reply within 1 day
All issues in es-ude/OnDeviceTraining
Similar issues
-
issue: bug report
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 2 days
-
AI/LLM documentation Professional Contributors Only
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
luainkernel/lunatik#2752 ·
Maintainers usually reply within 1 day
-
feature:config kind:docs os:windows toolchain:cmake triaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
BasedHardware/omi#26486 ·
Maintainers usually reply within 1 day