feat(train): make ValidationStep the loop's evaluator, or remove it
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- backend, machine-learning
Línea de trabajo
Read packages/pipekit-train/src/pipekit_train/loop.py for ValidationStep and TrainingLoop, then inspect _evaluate and the periodic and final evaluation paths in packages/pipekit-train/src/pipekit_train/adapters/equinox.py. First resolve the dependency on #122 and decide whether to wire in ValidationStep or remove it based on #125. Done means the chosen API behavior, backend handling, documentation, and listed tests are complete.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem / Request
Either make ValidationStep the evaluator a TrainingLoop can actually use, or remove it.
ValidationStep is exported and documented, but no loop or adapter calls it.
Validation in the Equinox adapter goes through _evaluate, which can only report what loss_fn puts in its aux dict.
User Story
As a pipekit-train user, I want to name validation metrics that are not part of my loss, so that I can track them during training without writing a custom
TrainTask.
Motivation
The class implies a capability that the loop does not have.
Today a metric that isn't in the loss needs a custom task, or a callback that re-runs the model itself.
Proposed API
# proposed (this issue); my_metric is a user Operator of (predicted, target)
TrainingLoop(
model_op=op,
dataset=train,
validation=ValidationStep(op, val, metrics=(MSE(), my_metric)), # instead of val_dataset=
eval_every_n_steps=500,
)
# in the adapter, on each eval round
metrics = loop.validation.with_model(trained_op)() # today*: ValidationStep._apply
_dispatch(loop.callbacks, "on_eval_end", loop, carry, metrics)
validationandval_datasetare mutually exclusive, and setting both raisesValueError.with_model(op)returns a copy bound to the current weights, because the constructor fixesmodel_op.
Design Snapshot
ValidationStep today, from packages/pipekit-train/src/pipekit_train/loop.py @ 7c446f1:
def _apply(self) -> dict[str, float]:
sums: dict[str, float] = {}
count = 0
for x, y in self.dataset:
predicted = self.model_op(x) # one sample at a time, eagerly
for metric in self.metrics:
result = metric(predicted, y)
...
count += 1
return {k: v / count for k, v in sums.items()}
It runs eagerly per sample, so it is slower than the jitted batched path of #122.
Recommended: wire it in as above, as the simple path for metrics that are means over samples.
Alternative: if #125's eval_fn covers these users, remove ValidationStep from the public API and close this issue as not planned; decide this once #125 lands.
References & Existing Code
ValidationStepinpackages/pipekit-train/src/pipekit_train/loop.py@7c446f1._evaluateinpackages/pipekit-train/src/pipekit_train/adapters/equinox.py@7c446f1.LogToExperimentincallbacks.pytags metrics aseval/<name>.
Implementation Steps
- Add
validation: ValidationStep | None = NonetoTrainingLoop, with the exclusivity check. - Add
ValidationStep.with_model(op). - Call it from the Equinox adapter's periodic and final eval, in place of
_evaluate, when it is set. - Raise a clear
NotImplementedErrorforvalidation=on the Bayesian backends.
Definition of Done
- Code lands at the intended path.
- Tests pass:
make test. - Lint + typecheck pass:
make lint && make typecheck. - Docstrings (Google-style) on all public symbols.
Testing
- The loop's
eval/*metrics equal a standaloneValidationStep's on the same model to 1e-12. - Setting both
validationandval_datasetraisesValueError. -
with_modelleaves the original step unchanged.
Documentation
-
TrainingLoopdocstring and the validation section ofdocs/design/api/components.md.
Relationships
- Parent (theme epic): #144
- Blocked by: #122
- Related: #125
- Related: geostack
docs/reports/11_pipekit_train.md, workstream C and gate C3
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 3 h 50 min
- PR fusionados (30 d)
- 143
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de jejjohnson/pipekit
-
area:code layer:0-primitives priority:p2 type:feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jejjohnson/pipekit#296 ·
Los mantenedores suelen responder en 1 día
-
area:code type:feature
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
jejjohnson/pipekit#411 ·
Los mantenedores suelen responder en 1 día
-
area:code type:feature
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
jejjohnson/pipekit#410 ·
Los mantenedores suelen responder en 1 día
-
area:code type:feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
jejjohnson/pipekit#409 ·
Los mantenedores suelen responder en 1 día
-
area:code type:feature
Dificultad 3/5 1-2 días Aptitud para principiantes 75/100
jejjohnson/pipekit#408 ·
Los mantenedores suelen responder en 1 día
Todos los issues de jejjohnson/pipekit
Issues similares
-
A JSON chat answer blocks the backend event loop for the whole RAG runPosiblemente ocupada @NopeCharon la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
The-OpenROAD-Project/ORAssistant#656 ·
Los mantenedores suelen responder en 1 día
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorPosiblemente ocupada @jejjohnson la tomó hoy. Abiertotype:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
jejjohnson/integrix#144 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
finos/ai-governance-framework#459 ·
-
slurm: a case outcome nested too deep crashes status/collect instead of reading as no outcomeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día