[EPIC] pipekit-train: stateful layers and the Keras backend

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python, pytorch
Domain
backend

Research direction

Read the child issues #16 and #13 and the referenced ADR D5 and geostack report 11. For #16, inspect TrainState, shard_train_state, and save_state; for #13, inspect the backend stubs and the tests in tests/test_adapters.py and tests/test_loop.py. The epic is done when all child issues are closed, BatchNorm statistics survive save and restore, and the Lightning backend reduces a small MLP's loss by at least 50%.

Written by the indexing model from the issue text.

Description

area:code priority:p2 type:epic-theme

Theme

TrainingLoop handles models with running statistics, and its Keras backend does real training rather than raising NotImplementedError.

Parent Wave

None. This comes from geostack report 11, workstream E (ADR D5 in pipekit-train), and from pipekit-train's open issues.

Motivation

Two kinds of model can't train through TrainingLoop today.
TrainState holds no eqx.nn.State, so a BatchNorm model can't train on the Equinox backend (#16).
backend="keras" is a stub that always raises.
The Lightning backend is cancelled: pipekit won't support Lightning or PyTorch training, so #13 is closed and its stub is removed.
They're grouped because they widen what the loop accepts, and they're the least urgent pipekit-train work: no current caller is broken.

Issues

  • #16 eqx.nn.State for stateful layers.

Not filed yet, to be filed after #16:

  • feat(train): the Keras 3 backend, on the same run(loop) -> (op, backend_info) seam. ADR D5 schedules it for v0.3.
  • feat(train): a ModelOp for Keras models. pipekit_array.ModelOp doesn't exist at 3b9582d, so Keras needs its own wrapper.

Execution Notes

#16 can be built and tested on any machine.

#16's TrainState change touches shard_train_state and save_state, which have changed since it was written: thread state through them as well.

Parallelism

  • Can run in parallel with: every other epic, though #16 conflicts in adapters/equinox.py with #144 and #145, so stack the PR.
  • Blocked by (inside this wave): none.
  • Must complete before: none.

Definition of Done

  • All child issues closed.
  • A BatchNorm model trains through TrainingLoop, and its running statistics survive save_state and restore_state.

Relationships

  • Parent: none.
  • Related: geostack docs/reports/11_pipekit_train.md, workstream E
Dominant language
Python
Stars
0
Forks
0
Avg merge
3h 50m
Merged PRs (30d)
143

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 jejjohnson/pipekit

All issues in jejjohnson/pipekit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.