Repository navigation
hy4_flash: paged absorbed MLA + C1/C2 CUDA kernels, contracts, and 5-SM limits - #5109
GrgaPalcic wants to merge 8 commits into
Conversation
|
Thank you @GrgaPalcic. The 19 live kernels have launchers and registrations. The paged C1 tests use real nonidentity page tables, two streams, padded strides, page-boundary tails and a wrong-page negative, with contiguous-output byte comparisons. Existing serving paths are untouched, and the patch merges cleanly on current main. Three fixes remain:
After those fixes, the outstanding checks are the GB10
|
|
Updated
Verification receipts
|
|
Thank you for forwarding the C1 list, adding long indexed rows and same-engine byte comparisons, and shortening the two comments. The launcher and list forwarding changes are confirmed, and the branch merges cleanly on current main. Two test-oracle issues remain:
After those changes, please rerun the two existing CUDA synthetic contract suites for paged C1 and C2 on the final head. No serving checkpoint run applies to this slice. No rebase is requested.
|
|
Updated
Verification receipts
|
08f4f66 to
532e484
Compare
|
Thanks @GrgaPalcic for the careful updates. The indexed-list forwarding, all six long-list C1 reference-and-bounds checks, contiguous byte comparisons, wrong-page control, C2 variant comparisons, comment fixes, and immediate expand-buffer poisoning are all addressed in the final source. One correctness issue remains in C2 absorb. All three live absorb entry points use the null-CSv path. That path writes the low roped plane but never writes the corresponding high roped columns; the main projection stores do not cover them. The contract currently zeroes the baseline, variant, and single-row buffers, so it accepts those unwritten bytes as zeros. Please write a deterministic high roped plane for every valid row in this path—zeroing it is the smallest change consistent with the current contract—and poison the absorb baseline, comparison, and single-row buffers with After that change, the remaining evidence is the two final CUDA synthetic contract runs for paged C1 and C2. No serving checkpoint run applies to this slice. I reviewed source only and did not build or run the PR.
|
|
Updated
Live GB10 (
|
|
Thank you @GrgaPalcic. The final head writes deterministic zeroes to both null-CSv roped planes for every valid row, and all absorb baseline, variant, and single-row buffers are poisoned with The refreshed absorb resource records, kernel hash pin, registrations, and current-main integration also look correct. I found no new source defect. Your exact-head GB10 runs complete the remaining paged-C1 and C2 synthetic qualification. This is ready to land and goes into the next trains. No serving checkpoint run applies to this kernel-only slice. I reviewed source only and did not build or run the PR.
|
dec357f to
9ac1b55
Compare
…ch contracts, wrap comments
… C2 expand buffers
…nd hy4c2_absorb_d2_x
9ac1b55 to
4ec4b07
Compare
Refs #4795.
Summary
Adds the paged absorbed MLA + C1/C2 tensor-core CUDA kernel slice (Slice 2d-1 of #4795) for
Hy4-flash(strictly bit-identical BF16 KV cache only; no lossy KV formats):zig/kernels/cuda/hy4_flash/):mla_paged.cu(hy4_mla_paged, 5 kernels):tf_hy4_mla_absorb,tf_hy4_mla_attn,tf_hy4_mla_attn_rows,tf_hy4_mla_value,tf_hy4_mla_post.mla_attn_paged.cu(hy4_mla_attn_paged, 7 live 2-plane C1 kernels):hy4_mla_dec_x16,hy4_mla_dec_x16_rows,hy4_mla_dec_x16_qreg,hy4_mla_dec_x16_qreg_rows,hy4_mla_fold,hy4_mla_dec_x16_paged,hy4_mla_dec_x16_qreg_paged(all unused legacy symbols removed).mla_c2.cu/mla_c2.cuh(hy4_mla_c2, 7 live C2 kernels reusing../common/qmm_frag.cuh):hy4c2_absorb_d1_x,hy4c2_absorb_d2_x,hy4c2_absorb_p_x,hy4c2_expand_d1_f32lat,hy4c2_expand_d2_f32lat,hy4c2_expand_d4k64s2_f32lat,hy4c2_expand_p_f32lat(all unused symbols removed).zig/src/families/hy4_flash/):mla_paged_cuda.zig,mla_c1_cuda.zig,mla_c2_cuda.zig(single root modulehy4_mla_paged_cudainzig/build/cuda.zig).zig/tests/cuda/):contract_hy4_mla_paged.zig+contract_hy4_mla_c1_c2.zig(wired viacontract_family_sets.zigwithSets.initPairZONOS3errdefercleanup and host failure regression).hy4_mla_paged: all 5 kernels (10cases across decode/prefill/per-row) +20planted controls (nonfinite,repeat,shapes,sums).hy4_mla_attn_paged: all 7 C1 kernels (x16,x16_rows,x16_qreg,x16_qreg_rows,x16_paged,x16_qreg_paged,fold) with 2 streams, deterministic non-identity 256-row page tables + 2 unmapped NaN-poisoned physical pages, page-boundary tails (255, 256, 257, 513), exact byte equality against equivalent contiguous launches, plus a wrong-page negative control (hy4_mla_dec_x16_paged wrong page table, red at Gate 3).hy4_mla_c2: all 7 C2 kernels (absorb_d1_x/d2_x/p_xexact 2-plane vs float64W_UK_T, andexpand_d1/d2/d4k64s2/p_f32lat+ sigmoid gate vs float64 bound).zig/src/core/contract/hy4_mla_paged_records.zig:nvcc 13.0records for all 19 live launches acrosssm_80, sm_86, sm_89, sm_120, sm_121(95/95records).zig/tests/fixtures/gradient-serving.tsv: updatedzig/src/cuda/kernels.zighash pin.Verification
sm_121,nvcc 13.0):tf-cuda-test kernel-contract hy4_mla_paged:10/10kernels pass Gates 1–4,20/20controls red as planted (0missed),0limit problems.tf-cuda-test kernel-contract hy4_mla_attn_paged:6/6C1 cases (all 7 symbols) pass Gates 1–4,1/1wrong-page control red as planted (0missed),0limit problems.tf-cuda-test kernel-contract hy4_mla_c2:2/2C2 cases (all 7 symbols, worst0.913of float64 bound) pass Gates 1–4,0limit problems.tf-cuda-test kernel-contract-limitsacrosssm_80, sm_86, sm_89, sm_120, sm_121:95/95(record current),0stale.python3 tools/zig/cuda_common_check.py:0 violations.python3 tools/zig/cuda_fragment_check.py:0 misses.zig build -Dfixed-cpu test-hy4-flash-host test-gradient-serving test-kernel-contract: all pass.python3 tools/pr_check.py --base origin/main:0new lean findings,0errors.Serving engine wiring (
hy4_flashruntime + DFly2 CUDA graphs + 2×/4× Spark receipts) remains deferred to Slice 3; existing serving paths are unchanged.