pub struct PromptCacheTopology { /* private fields */ }Expand description
Rank-local topology recorded in a prompt-cache manifest.
Implementations§
Source§impl PromptCacheTopology
impl PromptCacheTopology
Sourcepub fn new(
stage: Option<(usize, usize)>,
shard: Option<(usize, usize)>,
addressable: Option<(usize, usize)>,
addressable_state_replicated: bool,
) -> Result<Self, PromptCacheError>
pub fn new( stage: Option<(usize, usize)>, shard: Option<(usize, usize)>, addressable: Option<(usize, usize)>, addressable_state_replicated: bool, ) -> Result<Self, PromptCacheError>
Creates and validates an exact cache-placement topology.
Sourcepub const fn stage(&self) -> Option<(usize, usize)>
pub const fn stage(&self) -> Option<(usize, usize)>
Returns ordered-stage size and rank when partitioned.
Sourcepub const fn shard(&self) -> Option<(usize, usize)>
pub const fn shard(&self) -> Option<(usize, usize)>
Returns state-shard size and rank when partitioned.
Sourcepub const fn addressable(&self) -> Option<(usize, usize)>
pub const fn addressable(&self) -> Option<(usize, usize)>
Returns addressable-group size and rank when partitioned.
Sourcepub const fn addressable_state_replicated(&self) -> bool
pub const fn addressable_state_replicated(&self) -> bool
Returns whether cache state is replicated on the addressable axis.
Sourcepub fn validate(&self) -> Result<(), PromptCacheError>
pub fn validate(&self) -> Result<(), PromptCacheError>
Validates every optional world-size/rank pair.
Sourcepub fn cache_rank_identity(&self) -> Option<CacheRankIdentity>
pub fn cache_rank_identity(&self) -> Option<CacheRankIdentity>
Returns the rank identity stored on cache blocks, if distributed.
Trait Implementations§
Source§impl Clone for PromptCacheTopology
impl Clone for PromptCacheTopology
Source§fn clone(&self) -> PromptCacheTopology
fn clone(&self) -> PromptCacheTopology
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PromptCacheTopology
impl Debug for PromptCacheTopology
Source§impl Default for PromptCacheTopology
impl Default for PromptCacheTopology
Source§impl<'de> Deserialize<'de> for PromptCacheTopology
impl<'de> Deserialize<'de> for PromptCacheTopology
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PromptCacheTopology
Source§impl Hash for PromptCacheTopology
impl Hash for PromptCacheTopology
Source§impl PartialEq for PromptCacheTopology
impl PartialEq for PromptCacheTopology
Source§impl Serialize for PromptCacheTopology
impl Serialize for PromptCacheTopology
impl StructuralPartialEq for PromptCacheTopology
Auto Trait Implementations§
impl Freeze for PromptCacheTopology
impl RefUnwindSafe for PromptCacheTopology
impl Send for PromptCacheTopology
impl Sync for PromptCacheTopology
impl Unpin for PromptCacheTopology
impl UnsafeUnpin for PromptCacheTopology
impl UnwindSafe for PromptCacheTopology
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
Mutably borrows from an owned value. Read more