Skip to main content

WeightResidency

Enum WeightResidency 

Source
#[non_exhaustive]
pub enum WeightResidency { Layers(LayerWeightResidency),
#[non_exhaustive]
IndependentParameterBanks { ordinary: OrdinaryWeightResidency, cache: ParameterBankLoadOptions, }, }
Expand description

Composable ordinary-unit and independently addressable bank placement.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Layers(LayerWeightResidency)

All parameters share the ordinary unit residency allocation.

§

#[non_exhaustive]
IndependentParameterBanks

Addressable bank members are independent units beside bounded ordinary units.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§ordinary: OrdinaryWeightResidency

Bounded ordinary-unit policy.

§cache: ParameterBankLoadOptions

Bank-member-granular cache controls.

Implementations§

Source§

impl WeightResidency

Source

pub const fn fully_resident() -> Self

Keeps every rank-owned parameter on the execution device.

Source

pub const fn layerwise_host(options: LayerwiseLoadOptions) -> Self

Eagerly materializes ordinary units on host behind a bounded device window.

Source

pub const fn dense_disk_stream(options: DenseDiskStreamLoadOptions) -> Self

Leaves ordinary units cold on disk behind finite host/device caches.

Source

pub const fn with_layers(layers: LayerWeightResidency) -> Self

Keeps every owned parameter in its ordinary unit residency allocation.

Source

pub const fn with_independent_parameter_banks( ordinary: OrdinaryWeightResidency, cache: ParameterBankLoadOptions, ) -> Self

Gives addressable parameter banks an independent cache beside ordinary units.

Source

pub const fn layers(self) -> LayerWeightResidency

Returns ordinary-unit placement.

Source

pub const fn parameter_banks(self) -> ParameterBankResidency

Returns independently addressable bank placement relative to ordinary units.

Source

pub const fn parameter_bank_cache(self) -> Option<ParameterBankLoadOptions>

Returns independently cached parameter-bank controls, when selected.

Source

pub const fn ordinary_residency(self) -> Option<OrdinaryWeightResidency>

Returns ordinary placement paired with an independent parameter-bank cache.

Source

pub const fn ordinary_is_fully_resident(self) -> bool

Returns whether every ordinary parameter remains resident.

Source

pub const fn is_fully_resident(self) -> bool

Returns whether every ordinary unit remains resident.

Source

pub const fn max_cached_shards(self) -> usize

Returns the common checkpoint shard/reader cache bound.

Trait Implementations§

Source§

impl Clone for WeightResidency

Source§

fn clone(&self) -> WeightResidency

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for WeightResidency

Source§

impl Debug for WeightResidency

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WeightResidency

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for WeightResidency

Source§

impl PartialEq for WeightResidency

Source§

fn eq(&self, other: &WeightResidency) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WeightResidency

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.