pub struct Glm5NextMhcKernels {
pub hc_expand: KernelHandle,
pub hc_pre: KernelHandle,
pub hc_mix: KernelHandle,
pub hc_mix_bf16: KernelHandle,
pub hc_finish: KernelHandle,
pub hc_post: KernelHandle,
pub hc_head: KernelHandle,
}Expand description
Every kernel GLM-5.3’s hyper-connection needs, all from the single module glm5next_mhc.
The point of this struct is target independence: a GLM kernel target must not have to carry
the DeepSeek-V4 hyper_connection module to resolve half of its own mHC.
Copy so all 45 layers can share one resolution — these are opaque handles, not state.
Fields§
§hc_expand: KernelHandleBroadcast the embedding into the hc_mult streams. First text layer only.
🪤 This is an architecture-neutral broadcast that Atlas already had — and GLM still
needs its own, because hyper_connection::hc_expand lives in the DeepSeek-V4
target directory. A kernel target merges common/ plus its OWN model dir and
cannot reach into another target’s, so for the GLM target that module does not
exist. Resolving it would fail at first construction, not fall back.
hc_pre: KernelHandleThe FUSED single-block hc_pre. Still resolved, and still the oracle
examples/glm5next_hc_split_gate.rs gates the split pair against — but the serve path
goes through hc_mix + hc_finish, which are bit-identical and ~mix_hc times wider.
hc_mix: KernelHandleOne block per mixing row: grid (T, mix_hc).
hc_mix_bf16: KernelHandleSame kernel reading hc_fn at the width the checkpoint stores it (BF16).
Bit-identical — widening BF16 to F32 is lossless, so it multiplies the same floats.
try_kernel; selected per site by Glm5NextMhcSiteWeights::hc_fn_bf16.
hc_finish: KernelHandleSplit + Sinkhorn + collapse, reading the mixes from global.
hc_post: KernelHandle§hc_head: KernelHandleImplementations§
Source§impl Glm5NextMhcKernels
impl Glm5NextMhcKernels
Sourcepub fn resolve(gpu: &dyn GpuBackend) -> Result<Self>
pub fn resolve(gpu: &dyn GpuBackend) -> Result<Self>
Resolve all six. kernel() (not try_kernel) — a missing mHC kernel is a hard error,
never a silent fallback onto the DeepSeek variant.
Trait Implementations§
Source§impl Clone for Glm5NextMhcKernels
impl Clone for Glm5NextMhcKernels
Source§fn clone(&self) -> Glm5NextMhcKernels
fn clone(&self) -> Glm5NextMhcKernels
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more