Expand description
2026-09-25: Per-section decode timing for the GLM-5.3 layers, enabled by METRALE_GLM_PROFILE.
Owner: model-arch (GLM-5.3). Invariants:
- Unless
METRALE_GLM_PROFILEis1or2,startandstart_hotreturnNoneand no span synchronises. endandend_ussynchronise the stream before reading the clock, so a profiled run is serialised and its throughput is not a serving figure.
Constants§
- DSA_
ATTEND - DSA_
INDEXER - DSA_
PROJ - DSA_
SELECT - KDA
- KDA_
BACK - KDA_
FRONT - 2026-09-25: Sub-spans of the KDA mixer: the projections before the recurrence, the
recurrence, and the output side, timed in
glm5next_kda’s decode and prefill. - KDA_
RECUR - MHC
- MHC_
POST - 2026-09-25:
hc_post, plushc_head_meanon the last layer;MHCholdshc_expandandhc_pre. - MLP_
DENSE - MOE_
COMBINE - MOE_
EXPERTS - MOE_
HOSTSYNC - MOE_
ROUTER - MOE_
SHARED - NORM
- REDUCE_
ATTN - REDUCE_
ATTN_ BAR - 2026-09-25: A 2-byte all-reduce issued just before the real one while profiling
(
Glm5NextLayer::reduce_probe), so that the ranks’ arrival skew is charged here and not toREDUCE_ATTNorREDUCE_MLP. - REDUCE_
ATTN_ ENQ - 2026-09-25: Host time to enqueue the attention and MLP all-reduces, without a synchronise.
REDUCE_ATTNandREDUCE_MLPthen time only thesynchronizethat follows the enqueue. - REDUCE_
MLP - REDUCE_
MLP_ BAR - REDUCE_
MLP_ ENQ
Functions§
- end
- end_
nosync - 2026-09-25: Record a span without synchronising: host wall time only.
- end_us
- 2026-09-25:
end, returning the span in microseconds; 0.0 whent0isNone. - full
- 2026-09-25: True only at level 1, the per-kernel spans.
- on
- probe_
buf - 2026-09-25: 4-byte device buffer for the rendezvous probe, allocated on first use; 0 when the
allocation failed, and
reduce_probethen skips the probe. - start
- 2026-09-25: Open a span at level 1;
Noneotherwise, which makesenda no-op. - start_
hot - 2026-09-25: Open a span at level 1 or 2, for the collectives and their rendezvous probe.
- stash_
route - 2026-09-25: Called from
forward_moeafter the ids are read back. No-op unless tracing. - step
- 2026-09-25: Count one token. Every 8th token, log the cumulative time per token and calls per token of each bucket.
- trace_
bar - 2026-09-25: Log the trace line of one reduce site:
siteisattnormlp, andmoesays whether this layer’s MLP is routed. No-op unless tracing. - trace_
on - 2026-09-25:
METRALE_GLM_ROUTE_TRACE=1:trace_barlogs one line per reduce site per layer with the rendezvous time and the expert idsstash_routelast saved. Read once. It logs only while profiling is on too, becausetrace_baris called fromreduce_probe.