Repository navigation
hy4_flash: router, BF16 row helpers, and DFly2 glue CUDA kernels, contracts, and 5-SM limits - #5099
GrgaPalcic wants to merge 5 commits into
Conversation
|
Thank you, @GrgaPalcic. The router and row-dot replacement checks, conversion/interleave checks and reported passes are useful. The existing serving paths are unchanged, and the head merges cleanly. Three fixes remain. Synthetic inputs on GB10 are enough for these operator checks; no checkpoint is needed. Keep the existing passes scoped to their tested entries, and compare exact replacement bytes and every written output before target qualification.
|
|
Updated
Live GB10 (
|
|
Thank you, @GrgaPalcic. All 26 retained entries now have live contracts, plan1 checks all five outputs, the DFly2 export list is reduced to six, and KV/RoPE is not yet byte-equivalent to the established BF16 path. Negative cache sentinels are dereferenced. DFly2 rejects valid physical block zero. Several vector launchers floor unsupported dimensions. After these changes, rerun
|
|
Updated
Verification receipts
|
d7fe3a4 to
a549594
Compare
|
Thanks @GrgaPalcic. The exact KV/RoPE comparisons, negative-slot guards, physical block-zero case, vector remainder checks, full retained-kernel coverage, six-entry DFly2 scope, and ZONOS3 cleanup are all present in the final source. I found no new source defect. The remaining step is final CUDA contract qualification on the exact final head. Please run the route, rows, and DFly2 contract filters with all 26 kernels through gates 1-4, every planted control red, the exact/sentinel/block-zero checks passing, and zero limit problems. No serving checkpoint run applies to this kernel-only slice. We will also run our own device cells for it in its train once the 1.3.6 release is out.
|
|
Completed final CUDA contract qualification on the exact rebased head
All 26 kernels pass Gates 1–4 (including exact KV/RoPE byte-equality against |
|
Thank you @GrgaPalcic. The exact KV/RoPE comparisons against the established MLA kernels, all three negative-slot guards and their untouched-cache checks, physical block zero, launcher remainder rejection, full retained-kernel coverage, and ZONOS3 cleanup are present on I found no new source defect. Your exact-head GB10 results complete the focused qualification for route, rows, and DFly2: all 26 kernels through Gates 1–4, all 15 planted controls red, and zero limit problems. This is ready to land and goes into the next trains. Our train cells will retain the three focused contract filters. No serving checkpoint run applies to this kernel-only slice because it adds no serving-model caller or default path.
|
a549594 to
8742f99
Compare
…tracts, and 5-SM limits
…ontracts, and protect ZONOS3 cleanup
…ow block 0, check vector remainders
8742f99 to
a5cbf61
Compare
What this changes
Adds the Hy4-flash bitonic Top-16 router (
hy4_route), BF16 TP row helpers (hy4_rows), and DFly2 drafter glue (hy4_dfly2_glue) CUDA kernels, host-compilable launchers, contract gates, 14 planted controls, and 5-SM launch limits insidezig/src/families/hy4_flash/andzig/kernels/cuda/hy4_flash/:zig/kernels/cuda/hy4_flash/route.cuh+route.cu(hy4_route): multi-warp bitonic Top-16 sigmoid router (tf_hy4_route_m4,tf_hy4_route_m4_plan1) reusing../common/glue_math.cuh, bit-exact againsttf_moe_topk_sigmoid_score_warpon all served shapes and tie-breaking cases.zig/kernels/cuda/hy4_flash/rows.cuh+rows.cu(hy4_rows): 18 production kernels for wide/narrow BF16 row matmuls (hy4_rows_wide,hy4_rows_narrow), lowest-id argmax (hy4_rows_argmax), TP slice/interleave/SwiGLU/splicing helpers, exact BF16 KV cache writers (contiguous and paged — strictly BF16 KV only), Q RoPE / 3D M-RoPE, and ViT patch helpers, reusing../common/cp_async.cuhand../common/vec.cuh.zig/kernels/cuda/hy4_flash/dfly2_glue.cuh+dfly2_glue.cu(hy4_dfly2_glue): 6 productions1+ helper kernels (hy4_dfly_dual_rmsnorm_cat_s1,hy4_dfly_fusion_gated_add_s1,hy4_dfly_sublayer_boundary_s1,hy4_dfly_extend_topk_k,hy4_dfly_pick_argmax,hy4_dfly_gather_hidden) reusing../common/vec.cuh.zig/kernels/cuda/contract_hy4_route_rows_controls.cuh(included fromcontract_controls_set.cu): 14 planted control kernels infatbin_contract_controls(zero control symbols in production fatbins).zig/src/families/hy4_flash/route_cuda.zig,rows_cuda.zig, anddfly2_glue_cuda.zig: host-compilable CUDA launchers, registered inzig/src/families/hy4_flash/host_tests.zigandzig/build/cuda.zig.zig/tests/cuda/contract_hy4_route.zig,contract_hy4_rows.zig,contract_hy4_argmax.zig,contract_hy4_sample_rows.zig, andcontract_hy4_route_rows.zig(registered incontract_family_sets.zigandcontract_limits.zig): full 5-gate CUDA contract coverage and all 14 planted controls.zig/src/core/contract/hy4_route_rows_records.zig(registered inregistry_joins.zig):nvcc 13.05-SM (sm_80, 86, 89, 120, 121) register/shared-memory/bound records (130 active SM records across 26 kernels).No served path, model load, or default is changed in this slice. Remaining work for #4795: paged absorbed MLA + fused iHC/HC CUDA kernel slices, served W8A16
TP=2/TP=4+DFly2CUDA Graphs with serial token-equality receipts (BF16 KV only), and CUDA SigLIP2--vision+ 3D M-RoPE.main(f36acccdd, independent of hy4_flash: FP8 Engram CUDA kernels, contract gates, controls, and 5-SM limits (slice 2b of #4795) #5087 and hy4_flash: paged sparse indexer CUDA kernels, contracts, controls, and 5-SM limits #5095); adds 1 commit (e0d71ce1d)atc overlap --json: shared CUDA kernel/contract registration files (cuda_kernels.zig,kernels.zig,cuda.zig,contract_controls_set.cu,contract_limits.zig,contract_family_sets.zig,registry_joins.zig) have expected list-append overlaps with open CUDA kernel PRs (including hy4_flash: FP8 Engram CUDA kernels, contract gates, controls, and 5-SM limits (slice 2b of #4795) #5087 and hy4_flash: paged sparse indexer CUDA kernels, contracts, controls, and 5-SM limits #5095); zero overlap on anyhy4_flashimplementation file.Checks on this head
e0d71ce1d1c34af097699d486566b2a24155bc49(basef36acccdd9bd0200080a1d143be01ea83eaa2438)python3 tools/zig/lean_check.py, on the base and on this head:164on base (f36acccdd, inherited),164on head (e0d71ce1d),0new (python3 tools/pr_check.py --base origin/main:0 error(s))python3 tools/zig/cuda_common_check.py:55 local copies, 0 violationspython3 tools/zig/cuda_fragment_check.py:2 fragments, 17 includes, 0 misses0.17.0,-Dfixed-cpu, Linux x86_64):zig build -Dfixed-cpu test-hy4-flash-host --summary all:51pass,0fail,0skip (exit0)zig build -Dfixed-cpu test-contract-images-host --summary all:6pass,0fail,0skip (exit0)zig build -Dfixed-cpu test-kernel-contract --summary all:328pass,0fail,0skip (exit0)zig build -Dfixed-cpu compile-cuda-tests: exit0zig fmt --check build.zig zig && git diff --check: exit0sm_121, CUDA13.0.88,nvcc 13.0, Zig0.17.0,-Dsm=80,86,89,120,121):zig build fatbins -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=80,86,89,120,121andzig build -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=80,86,89,120,121: exit0./zig-out/bin/tf-cuda-test kernel-contract hy4_route(exit0):(filtered) SUMMARY 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 2 controls: 2 red as planted, 0 missed; 0 limit problems./zig-out/bin/tf-cuda-test kernel-contract hy4_rows(exit0):(filtered) SUMMARY 5 kernels: 5 pass gates 1-4, 0 fail, 0 known findings; 12 controls: 12 red as planted, 0 missed; 0 limit problems./zig-out/bin/tf-cuda-test kernel-contract hy4_dfly2(exit0): all 6hy4_dfly2_gluelivesm_121launch limits pass (0 limit problems)./zig-out/bin/tf-cuda-test kernel-contract-limits zig-out/fatbin: all130(26 × 5)hy4_route/hy4_rows/hy4_dfly2_glue5-SM records reportedPASS ... (record current),0limit problemsReceipt
n/a — kernel-only CUDA slice with full 5-gate device contract and 5-SM launch-limit qualification; does not reach serving or change any model load/default.
sm_121, CUDA13.0.88) device contract & 5-SM fatbin limits (sm_80,86,89,120,121); macOS/Windows host builds covered by CIf36acccdd, heade0d71ce1d, Zig0.17.0, CUDA13.0.88(nvcc 13.0), NVIDIA GB10 (sm_121, Linux aarch64); targets officialtencent/Hy4-flash-FP8@003107fa248f5892064ab1c43af0a7003dd68c9bsm_121) CUDA contract + 5-SM (80,86,89,120,121) fatbin limit checks; did not run physical SM 80/86/89/120 GPUs (compiled and checked againstnvcc 13.0limits)tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: n/a (kernel-only slice; bit-exact router/row comparisons, float64 contract exactness, non-finite class preservation, 5-run byte-identical repeatability, shape bounds, FP32 sum discrimination, and 14/14 red planted controls verified live onsm_121)tools/bench_openai.py: n/a (kernel-only slice)Checklist