pub enum Glm5NextRouterMode {
HfFp32,
VllmBf16,
}Expand description
Which dtype ladder GLM-5.3’s MoE router runs in.
🔴 This is a SEMANTIC switch, not a precision preference. Slice 10 measured the two ladders selecting a different top-8 expert set on ~89–95 % of tokens (layers 3/23/44, T=2048), moving 20–26 % of routed weight mass onto experts the other ladder did not pick. Treating it as a harmless rounding choice is how a “faster router” silently becomes a different model.
Deliberately its OWN field, not derived from the quantization config or from
PrecisionSchedule::router_dtype (which is a weight-STORAGE schedule with no compute
meaning, and no consumers). Inferring a semantic from an unrelated knob is the defect this
avoids.
GLM-scoped on purpose: no other Atlas model has a contested router ladder, and widening this into a cross-model routing refactor would be scope Atlas has not asked for.
Variants§
HfFp32
CANONICAL / REFERENCE. HF transformers 5.16.1 semantics:
F.linear(hidden.type(float32), weight.type(float32)), and sigmoid / correction bias /
top-k / renormalisation all in fp32. This is the production default and must not change
without review.
VllmBf16
COMPATIBILITY / ORACLE REPRODUCTION. Reproduces what vLLM currently does for
glm5_next_text: GateLinear.out_dtype resolves to None (the fp32 special case in
_get_moe_router_dtype fires only for glm_moe_dsa or an explicit moe_router_dtype),
so the gate GEMM runs in the model dtype and grouped_topk does no upcast.
Exists so Atlas can reproduce the frozen vLLM oracle’s routing for A/B work. Never a production default.
Implementations§
Source§impl Glm5NextRouterMode
impl Glm5NextRouterMode
Sourcepub fn from_config_str(s: &str) -> Option<Self>
pub fn from_config_str(s: &str) -> Option<Self>
Parse the moe_router_dtype config field — the same name vLLM reads.
Absent ⇒ Self::HfFp32. That is the opposite of vLLM’s fallthrough, and deliberately
so: absent means “the checkpoint did not say”, and the reference implementation’s answer
for that case is fp32.
Trait Implementations§
Source§impl Clone for Glm5NextRouterMode
impl Clone for Glm5NextRouterMode
Source§fn clone(&self) -> Glm5NextRouterMode
fn clone(&self) -> Glm5NextRouterMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Glm5NextRouterMode
impl Debug for Glm5NextRouterMode
Source§impl Default for Glm5NextRouterMode
impl Default for Glm5NextRouterMode
Source§fn default() -> Glm5NextRouterMode
fn default() -> Glm5NextRouterMode
Source§impl<'de> Deserialize<'de> for Glm5NextRouterMode
impl<'de> Deserialize<'de> for Glm5NextRouterMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for Glm5NextRouterMode
impl PartialEq for Glm5NextRouterMode
impl Copy for Glm5NextRouterMode
impl Eq for Glm5NextRouterMode
impl StructuralPartialEq for Glm5NextRouterMode
Auto Trait Implementations§
impl Freeze for Glm5NextRouterMode
impl RefUnwindSafe for Glm5NextRouterMode
impl Send for Glm5NextRouterMode
impl Sync for Glm5NextRouterMode
impl Unpin for Glm5NextRouterMode
impl UnwindSafe for Glm5NextRouterMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.