Expand description
ATLAS_GLM_PROFILE=1 — per-section decode timing for the GLM-5.3 stack.
Off unless the variable is set. Every span ends in a synchronize, so enabling it
SERIALISES the stream: read the split, not the total, and never quote a tok/s taken
with it on.
Sections are chosen to separate the three things that can each explain a 10x decode
gap and look identical from the outside: weight bandwidth (the GEMM buckets), launch
and host-sync latency (moe_hostsync, call counts), and collectives (reduce_*).
Constants§
- DSA_
ATTEND - DSA_
INDEXER - DSA_
PROJ - DSA_
SELECT - KDA
- MHC
- MHC_
POST - mHC split by kernel:
hc_pre(the mix + finish pair) vshc_post(+ expand/head). - MLP_
DENSE - MOE_
COMBINE - MOE_
EXPERTS - MOE_
HOSTSYNC - MOE_
ROUTER - MOE_
SHARED - NORM
- REDUCE_
ATTN - REDUCE_
ATTN_ BAR - A 2-BYTE collective issued immediately before the real one, PROFILING ONLY. It is a
rendezvous: neither rank leaves it until both have arrived, so it absorbs the per-call
arrival jitter and charges the minimum-payload NCCL latency. The real 8 KB reduce that
follows therefore starts with both ranks synchronised, which is what makes
REDUCE_ATTN/REDUCE_MLPreadable as network-and-kernel cost rather than “network plus whatever the other rank was still doing”. - REDUCE_
ATTN_ ENQ - Host-side ENQUEUE cost of the two collectives — the driver/NCCL calls only, no sync.
Paired with
REDUCE_ATTN/REDUCE_MLP, which then time ONLY thesynchronizethat follows, i.e. the device + network + rank-skew wait. Splitting them is the difference between “the fabric is slow” and “we call it 90 times a token”. - REDUCE_
MLP - REDUCE_
MLP_ BAR - REDUCE_
MLP_ ENQ
Functions§
- end
- end_
nosync - Record a span WITHOUT synchronising — host-side wall time only.
- end_us
- Same, returning the measured microseconds (0.0 when profiling is off).
- full
- True only at level 1 — the per-kernel spans.
- on
- probe_
buf - 4-byte device scratch for the rendezvous probe. Allocated once, PROFILING ONLY.
- start
- Open a span.
Nonewhen profiling is off, which makesenda no-op. - start_
hot - A span that survives level 2: the collectives and their rendezvous probe.
- stash_
route - Called from
forward_moeright after the routing D2H. No-op unless tracing. - step
- Close one token. Dumps a cumulative per-token split every 8 steps, then keeps going — the totals are cumulative so a later dump is simply better averaged.
- trace_
bar - Emit the joined line.
siteisattnormlp;moesays whether THIS layer’s MLP is routed (the 3 dense layers are the natural control: no EP imbalance is possible there). - trace_
on ATLAS_GLM_ROUTE_TRACE=1— emit one line per reduce site per layer per token carrying the router’s selected GLOBAL expert ids and the measured rendezvous (arrival-skew) time.