pub struct TrainSpec {
pub graph: Graph,
pub params: Vec<WeightRef>,
pub grad_start: usize,
pub loss_index: usize,
pub data: Vec<DataRef>,
pub seed_input: Option<String>,
pub momentum: f32,
pub lr_per_epoch: Vec<f32>,
pub batch: usize,
pub device: String,
pub grad_group: u64,
pub push_data: bool,
}Expand description
A self-describing training job for a generic worker: everything needed to train a model the worker has no code for.
Fields§
§graph: GraphBackward graph. Outputs are [.. , grad_0, grad_1, …], with the
gradients starting at grad_start and matching params 1:1.
params: Vec<WeightRef>Trainable params + where to fetch their initial values (node-local URI).
grad_start: usizeIndex in graph.outputs where the gradients begin (params[i] ↔
outputs[grad_start + i]).
loss_index: usizeIndex in graph.outputs of the scalar loss (for logging).
data: Vec<DataRef>Inputs fed each step from node-local data shards.
seed_input: Option<String>Name of the backward seed input to feed 1.0 (e.g. "d_output"), if any.
momentum: f32SGD momentum.
lr_per_epoch: Vec<f32>Learning rate per epoch (len() = number of epochs). The master owns the
schedule; the worker just applies lr_per_epoch[epoch].
batch: usizeMini-batch size (matches the graph’s input batch dim).
device: StringDevice directive: auto (node’s fastest), or a name (metal, cuda, …).
grad_group: u64The collective group id the worker’s reduce closure averages over
(informational — the closure owns the actual all-reduce).
push_data: boolIf set, the master pushes each worker its data shard over the wire
(for nodes with no shared filesystem); the worker rewrites its DataRefs
to the received local files. When false, workers resolve the URIs
node-locally (shared FS / pre-staged data).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TrainSpec
impl<'de> Deserialize<'de> for TrainSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TrainSpec
impl RefUnwindSafe for TrainSpec
impl Send for TrainSpec
impl Sync for TrainSpec
impl Unpin for TrainSpec
impl UnsafeUnpin for TrainSpec
impl UnwindSafe for TrainSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more