eval on DAG models: scheduler is rebuilt and the model re-validated for every sample

Open
#539 0 comments 0 reactions 0 assignees View on GitHub

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

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

enhancement

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from es-ude/OnDeviceTraining

All issues in es-ude/OnDeviceTraining

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.