ModeloptFormat

Struct ModeloptFormat 

Source
pub struct ModeloptFormat {
    pub algo: String,
    pub ignore_modules: Vec<String>,
}
Expand description

ModelOpt-style NVFP4 checkpoint.

Fields§

§algo: String

quant_algo declared in config ("NVFP4", "FP8", …). Used for diagnostic logging — the actual dispatch uses base_variant.

§ignore_modules: Vec<String>

Module-path globs to load as dense BF16 rather than NVFP4.

Implementations§

Source§

impl ModeloptFormat

Source

pub fn new(algo: String, ignore_modules: Vec<String>) -> Self

Trait Implementations§

Source§

impl Debug for ModeloptFormat

Source§

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

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

impl QuantFormat for ModeloptFormat

Source§

fn name(&self) -> &'static str

Human-readable name for logs ("modelopt", "compressed-tensors", "fp8-blockscaled").
Source§

fn base_variant(&self) -> Nvfp4Variant

The Nvfp4Variant that this format maps to in the existing weight_map.rs dispatch. Allows the trait to co-exist with the legacy variant-based call sites during incremental migration.
Source§

fn is_ignored(&self, module_path: &str) -> bool

Is module_path in the format’s ignore list (should be loaded as dense BF16 rather than quantized)? module_path is the tensor name with the trailing .weight_scale_2 / .weight_packed / etc. stripped — i.e. the prefix passed to weight_map::quantized_any.
Source§

fn variant_for(&self, module_path: &str) -> Nvfp4Variant

Effective variant for a specific module: the base variant, or Bf16Raw if the module is in the ignore list. Loaders should consult this instead of base_variant when loading per-module.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more