Repository navigation
hy4_flash: paged sparse indexer CUDA kernels, contracts, controls, and 5-SM limits - #5095
GrgaPalcic wants to merge 9 commits into
Conversation
|
Thank you, @GrgaPalcic. The separate image keeps the current serving paths unchanged, and this head merges cleanly. The reported ten cases, 41 controls and 73 resource checks are useful; the existing pool/score byte comparisons and selection oracle are retained. One coverage change is needed at
|
|
Updated
Live GB10 (
|
|
Thank you, @GrgaPalcic. The new paged numerical set now exercises all six One selection issue remains. In The new oracle repeats the same expansion at After that correction, the focused qualification is
|
|
Updated
Verification receipts
|
8f5f1d8 to
b99895c
Compare
|
Thanks, @GrgaPalcic. The updated head addresses the earlier review asks. All six paged entries have nonidentity-page numerical contracts and wrong-page controls; ZONOS3 cleanup has its failure regression; and both selection paths now clamp the current group at the row position. The updated causal oracle would catch the old future-token expansion in both one-CTA and scan/merge paths. My recheck verdict is CHANGES because I found two new correctness issues:
Two integration/test changes also remain:
After those corrections, the focused GB10/sm_121 qualification is This was a read-only static recheck; I did not run builds, tests, shaders, or devices.
|
|
Updated
Live GB10 (
|
|
Thank you @GrgaPalcic. This head closes every remaining ask: negative NaNs canonicalize above infinity across every selection path, Current-main registrations and cleanup are preserved, the registry pin matches, and the select resource records are refreshed. I found no new source defect. Your exact-head GB10 receipt completes the focused qualification. This is ready to land and goes into the next trains. No serving checkpoint run applies to this kernel-only slice.
|
d5146c4 to
aaee2bb
Compare
… and kernels.zig pin
…score, add pool-to-score and n=193 cases
…_scan, and select_merge
Keep the existing sparse-attention set guarded when the following hy4_index_paged initialization refuses or fails.
aaee2bb to
01c412b
Compare
What this changes
Adds the paged sparse-indexer CUDA kernels, host-compilable launchers, contract gates, planted controls, and 5-SM launch limits for
tencent/Hy4-flash-FP8insidezig/src/families/hy4_flash/andzig/kernels/cuda/hy4_flash/(distincthy4_index_pagedfatbin, zero collision withhy4_indexpoolorhy4_index_recall):zig/kernels/cuda/hy4_flash/index_paged_common.cuh,index_paged_pool.cuh,index_paged_score.cuh,index_paged_select.cuh, andindex_paged.cu: production kernels covering RoPE table fill, paged K mean-pooling (1cta,small,persist), index query M-RoPE, tensor-core paged index scoring (decode,decode_rope,prefillvia../common/qmm_frag.cuh), and deterministic Top-K selection (1cta,scan,merge). Zero planted control symbols in the production fatbin.zig/kernels/cuda/contract_hy4_index_paged_controls.cuh(included fromcontract_controls_set.cu): 41 planted control kernels infatbin_contract_controlscovering non-finite drops, repeat mutation/drift, tail skips, tie-breaking regressions, and reduced-precision (fp16) accumulation.zig/src/families/hy4_flash/index_paged_cuda.zig: host-compilable CUDA launchers (Ops, paged pool/score/select/RoPE entrypoints + geometry unit tests), registered inzig/src/families/hy4_flash/host_tests.zigandzig/build/cuda.zig.zig/tests/cuda/contract_hy4_index_paged.zig,contract_hy4_index_paged_pool.zig,contract_hy4_index_paged_score.zig,contract_hy4_index_paged_select.zig(registered incontract_family_sets.zigandcontract_limits.zig): full 5-gate CUDA contract coverage across all 10 production kernels and all 41 planted controls.zig/src/core/contract/hy4_index_paged_records.zig(registered inregistry_joins.zig):nvcc 13.05-SM (sm_80, 86, 89, 120, 121) register/shared-memory/bound records (73 active SM records;pool_small_pagedandpool_persist_pagedmarkedmin_sm = 120).No served path, model load, or default is changed in this slice. Remaining work for #4795: paged absorbed MLA + fused iHC/HC, router/rows/DFly2 glue CUDA kernel slices, served W8A16
TP=2/TP=4+DFly2CUDA Graphs with serial token-equality receipts, and CUDA SigLIP2--vision+ 3D M-RoPE.main(12535c348, after hy4_flash: host W8A16 FP8 weight map, TP=1/2/4 partition, and Engram FP8 row format (slice 1 of #4795) #4827, hy4_flash: W8A16 CUDA weight packing for qmmf projections and TP=1/2/4 FP8 experts (slice 2a of #4795) #4895, and hy4_flash: host vision config, patchify, bilinear taps, and 3D M-RoPE layout (slice 4a of #4795) #5022 merged; independent of hy4_flash: FP8 Engram CUDA kernels, contract gates, controls, and 5-SM limits (slice 2b of #4795) #5087); adds 1 commit (852ab8119)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); zero overlap on anyhy4_flashimplementation file.Checks on this head
852ab8119aad84cb8d629667e10607d7b60eebe9(base12535c348897e1fef942310bbf930ccbb3b4d864)python3 tools/zig/lean_check.py, on the base and on this head:164on base (12535c348, inherited),164on head (852ab8119),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:315pass,0fail,0skip (exit0)zig 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_index_paged(exit0):(filtered) SUMMARY 10 kernels: 10 pass gates 1-4, 0 fail, 0 known findings; 41 controls: 41 red as planted, 0 missed; 0 limit problems; gates 439 ms, limits 7 ms./zig-out/bin/tf-cuda-test kernel-contract-limits zig-out/fatbin: all73activehy4_index_paged5-SM records reportedPASS ... (record current),0hy4_index_pagedlimit 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 CI12535c348, head852ab8119, 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; float64 contract exactness, non-finite class preservation, 5-run byte-identical repeatability, shape bounds, FP32 sum discrimination, and 41/41 red planted controls verified live onsm_121)tools/bench_openai.py: n/a (kernel-only slice)Checklist