pub struct PrecisionSchedule { /* private fields */ }Expand description
2026-09-25: Per-(layer, role) precision schedule: one dtype per role, a global default, and a set of sensitive layers with their own dtype.
Implementations§
Source§impl PrecisionSchedule
impl PrecisionSchedule
Sourcepub fn build(
router_dtype: Dtype,
lm_head_dtype: Dtype,
sensitive_block_indices: &[u16],
sensitive_block_dtype: Dtype,
default_dtype: Dtype,
) -> Self
pub fn build( router_dtype: Dtype, lm_head_dtype: Dtype, sensitive_block_indices: &[u16], sensitive_block_dtype: Dtype, default_dtype: Dtype, ) -> Self
2026-09-25: Build a schedule from:
router_dtype: dtype for the MoE gatelm_head_dtype: dtype for the final unembeddingsensitive_block_dtype+sensitive_block_indices: the dtype for the weight tensors of the listed layersdefault_dtype: the global default
The other roles’ dtypes are Inherit.
Sourcepub fn dtype_for(&self, layer_idx: Option<u16>, role: Role) -> Dtype
pub fn dtype_for(&self, layer_idx: Option<u16>, role: Role) -> Dtype
2026-09-25: Resolve the target dtype for a tensor. layer_idx = None
is for non-layer tensors (embedding, lm_head, final norm).
Lookup order, skipping any step that yields Inherit:
- Sensitive-layer dtype (Attention, Expert and SharedExpert only)
- Per-role dtype
- Global default
Sourcepub fn has_any_override(&self) -> bool
pub fn has_any_override(&self) -> bool
2026-09-25: True iff some lookup can return a dtype other than
Inherit. The qwen35 loader logs the schedule when it is.
Trait Implementations§
Source§impl Clone for PrecisionSchedule
impl Clone for PrecisionSchedule
Source§fn clone(&self) -> PrecisionSchedule
fn clone(&self) -> PrecisionSchedule
Returns a duplicate of the value. Read more
1.0.0 · 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 PrecisionSchedule
impl Debug for PrecisionSchedule
Auto Trait Implementations§
impl Freeze for PrecisionSchedule
impl RefUnwindSafe for PrecisionSchedule
impl Send for PrecisionSchedule
impl Sync for PrecisionSchedule
impl Unpin for PrecisionSchedule
impl UnwindSafe for PrecisionSchedule
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