Repository navigation
Conversation
exl3_weights reads split mul1 experts (trellis/suh/svh/mul1) and rejects affine or mixed markers; moe_exl3_cuda runs them on the shared EXL3 kernels with Hy4's sigmoid router, correction bias, top-16 and scaled combine. bf16_rows gathers 192-byte Engram rows with aligned O_DIRECT reads and a prefetch worker (Linux host tests). mla_weights exposes splitBf16.
tf_hy4_index_groups pools a closed group's four token keys through the FP32 value/gate projections with intra_group_ape, then key_norm. index_cuda caches token keys, pools and rotates closed groups, and scores and recalls with the draft's rotate and recall kernels. Against an FP64 oracle on layer 1 over 2,304 keys: recall of 511 of 575 groups identical on 4/4 rows, scores 6.2e-4 relative L2, draft rollback byte-exact.
hy4_engram mirrors engram.metal's rounding: lookup (optional stock FP8 round trip, per-head RMSNorm) and apply (key/query norms, signed-sqrt gate, per-stream scales), with the reference nn.RMSNorm epsilon (2^-23). On real layer-1 rows: strict BF16 4.9e-3 and stock FP8 4.3e-3 relative L2 vs the torch reference.
cuda_model loads the BF16 trunk and 512 mul1 experts per sparse layer (slab uploads, per-layer page release, TF_HY4_MEM_FLOOR_GIB guard) and runs embedding, four streams, 42 layers, hyper head and LM head on one sequence: causal keys to 2,048, the 512-key window on sliding layers. tf-hy4-cuda-generate prefills and decodes greedily. LibertAIDAI Hy4-flash-EXL3-4bpw on GB10: 85.38 GiB, 34-token prefill 884 ms, 98.6 ms/token; all 32 greedy tokens equal ExLlamaV3's.
openDirect took whatever row count the shard's header declared and rowOffset bounds-checked against it, so a table read for the wrong layer, or one repacked or truncated by another tool, loaded cleanly. The four released tables hold 164,994,380 / 164,999,008 / 165,004,086 / 165,008,942 rows: a wrong shard stays inside the count for almost every lookup and addresses rows silently, which is audible only as a small quality loss. The Metal path already derives the count from the config (engram_rows.zig, weights.zig); this gives the CUDA reader the same rule, as RowCountMismatch at load rather than BadTable mid-forward. The test fails with TestUnexpectedResult without the check (26 pass, 1 fail) and passes with it.
Owner
Author
|
Closing this CI-only train PR: it was stacked on an older main (or its riders have landed). A fresh train restacks on today's main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI for a landing train: #4259 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.