Repository navigation
Conversation
…, MLA, iHC, Engram, indexer kernels, DFly2 drafter, host tests)
…eed work; compressed indexer past 2,048 keys - Serving: the lane host with one stream, 512-row prompt chunks, DFly2 verify windows of up to six rows drawn on the host with the stream's sampler, the last stream's caches reused for a prompt that starts with their tokens, and every buffer in one residency set. Hy4's :opensource marker tokens read as the GLM spellings the server already parses. - Long context: past 2,048 keys each sparse layer recalls its 511 best closed four-token groups plus its own (the reference's compressed indexer); token keys cached each pass, touched groups re-pooled in fp32. An fp64 check of the recall matches at 6K, and 6K-token NLL equals full attention. - Decode: IHC collapse and seams over threadgroups, row and tensor projections, decode GEMVs for 1-2 rows, expert pair GEMVs, split-key decode attention, rank-based router select, 512-row prompt chunks. - Probe: tf-hy4-speed (greedy ids and their hash, ms a token, per-stage GPU profile, NLL over a text).
…e and a resumed prompt equals a fresh one Every pass takes the kernels a prompt chunk takes, so a row's bits never depend on how many rows share its pass: - dense projections on the tensor units' lane projection at every row count (no 1-2 row GEMVs); - routed experts on the tensor gathers at every row count (no pair GEMVs); - MLA absorb and expand on the BF16 copies at every row count (no 1-row GEMVs over kv_b's codes); - flash attention unsplit (a split count from the pass's widest row changed the other rows' sums); - a pass across 2,048 keys attends its earlier rows over their whole range, as any other pass would, and only its later rows over the recalled lists. Greedy tokens on the probe's prompts: plain, DFly2 (4 rows) and prompt chunks of 1, 37 and 512 rows give the same ids at 4- and 8-bit, at short context, at 3,000 tokens and across the 2,048-key boundary.
…asses of 8 rows or fewer, and 8-bit codes reach the tensor units through registers - Small passes skip the sums dispatch and its barrier: each split adds its (group, row) sums up front with the sums pass's own loop, one chain a lane, so the words are the same. - 8-bit layouts take the reg path: the codes in the 4-bit reg order a byte each, unpacked as fp16 integers into the tensor op's right input; the same words as the 8-bit tensor layout. Same greedy tokens as before at 4- and 8-bit (plain, DFly2, 512-row chunks). 4-bit one row 17.19 -> 16.54 ms, four rows 22.97 -> 22.45; 8-bit one row 24.13 -> 22.36 ms, four rows 34.75 -> 33.15, 512 rows 305 ms.
…vironment.zig, no dead decode paths, files under 600 lines - TF_HY4_ENGRAM (nvme, ram or gpu) and TF_HY4_DRAFT_BITS (4, 8 or 16) are read through the environment module. - The 1-2 row dense GEMVs, the expert pair and group GEMVs, the 1-row MLA GEMVs over kv_b's codes and their kernels go, with the diagnostic switches that chose them; every pass already took the prompt chunks' kernels. - The speed probe leaves the tree; Linears, Rows and Scratch move out of metal_dense.zig, residency and drafting out of serve_metal.zig, and the Hy4 marker spellings out of hf_text.zig into hf_hy4.zig (with a test).
…UDA serving pins take the Hy4-flash images - The family files import core/row_projection.zig, lane_projection.zig and moe_route.zig by path; the re-export modules made tensorfold.zig the root of a second module in the Metal runtime source tests. - gradient-serving.tsv: kernels.zig with the Hy4-flash fatbin images registered and root.zig with cuda.affine_experts exported, as earlier families' registrations were recorded.
…ver TF_HY4_ENGRAM and TF_HY4_DRAFT_BITS
rows.metal calls the wide core's tf_rp_rows; before the M5, Rows.load paired it with the legacy core, whose tf_rp_rows takes one template argument fewer, so the library failed to compile there. The wide core is plain Metal (the M5 only prefers it for speed), and on the M5 the compiled text is unchanged.
Owner
Author
|
Conflicts with main (main moved after stacking); restacking. |
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: #3941 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.