Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Boundaries

11. Open Questions & Future Work

Q1: Multi-device / sharding (Equinox adapter) — resolved (v0.2)

Implemented (issue #15, ADR D12). The Equinox adapter accepts an optional ShardingSpec(mesh, model_pspec, data_pspec), threaded through TrainState (model + optimiser leaves placed per model_pspec), the data iterator (each batch placed per data_pspec; multi-host reads a disjoint process-shard of the grain MapDataset and assembles the global array via jax.make_array_from_process_local_data — the modern equivalent of grain.ShardByJaxProcess), and the Orbax restore path (sharding-aware: a sharded template yields a sharding-aware restore). TrainingLoop gains sharding=...; None keeps single-device behaviour. The default (data-parallel) case is model_pspec=PartitionSpec() (replicated) and data_pspec=PartitionSpec("data").

Verified on a CPU-simulated 2-device mesh (tests/adapters/test_equinox_sharding.py) and a scripted 2-process jax.distributed smoke (scripts/multihost_sharding_smoke.py).

Q2: Gradient accumulation

Should the trainer support micro-batching natively, or should this be delegated to the backend? For Equinox, optax.MultiSteps is the clean answer — it composes with the optimizer transformation without any trainer-level changes. Decision: delegate to the backend; pipekit-train does not invent its own accumulation API.

Q3: Mixed precision

Equinox doesn’t have a built-in mixed-precision API. The cleanest approach is a jmp-based callback or an eqx.filter_jit wrapper that casts arrays. Keras has keras.mixed_precision.set_global_policy. Per-backend, no carrier-agnostic API. Documented in each adapter’s docs.

Q4: Stateful layers (eqx.nn.State)

BatchNorm and similar layers that carry running statistics need eqx.nn.State. The Equinox adapter’s TrainState should probably carry an optional eqx.nn.State alongside the model. Straightforward extension; deferred to the first concrete user need. Tracked as a v0.2 issue.

Q5: Hyperparameter sweeps (sweep.py)

Resolved in v0.2 via pipekit_train.sweep.

Ships ParameterGrid (Cartesian-product iterator) and HyperSweep (a StatefulOperator that orchestrates N independent TrainingLoop runs, ranks them by a configured metric, and surfaces a sweep_id on every SweepResult for cross-trial tracker provenance). v0.2 runs trials sequentially; Optuna / Ray Tune sampler adapters and parallel execution land in v0.2.1 / v0.3 — any iterable of param dicts works as search_space so users can plug those in today.

Q6: Streaming / online updates

Pipekit-train v0.1 assumes batch training. Online updates (a single gradient step per inference call) are conceptually a different StatefulOperator and could ship as OnlineTrainer in v0.3. Out of scope for now.

Q7: Async logging

Currently MetricWriter.write is synchronous; high-throughput training may benefit from jax.experimental.io_callback style async logging to prevent host-device sync stalls. Deferred to v0.2.

Q8: Foundation-model fine-tuning at scale

LoRA / PEFT / QLoRA plug in at the model level, but pipekit-train adds no machinery for them. The training loop sees a model_op with the right shape; the user is responsible for constructing it with the right adapter modules attached. Not a gap in pipekit-train; a documentation item.

12. Non-Goals

These were explicitly considered and rejected for the v0.1 scope.

13. v0.1 Definition of Done

All boxes ticked as of the v0.1 polish PR.

13.1 Small post-design divergences

A handful of implementation details landed slightly differently from the design as written; logged here for honesty.

14. Versioning targets

The cadence matches the rest of the pipekit workspace: roughly one minor bump per quarter, gated on the v0.1 scope landing first.