Skip to content

train 1128140220: #5211 #5301 (CI only) - #5526

Closed
ashhart wants to merge 6 commits into
mainfrom
lead/train-1128140220
Closed

ashhart wants to merge 6 commits into
mainfrom
lead/train-1128140220

Conversation

@ashhart

@ashhart ashhart commented Nov 28, 2026

Copy link
Copy Markdown
Owner

CI for a landing train: #5211 #5301 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.

Bizuayeu and others added 6 commits November 28, 2026 14:02
…the kernel contract

ERNIE 5.5's DSA layers attend over each row's indexer picks and its 128-position sliding window, laid out by
vLLM-ERNIE's merge_swa_topk as one list a row. tf_ernie55_window_merge (a new ernie5_5_index image) writes that list
for the sparse MLA from topk_rows' out and picked: the row's picks up to picked, held to [0, k] and ending at the
first -1, then positions seq - min(seq, 128) .. seq - 1, then -1, with the row's count. The count comes from picked
rather than from the position, and the picks stop at their first -1, so an entry the MLA reads is never a -1, even
where picked counts past the picks a row holds. window.zig is the host's list; its tests hold it to the vendor's rule
where picked is the indexer's count, and to the stop where picked is past a row's valid picks.

The contract (ernie5_5-index, also in kernel-contract) asks for the host's lists to the byte, and every row's entries
to be rows below seq, ascending to seq - 1 with its picks below the window, from decode rows at the first position
and deep in context, across seq = 128 and seq = k + 128, to prompt chunks and the 1M context's last rows. A negative
picked and two oversized ones, past a row of k picks and past a shorter row, are planted. The two controls, every row
taking all k picks and the window's oldest position dropped, go red. Nothing launches it yet. gradient-serving.tsv
re-pins zig/src/cuda/kernels.zig.
…the kernel contract

ERNIE 5.5's DSA layers attend over each row's indexer picks and its 128-position sliding window, laid out by
vLLM-ERNIE's merge_swa_topk as one list a row. tf_ernie55_window_merge (a new ernie5_5_index image) writes that list
for the sparse MLA from topk_rows' out and picked: the row's picks up to picked, held to [0, k] and ending at the
first -1, then positions seq - min(seq, 128) .. seq - 1, then -1, with the row's count. The count comes from picked
rather than from the position, and the picks stop at their first -1, so an entry the MLA reads is never a -1, even
where picked counts past the picks a row holds. window.zig is the host's list; its tests hold it to the vendor's rule
where picked is the indexer's count, and to the stop where picked is past a row's valid picks.

The contract (ernie5_5-index, also in kernel-contract) asks for the host's lists to the byte, and every row's entries
to be rows below seq, ascending to seq - 1 with its picks below the window, from decode rows at the first position
and deep in context, across seq = 128 and seq = k + 128, to prompt chunks and the 1M context's last rows. A negative
picked and two oversized ones, past a row of k picks and past a shorter row, are planted. The two controls, every row
taking all k picks and the window's oldest position dropped, go red. Nothing launches it yet. gradient-serving.tsv
re-pins zig/src/cuda/kernels.zig.
…apse's RMSNorm, under the kernel contract

tf_ernie55_mhc_pre, in a new ernie5_5_mhc image, runs a row of ERNIE 5.5's 4 residual streams through vLLM-ERNIE's
mHC pre step: the 24 mixes against fn's float32 rows (a thread's 64 terms in one fma chain, the warp's butterfly,
the 8 warps' partials in order) times ERNIE's mix RMS, 1 / (sqrt(mean) + eps); pre, post (2 sigmoid) and comb (each
row's softmax plus hc_eps, then hc_sinkhorn_iters rounds of column and row sums); then the collapse sum_s pre_s x_s,
its RMSNorm from the unrounded sums' squares, and the norm's weight times the bf16 collapse, rounded to bf16 once.

GLM's finish in common/mhc.cuh takes the mix RMS from its caller, but it also reads fn in bf16, squares the rounded
collapse and rounds the normed value before the weight, so ERNIE's rounding points need their own body. The vendor's
mixes are a TF32 GEMM; these are fp32 products of bf16 x and fp32 fn.

Each output is checked alone against float64 (ernie5_5/mhc.zig), as GLM's float32-weight finish is, with two
controls: the plain mix RMS, 1 / sqrt(mean + eps), on rows below 1e-6, and comb's softmax over a column.
@ashhart

ashhart commented Nov 28, 2026

Copy link
Copy Markdown
Owner Author

Stopped at #5301.

@ashhart ashhart closed this Nov 28, 2026
@ashhart
ashhart deleted the lead/train-1128140220 branch November 28, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants