pub struct SamplerState {Show 13 fields
pub version: u32,
pub source_id: String,
pub source_length: usize,
pub rank: usize,
pub world_size: usize,
pub epoch: u64,
pub shuffle_seed: Option<u64>,
pub tail: SampleTail,
pub epoch_size: usize,
pub carried_consumed: usize,
pub scope_size: usize,
pub indices: Vec<usize>,
pub committed: usize,
}std only.Expand description
Actual rank-local sample order and its committed cursor.
The order itself is recorded, so restoration does not depend on reconstructing
a previous rand version’s permutation. Outstanding prefetch is NOT committed:
restore begins at committed, replaying issued-but-unconsumed samples.
Fields§
§version: u32Record format, currently one.
source_id: StringCaller-supplied identity of the immutable dataset/version.
source_length: usizeOriginal source length, not a rank-local length.
rank: usizeData rank; tensor/pipeline ranks may use the same data coordinate.
world_size: usizeData replicas assigning distinct examples.
epoch: u64Current caller-selected epoch number.
shuffle_seed: Option<u64>Private shuffle seed; None selects original source order.
tail: SampleTailTail policy used when starting a fresh epoch.
epoch_size: usizeSize of the originally selected epoch, after its initial tail policy.
carried_consumed: usizeGlobal consumption preceding the most recent topology change.
scope_size: usizeRemaining global scope assigned at that topology change.
indices: Vec<usize>Actual local order; positions are original dataset indices.
committed: usizeSamples actually consumed by this rank from this scope.
Implementations§
Source§impl SamplerState
impl SamplerState
Sourcepub fn validate(&self) -> Result<(), SamplerError>
pub fn validate(&self) -> Result<(), SamplerError>
Validate rank geometry, ordering, bounds and committed accounting.
Trait Implementations§
Source§impl Clone for SamplerState
impl Clone for SamplerState
Source§impl Debug for SamplerState
impl Debug for SamplerState
Source§impl<'de> Deserialize<'de> for SamplerState
impl<'de> Deserialize<'de> for SamplerState
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>,
impl Eq for SamplerState
Source§impl PartialEq for SamplerState
impl PartialEq for SamplerState
Source§impl<B: Backend> Record<B> for SamplerState
impl<B: Backend> Record<B> for SamplerState
Source§type Item<P: PrecisionSettings> = SamplerState
type Item<P: PrecisionSettings> = SamplerState
Source§fn into_item<P: PrecisionSettings>(self) -> Self
fn into_item<P: PrecisionSettings>(self) -> Self
Source§fn from_item<P: PrecisionSettings>(item: Self, _: &B::Device) -> Self
fn from_item<P: PrecisionSettings>(item: Self, _: &B::Device) -> Self
Source§impl Serialize for SamplerState
impl Serialize for SamplerState
impl StructuralPartialEq for SamplerState
Auto Trait Implementations§
impl Freeze for SamplerState
impl RefUnwindSafe for SamplerState
impl Send for SamplerState
impl Sync for SamplerState
impl Unpin for SamplerState
impl UnsafeUnpin for SamplerState
impl UnwindSafe for SamplerState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.