BatchShape nests an ImageShape, a VideoShape and an AudioShape, while Masking, Contrastive, LateInteraction, Choices and Schedule configure the objectives, and PairLossForm picks each contrastive term’s pair loss. Relations holds three Edges sets as compressed sparse rows, whose offsets and weights the binding checks against the step’s items before the call.
A step’s Sides give each item a LateInteractionSide, and its Choices and ChoiceTargets give each choice item its legal bytes and their target probabilities as tapes, the shapes TextChoose takes and answers. Step answers the pooled embeddings the loss scored when its config names an Arena, and Rows of zero Count otherwise.
A trainer refers to its mesh, so the mesh outlives every trainer made over it, and mesh.Describe() answers a MeshDescription whose MultimemTier and GPUClass describe the run.
API
Types
AudioShapeAudioShape is the audio slice of a batch envelope; a zero ChunkSamples leaves audio out of the run.
StructTrainerTrainer is a training run: the tower replicas, gradients, optimizer moments, heads and temperatures on its executor's devices, stepped and saved through that executor.6
type Trainer struct {
TrainerOn
// contains filtered or unexported fields
}
Its embedded TrainerOn runs every verb on the calling goroutine, and TrainerOn.On on the executor
the trainer was made on.
Mirrors uform_trainer_t; Close calls uform_trainer_free.
TrainerInitVramTrainerInitVram builds one replica per device of executor and starts or resumes the run; every process of the run calls it with the same geometry, objective and seed.
*Save× 2Save writes the weights and the step to a safetensors checkpoint at path, which ModelLoadVram serves and TrainerInitVram resumes; only the process of index zero writes.
*Step× 2Step applies one optimizer step over this process's items, tagged by modalities, and every peer's, answering the pooled embeddings the loss scored when the config names an arena, and Rows of zero Count otherwise; every process of the run calls it once per step.