pub struct ParallelPlan {
pub contract: ModelParallelContract,
pub request: TopologyRequest,
pub world_size: usize,
pub stage_ranges: Vec<Range<usize>>,
pub mtp_owner_stage: Option<usize>,
pub shared_expert_replicated: bool,
}Fields§
§contract: ModelParallelContract§request: TopologyRequest§world_size: usize§stage_ranges: Vec<Range<usize>>§mtp_owner_stage: Option<usize>MTP layers are not pipeline stages of their own; the final PP stage owns them.
Implementations§
Source§impl ParallelPlan
impl ParallelPlan
pub fn global_rank( &self, pipeline_rank: usize, tensor_rank: usize, ) -> Option<usize>
pub fn query_head_range( &self, layer: usize, tensor_rank: usize, ) -> Option<Range<usize>>
pub fn kv_head_range( &self, layer: usize, tensor_rank: usize, ) -> Option<Range<usize>>
Sourcepub fn query_feature_range(
&self,
layer: usize,
tensor_rank: usize,
) -> Option<Range<usize>>
pub fn query_feature_range( &self, layer: usize, tensor_rank: usize, ) -> Option<Range<usize>>
Column-parallel Q output range and the matching row-parallel O input range.
Sourcepub fn kv_feature_range(
&self,
layer: usize,
tensor_rank: usize,
) -> Option<Range<usize>>
pub fn kv_feature_range( &self, layer: usize, tensor_rank: usize, ) -> Option<Range<usize>>
Column-parallel K/V output range. Step-3.7 has eight KV heads, so TP2 and TP4 partition them exactly; no KV-head replication is part of this registered contract.
Sourcepub fn dense_ffn_range(&self, tensor_rank: usize) -> Option<Range<usize>>
pub fn dense_ffn_range(&self, tensor_rank: usize) -> Option<Range<usize>>
Column-parallel dense gate/up output range and matching row-parallel down input range.
pub fn routed_expert_range(&self, tensor_rank: usize) -> Option<Range<usize>>
pub fn routed_expert_ffn_range( &self, tensor_rank: usize, ) -> Option<Range<usize>>
Trait Implementations§
Source§impl Clone for ParallelPlan
impl Clone for ParallelPlan
Source§fn clone(&self) -> ParallelPlan
fn clone(&self) -> ParallelPlan
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 ParallelPlan
impl Debug for ParallelPlan
impl Eq for ParallelPlan
Source§impl PartialEq for ParallelPlan
impl PartialEq for ParallelPlan
impl StructuralPartialEq for ParallelPlan
Auto Trait Implementations§
impl Freeze for ParallelPlan
impl RefUnwindSafe for ParallelPlan
impl Send for ParallelPlan
impl Sync for ParallelPlan
impl Unpin for ParallelPlan
impl UnsafeUnpin for ParallelPlan
impl UnwindSafe for ParallelPlan
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