pub struct DsaTpPlan {
pub tp_rank: usize,
pub tp_size: usize,
pub full_heads: usize,
pub local_heads: usize,
pub tensors: Vec<DsaTensorPlan>,
}Expand description
Per-rank shard plan for one DSA block.
Fields§
§tp_rank: usize§tp_size: usize§full_heads: usize§local_heads: usize§tensors: Vec<DsaTensorPlan>Implementations§
Source§impl DsaTpPlan
impl DsaTpPlan
Sourcepub fn new(
tp_rank: usize,
tp_size: usize,
cfg: &Glm5NextDsaConfig,
) -> Result<Self>
pub fn new( tp_rank: usize, tp_size: usize, cfg: &Glm5NextDsaConfig, ) -> Result<Self>
cfg.local_heads is already per-rank (topology divides before loaders run),
so the full count is reconstructed as local * tp_size — the same convention
TpGdnDims::from_config uses.
pub fn get(&self, name: &str) -> Option<&DsaTensorPlan>
pub fn local_bytes(&self) -> usize
pub fn full_bytes(&self) -> usize
Sourcepub fn needs_output_all_reduce(&self) -> bool
pub fn needs_output_all_reduce(&self) -> bool
o_proj is row-parallel, so its partial output needs the reduce.
Sourcepub fn replicated_bytes(&self) -> usize
pub fn replicated_bytes(&self) -> usize
Bytes replicated on every rank — the part TP cannot remove.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DsaTpPlan
impl RefUnwindSafe for DsaTpPlan
impl Send for DsaTpPlan
impl Sync for DsaTpPlan
impl Unpin for DsaTpPlan
impl UnwindSafe for DsaTpPlan
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