pub struct Glm5NextWeightLoader;Trait Implementations§
Source§impl ModelWeightLoader for Glm5NextWeightLoader
impl ModelWeightLoader for Glm5NextWeightLoader
Source§fn binds_vision_encoder(&self) -> bool
fn binds_vision_encoder(&self) -> bool
Text-only port. weight_loader/glm5_next.rs classifies model.visual.*
as TensorRole::Vision and excludes it from is_required(); nothing in
this loader binds it. Saying so here keeps the tower off the GPU in the
first place — on the LibertAIDAI NVFP4 checkpoint that is 1.05 GiB per
rank, sitting between --speculative --num-drafts 2 and a serve that
fits (measured 2026-08-29: K=3 at 32 K needs 13.58 GiB against 12.07 free).
Source§fn supports_tp(&self) -> bool
fn supports_tp(&self) -> bool
All three halves shard: DSA by head, KDA by head/channel, the MLP by width (TP) and by expert set (EP).
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>>
MTP is deliberately out of scope for this slice. None = “no speculative head”, which
the scheduler already handles; it is not a silent skip of something wired.
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<()>
Drop the store’s copy of everything load_layers re-uploaded.
Source§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>>>
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>
Load the final RMSNorm weight used before the LM head. Read more
fn load_lm_head( &self, store: &WeightStore, _config: &ModelConfig, _gpu: &dyn GpuBackend, ) -> Result<DenseWeight>
Source§fn precision_schedule(&self, _config: &ModelConfig) -> PrecisionSchedule
fn precision_schedule(&self, _config: &ModelConfig) -> PrecisionSchedule
Per-(layer, role) weight precision schedule (C.3, 2026-04-25).
Default impl returns the empty schedule (every lookup yields
Dtype::Inherit), preserving the existing per-checkpoint
dtype logic byte-for-byte. Loader-specific implementations
can override to honour MODEL.toml’s [precision] block.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>>
Build the n-gram embedding, when this architecture fuses hashed
n-gram lookups into the input embedding (LongCat / Qwen3.8-Flash-Next). Read more
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>>
Load MTP weights for multi-module MTP (DeepSeek-V3 / MiniMax-M2
style: N independent transformer modules, each with its own
attention + MoE + KV cache). Returns an empty
Vec when the
checkpoint has no MTP modules, a 1-element Vec for single-module
MTP (Qwen3.5 family), or N elements for multi-module. Read moreSource§fn kv_layer_dims(&self, _config: &ModelConfig) -> Vec<(usize, usize)>
fn kv_layer_dims(&self, _config: &ModelConfig) -> Vec<(usize, usize)>
Per-layer (num_kv_heads, head_dim) overrides for heterogeneous
attention models (e.g. Gemma-4 with sliding 16×256 and full 4×512).
Default empty — homogeneous models skip per-layer dims and the KV
cache allocator uses the global (num_kv_heads, head_dim). Populated
by loaders whose models have different attention geometries per
layer. Indexed by attention layer index (same as layer_kv_dtypes).
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>>
Load DFlash drafter weights from a separate
WeightStore pointing
at the drafter checkpoint (z-lab/Qwen3.6-{27B,35B-A3B}-DFlash).
Default impl returns None so loaders that don’t yet support
DFlash silently fall through to the existing MTP path. Override in
loaders whose target models pair with a DFlash drafter (Qwen3.5/3.6
family). The same drafter format works across both 27B-dense and
35B-A3B-MoE targets — only the target_hidden_size validated
against the drafter’s fc input dimension differs.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>>
Load one or more startup-static PEFT LoRA adapters from their own
WeightStores (the adapter_model.safetensors tensors, already
on-device BF16) into the fixed-address rank-padded pool (one slot each). Read moreSource§fn load_vision_encoder(
&self,
_store: &WeightStore,
_config: &ModelConfig,
_gpu: &dyn GpuBackend,
) -> Result<Option<VisionEncoder>>
fn load_vision_encoder( &self, _store: &WeightStore, _config: &ModelConfig, _gpu: &dyn GpuBackend, ) -> Result<Option<VisionEncoder>>
Load vision encoder weights (returns None for text-only models).
Auto Trait Implementations§
impl Freeze for Glm5NextWeightLoader
impl RefUnwindSafe for Glm5NextWeightLoader
impl Send for Glm5NextWeightLoader
impl Sync for Glm5NextWeightLoader
impl Unpin for Glm5NextWeightLoader
impl UnwindSafe for Glm5NextWeightLoader
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