GLM-5.3-Flash · 执行总览 模型主路径与阶段差异 · 点击模块,进入前面的 Tensor 数据流查看算子、shape 和公式 Prefill · TP8 Decode · TP1 45 层主干 Attention:34 KDA / 11 SFA FFN:前 3 层 Dense / 后 42 层 MoE MoE:288 experts · top-8 Embeddingtoken IDs → hidden Decoder ×45 · 每层的 HC 位置展开如下 Final Norm → LM headhidden → logits 主干层 · HC_pre / HC_post 的逻辑位置 紫色:前混合 + Norm 棕色:输出回混 虚线:residual 旁路 Attention residual:绕过子层,在 Attention HC_post 汇入 FFN residual:绕过子层,在 FFN HC_post 汇入 Attention 前:HC_pre 生成 layer_input、post、comb,随后做 input RMSNorm。源码 glm5next_model_34c91707.py:419–445;L0 直接 HC_pre,其他层先结算上层 FFN HC_post。 HC_preAttention 前+ RMSNorm生成 post / comb Attention · 二选一 KDA ×34Prefill 数据流 ↗ SFA ×11Prefill 数据流 ↗ Attention 后:HC_post 将 Attention 输出与本子层的 residual/post/comb 回混;随后进入 FFN HC_pre。源码 glm5next_model_34c91707.py:461–472、527–548。 HC_postAttention 后输出回混合入 residual FFN 前:Attention HC_post 之后,HC_pre 使用 hc_ffn 参数生成 FFN 输入,再做 post-attention RMSNorm。两步在 hc_post_pre helper 内连续调用。源码 glm5next_model_34c91707.py:461–472。 HC_preFFN 前+ RMSNorm生成 post / comb FFN · Dense / MoEL0–2 Dense / L3–44 MoEMoE:Shared + RoutedPrefill 数据流 ↗ FFN 后的逻辑回混位置。普通层将 residual/post/comb 传出,在下一层入口先执行此 HC_post,再执行下一层 Attention HC_pre;末层 L44 在 FFN 后立即 HC_post 并 hc_contract。源码 glm5next_model_34c91707.py:419–445、480–488。 HC_postFFN 后(逻辑位置)普通层:延至下层入口末层 L44:本层尾执行 hc_post_pre:先 HC_post(Attention),再 HC_pre(FFN) 跨层:本层 FFN HC_post → 下一层 Attention HC_pre(在下一层入口连续调用 hc_post_pre)。 首层 L0:无上层 HC_post,expand 后直接 HC_pre;末层 L44:FFN 后 HC_post + contract,再进入 Final Norm / LM head。 Prefill · 处理 prompt,建立缓存 KDA:按块累计状态;SFA:写入 KV / 索引缓存。 随后进入对应的 Dense / MoE;主干结果用于首 token 输出。 历史 capture:kernel 累加 28.130 s · 时间跨度 25.830 s Decode · 消费新 token,推进状态 KDA:递推更新;SFA:读取并更新已有 KV / 索引缓存。 复用相同主干;启用 MTP 时,再进行候选生成与验证。 历史 capture:kernel 累加 0.172 s · 时间跨度 0.358 s Decode · 可选 MTP 循环 MTP draft · 生成 5 个候选 Target verify · 验证候选 Accept · 提交通过的 token 下一轮 · 继续 draft / verify MTP 复用 1 个物理层执行多步 draft,其 block 使用 SFA / MoE;上方四个 HC 方框标示的是 45 层主干。 耗时仅保留历史 capture 摘要;kernel 累加可重叠,时间跨度不是单请求延迟,两份 capture 不作直接比较。 完整算子 / profiling 对照 ↗ 继续:KV cache 分组 ↗ GLM-5.3-Flash · 算子 tensor 数据流 源码依赖 / 可审计数据 ↗
蓝=activation 橙=gate / weights 紫=cache / state 绿=indices 灰虚线=metadata;条件边不一定同时执行。同编号端口=连线接续(不是算子);同名输出=同一 tensor 的不同去向。点击追踪完整依赖。

输入
输出 / 消费者
数学公式
源码 34c91707 · 算子组 / 逻辑 tensor 依赖,非实机 kernel trace;融合内部中间量不保证单独物化。视图 / 原地写回不等于额外分配。执行与 profiling 总览可在顶部切换。