pub struct Qwen35WeightLoader;Trait Implementations§
Source§impl ModelWeightLoader for Qwen35WeightLoader
impl ModelWeightLoader for Qwen35WeightLoader
Source§fn reads_expert_table_plan(&self) -> bool
fn reads_expert_table_plan(&self) -> bool
2026-10-02: Its MoE layers build the transposed NVFP4 prefill tables only when the
serve’s memory plan says they fit (load_layers.rs).
Source§fn load_vision_encoder(
&self,
store: &WeightStore,
config: &ModelConfig,
gpu: &dyn GpuBackend,
) -> Result<Option<VisionTower>>
fn load_vision_encoder( &self, store: &WeightStore, config: &ModelConfig, gpu: &dyn GpuBackend, ) -> Result<Option<VisionTower>>
2026-09-25: Loads the ViT tower from model.visual or model.language_model.visual.
Returns None when config.vision is None or neither prefix holds
patch_embed.proj.weight. Reads depth blocks, one deepstack merger per
deepstack_visual_indexes entry, and the final merger. Linear weights may be BF16,
FP32 or FP8E4M3 (dequantized to BF16); biases, norms and embeddings BF16 or FP32.
Source§fn supports_tp(&self) -> bool
fn supports_tp(&self) -> bool
2026-09-25: Whether this loader’s weight slicing honours
config.tp_world_size / config.tp_rank. There is no default, so every
loader declares it. Read moreSource§fn load_layers(
&self,
store: &WeightStore,
config: &ModelConfig,
gpu: &dyn GpuBackend,
layer_kv_dtypes: &[KvCacheDtype],
) -> Result<Vec<Box<dyn TransformerLayer>>>
fn load_layers( &self, store: &WeightStore, config: &ModelConfig, gpu: &dyn GpuBackend, layer_kv_dtypes: &[KvCacheDtype], ) -> Result<Vec<Box<dyn TransformerLayer>>>
2026-09-25: Load all transformer layers from the weight store. Read more
fn load_embedding( &self, store: &WeightStore, config: &ModelConfig, gpu: &dyn GpuBackend, ) -> Result<DenseWeight>
Source§fn load_final_norm(
&self,
store: &WeightStore,
config: &ModelConfig,
gpu: &dyn GpuBackend,
) -> Result<DenseWeight>
fn load_final_norm( &self, store: &WeightStore, config: &ModelConfig, gpu: &dyn GpuBackend, ) -> Result<DenseWeight>
2026-09-25: Load the final RMSNorm weight used before the LM head.
fn load_lm_head( &self, store: &WeightStore, config: &ModelConfig, gpu: &dyn GpuBackend, ) -> Result<DenseWeight>
Source§fn load_mtp_weights(
&self,
store: &WeightStore,
config: &ModelConfig,
gpu: &dyn GpuBackend,
) -> Result<Option<MtpWeights>>
fn load_mtp_weights( &self, store: &WeightStore, config: &ModelConfig, gpu: &dyn GpuBackend, ) -> Result<Option<MtpWeights>>
2026-09-25: Load single-module MTP head weights, or
None.Source§fn prune_after_load(
&self,
_store: &mut WeightStore,
_config: &ModelConfig,
_gpu: &dyn GpuBackend,
) -> Result<()>
fn prune_after_load( &self, _store: &mut WeightStore, _config: &ModelConfig, _gpu: &dyn GpuBackend, ) -> Result<()>
2026-09-25: Drop store tensors this loader has finished with.
factory::build
calls it after every load_* reader and before the KV budget is
computed, so the freed memory counts. Read moreSource§fn precision_schedule(&self, _config: &ModelConfig) -> PrecisionSchedule
fn precision_schedule(&self, _config: &ModelConfig) -> PrecisionSchedule
2026-09-25: Per-(layer, role) weight precision schedule. The default is
PrecisionSchedule::default(), in which every role is Dtype::Inherit.Source§fn load_ngram_embedding(
&self,
_store: &WeightStore,
_config: &ModelConfig,
_gpu: &dyn GpuBackend,
_max_tokens: usize,
) -> Result<Option<NgramEmbedding>>
fn load_ngram_embedding( &self, _store: &WeightStore, _config: &ModelConfig, _gpu: &dyn GpuBackend, _max_tokens: usize, ) -> Result<Option<NgramEmbedding>>
2026-09-25: Build the n-gram embedding, for an architecture that fuses
hashed n-gram lookups into the input embedding (the LongCat loader).
The default
None leaves the plain embed_tokens gather in place.Source§fn load_mtp_weights_multi(
&self,
store: &WeightStore,
config: &ModelConfig,
gpu: &dyn GpuBackend,
) -> Result<Vec<MtpWeights>>
fn load_mtp_weights_multi( &self, store: &WeightStore, config: &ModelConfig, gpu: &dyn GpuBackend, ) -> Result<Vec<MtpWeights>>
2026-09-25: Load every MTP module;
factory::build calls this one.
The default wraps load_mtp_weights (zero or one module). The MiniMax
and Step3p7 loaders override it.Source§fn kv_layer_dims(&self, _config: &ModelConfig) -> Vec<(usize, usize)>
fn kv_layer_dims(&self, _config: &ModelConfig) -> Vec<(usize, usize)>
2026-09-25: Per-attention-layer
(num_kv_heads, head_dim), indexed like
layer_kv_dtypes, for models whose attention geometry differs per layer
(the Gemma-4 loader). The default is empty: every layer uses the global
dims.Source§fn load_dflash_weights(
&self,
_drafter_store: &WeightStore,
_config: &ModelConfig,
_gpu: &dyn GpuBackend,
_tp_size: usize,
) -> Result<Option<DflashWeights>>
fn load_dflash_weights( &self, _drafter_store: &WeightStore, _config: &ModelConfig, _gpu: &dyn GpuBackend, _tp_size: usize, ) -> Result<Option<DflashWeights>>
2026-09-25: Load DFlash drafter weights from the drafter’s own
WeightStore. The default returns None, and no loader overrides it:
factory::build loads the drafter with the free function
dflash_loader::load_dflash_weights.Source§fn load_lora_adapters(
&self,
adapters: &[LoraAdapterInput<'_>],
config: &ModelConfig,
gpu: &dyn GpuBackend,
max_loras: usize,
max_lora_rank: usize,
) -> Result<Option<LoraWeights>>
fn load_lora_adapters( &self, adapters: &[LoraAdapterInput<'_>], config: &ModelConfig, gpu: &dyn GpuBackend, max_loras: usize, max_lora_rank: usize, ) -> Result<Option<LoraWeights>>
2026-09-25: Load startup-static PEFT LoRA adapters into the LoRA pool,
through
metrale_model_layers::lora::load_lora_adapters_multi.
factory::build calls it before the buffer arena and the KV budget, so
the pool counts as used memory.Source§fn binds_vision_encoder(&self) -> bool
fn binds_vision_encoder(&self) -> bool
2026-09-25: Will this loader bind a vision encoder for a multimodal
checkpoint? Read more
Source§fn defer_predicate(&self, _config: &ModelConfig) -> Option<DeferHook>
fn defer_predicate(&self, _config: &ModelConfig) -> Option<DeferHook>
2026-09-25: Which checkpoint tensors will this loader read from the host
at bind time, so the checkpoint loader records their location instead
of uploading them? Read more
Auto Trait Implementations§
impl Freeze for Qwen35WeightLoader
impl RefUnwindSafe for Qwen35WeightLoader
impl Send for Qwen35WeightLoader
impl Sync for Qwen35WeightLoader
impl Unpin for Qwen35WeightLoader
impl UnwindSafe for Qwen35WeightLoader
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