Skip to main content

PrecisionSchedule

Struct PrecisionSchedule 

Source
pub struct PrecisionSchedule {
    pub config: ScheduleConfig,
    pub profile_name: String,
    pub steps: Vec<StepPrecision>,
    pub transitions: Vec<(u32, Precision, Precision)>,
    pub avg_vram_ratio: f32,
    pub avg_quality_factor: f32,
    pub estimated_speedup: f32,
}
Expand description

Complete precision schedule for a generation

Fields§

§config: ScheduleConfig

Configuration used to generate this schedule

§profile_name: String

Profile used

§steps: Vec<StepPrecision>

Per-step precision assignments

§transitions: Vec<(u32, Precision, Precision)>

Precision transition points

§avg_vram_ratio: f32

Estimated average VRAM ratio

§avg_quality_factor: f32

Estimated quality factor

§estimated_speedup: f32

Estimated speedup factor

Implementations§

Source§

impl PrecisionSchedule

Source

pub fn generate(config: ScheduleConfig) -> Result<Self>

Generate a schedule from configuration

Source

pub fn precision_at(&self, step: u32) -> Result<Precision>

Get precision for a specific step

Source

pub fn step_info(&self, step: u32) -> Result<&StepPrecision>

Get step precision info

Source

pub fn next_transition( &self, after_step: u32, ) -> Option<(u32, Precision, Precision)>

Get next transition after a given step

Source

pub fn steps_at_precision(&self, precision: Precision) -> SmallVec<[u32; 32]>

Get all steps using a specific precision

Source

pub fn precision_distribution(&self) -> Vec<(Precision, usize, f32)>

Total time at each precision

Source

pub fn format_timeline(&self) -> String

Format as a visual timeline

Trait Implementations§

Source§

impl Clone for PrecisionSchedule

Source§

fn clone(&self) -> PrecisionSchedule

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for PrecisionSchedule

Source§

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

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

impl<'de> Deserialize<'de> for PrecisionSchedule

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PrecisionSchedule

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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<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> 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 = Infallible

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,