Skip to main content

MimoMm

Struct MimoMm 

Source
pub struct MimoMm {
    pub source: MimoMmSource,
    pub config: Value,
    pub audio_tokenizer_config: Value,
    pub vision: MimoVisionGeom,
    pub audio: MimoAudioGeom,
    pub audio_tokenizer: MimoAudioTokenizerGeom,
    pub tokens: MimoTokenIds,
    pub hidden_size: usize,
    pub provenance: Option<Value>,
    /* private fields */
}
Expand description

Data holder for the MiMo-V2 towers: the container handle, the parsed configs and geometry, and typed tensor access. Building one validates the whole tower inventory (names, shapes, codebook dtype) and the pinned special ids; Self::validate_text checks the pairing with a text model.

Fields§

§source: MimoMmSource§config: Value

The full source config.json.

§audio_tokenizer_config: Value

audio_tokenizer/config.json.

§vision: MimoVisionGeom§audio: MimoAudioGeom§audio_tokenizer: MimoAudioTokenizerGeom§tokens: MimoTokenIds§hidden_size: usize

LLM hidden size the towers project into (4096).

§provenance: Option<Value>

provenance.mimo_mm as written by the converter (codec per group, config sha256, source revision), when present.

Implementations§

Source§

impl MimoMm

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self, String>

Open a companion (or single-file multimodal CMF) by path.

Source

pub fn from_model(model: &Arc<CmfModel>) -> Result<Self, String>

Build from an open container: a mimo_v2_mm companion, or a mimo_v2 file that carries the towers. Every inconsistency is an error; nothing is defaulted.

Source

pub fn discover( text_path: &Path, explicit: Option<&Path>, ) -> Result<Option<PathBuf>, String>

Find the companion of a text CMF: explicit (must exist), else <stem>.mm.cmf beside it (the stem without .cmf and without a -NNNNN-of-NNNNN shard suffix), else the only *.mm.cmf in the directory. Ok(None) when there is none; two candidates are an error.

Source

pub fn attach( text: &Arc<CmfModel>, explicit: Option<&Path>, ) -> Result<Option<Self>, String>

Towers for a text model: the file’s own towers (single-file multimodal), else a discovered or explicit companion — validated against the text model (Self::validate_text_model). Ok(None): the model is not mimo_v2, or no towers exist anywhere. An explicit --mm on a non-MiMo model is an error.

Source

pub fn validate_text_model(&self, text: &CmfModel) -> Result<(), String>

Self::validate_text with the tokenizer embedded in the text CMF (a text file without one cannot be checked and is refused).

Source

pub fn validate_text( &self, text: &CmfModel, tok: &Tokenizer, ) -> Result<(), String>

Hard checks that this tower set belongs to text: arch mimo_v2, the same hidden size, and a tokenizer that maps the nine special tokens to the pinned ids.

Source

pub fn model(&self) -> &Arc<CmfModel> ⓘ

The container the tower tensors live in.

Source

pub fn has(&self, name: &str) -> bool

Source

pub fn entry(&self, name: &str) -> Result<&TensorEntry, String>

Directory entry (dtype, shape) of a tensor.

Source

pub fn dtype(&self, name: &str) -> Option<TensorDtype>

Storage dtype of a tensor, if present.

Source

pub fn linear( &self, name: &str, rows: usize, cols: usize, ) -> Result<QTensor, String>

A 2-D weight [rows, cols] on the engine’s kernels (quantized payloads stay memory-mapped; F16/F32 dequantize to f32 once).

Source

pub fn f32(&self, name: &str) -> Result<Vec<f32>, String>

Any tensor dequantized to f32 (row-major, directory shape).

Source

pub fn f32_shaped( &self, name: &str, shape: &[usize], ) -> Result<Vec<f32>, String>

Self::f32 with a shape check.

Source

pub fn group_codec(&self, group: MimoTowerGroup) -> Option<&str>

Codec recorded by the converter for a tower group (“q4tp”, “f16”, …).

Trait Implementations§

Source§

impl Debug for MimoMm

Source§

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

Formats the value using the given formatter. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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