Repository navigation
glm cuda: EXL3 mcg experts at any whole-bit width, mixed by projection - #2094
Conversation
|
The #2031 native Linux sweep on main Since this PR updates the same fixture, could you account for that field when bringing it onto current main? Draft CI-coverage PR #2095 keeps this check included and records the compile failure as a prerequisite. Its paired explicit-step/aggregate runs reproduce the same failure. I've kept the EXL3 fixture repair with this work rather than adding a competing patch. |
|
Thanks @MiaAI-Lab, the host side reads well: widths come from the trellis shape, admission still refuses by name, and the real-layer float64 check has its own planted control. To land it on the terms we set on #2093, a few things are still owed:
On our side, we'll check on our GB10s that the pinned 4-bit checkpoint's replies equal main's, with decode level. |
|
@MiaAI-Lab, a small one beside this PR's admission, in a file it doesn't touch. On main The fix is |
|
Thanks @Bizuayeu, that's right on today's main: |
|
Thanks @MiaAI-Lab for the width-mixed work, and @ashhart for keeping the list of what's open here. I said on #2031 that I'd coordinate the Verified outcome
Receipt Head
The change belongs in this pull request, since it already edits that file, so I won't open a separate one on it. If you'd rather I took it, say so here. Not run: the rest of this pull request's checks, including Linux, Windows, GPU and checkpoint runs. This covers only that host check, and nothing else on @ashhart's list. |
|
Thanks @MiaAI-Lab, and @jishnuvenugopal for measuring the |
|
@MiaAI-Lab, we've rebased this onto today's main as our branch
|
|
Thanks @MiaAI-Lab. This is now rebased onto current main (head A GB10 run of the 4-bit default and the new widths is next on our side.
|
|
Thank you @MiaAI-Lab. Your four commits stay credited, we will rebase them onto current main again since main has moved, and the k6 kernels now sit on main's prompt kernels with the width as a template argument. There is nothing further we need from you here. We will run the GB10 check on the 4-bit default and the new widths, and measure the k6 contract records on the new interface, before this lands.
|
|
Thanks @MiaAI-Lab. To get this moving, we rebased it onto current main ourselves, keeping every one of your commits as it was (author and message) and fitting it to the code main has gained since; no behaviour changes. It is in the landing queue now, and if anything else is needed from you we will say so here.
|
Move the two ashhart#2094 command descriptions into main_usage.zig, the help owner main extracted from the CUDA runner. Preserve every existing main row and its order; keep the contributor command descriptions unchanged.
|
I trial-merged With Zig 0.17.0 on M5 Max, Igor Lessio - AIFLOW LABS |
Move the two ashhart#2094 command descriptions into main_usage.zig, the help owner main extracted from the CUDA runner. Preserve every existing main row and its order; keep the contributor command descriptions unchanged.
Move the two ashhart#2094 command descriptions into main_usage.zig, the help owner main extracted from the CUDA runner. Preserve every existing main row and its order; keep the contributor command descriptions unchanged.
Admission reads EXL3 mcg checkpoints at 1 to 8 bits: "bits" may be absent (a mixed checkpoint gives "avg_bits"), and a given one must lie in range. The loader takes each trellis's width from its last dimension, slices TP shares by that width's tile bytes, places each expert's trellis at its own offset and uploads a width table a projection (one table, as before, when the three agree). Layer gets uniform_k2_gu and uniform_k2_d; uniform_k2 stays nonzero only when every projection agrees, so a 4-bit layer uploads upstream's bytes and keeps the prompt kernels. Scratch is sized by the path each layer takes: the prompt kernels' when they take it, else the grouped path's, the buffers taking the largest over every layer and the MTP layer (a mixed layer's prompt chunks run grouped).
glm-exl3 runs Mia-AiLab's 4-bit experts, 3-bit gate and up over 4-bit down, and 2/3/4-bit gate/up/down, each projection on its own width table, decode and prompt chunks (1030 rows, two calls) against float64, rows as alone, NaN kept to its row. glm-exl3-layer <ckpt> <layer> <rank> <world> loads one checkpoint layer through cuda_exl3.load at a rank's TP share and runs it (decode windows and a prompt chunk) against float64 matrices decoded from the whole trellises (core's unpack, cut, rotated, scaled), with a planted control (gate and up swapped) that must fail the same tolerance.
… by projection group tf_exl3_prompt_gu_k6 and tf_exl3_prompt_down_k6 run the transposed prompt kernels on 96-byte (3-bit) mcg tiles, with tf_exl3_prompt_gu/_down's arguments. The kernels are templated on the half-bit width; the 4-bit entry points keep their SASS byte for byte on sm_80/86/89/120/121 (nvcc 13.3). The down kernel reads its item in the kernel itself so that its launch bound still limits the thread arithmetic. Layer gains uniform_k2_gu and uniform_k2_d (the loader's per-group verified widths, uniform_k2 when zero). The prompt path takes a layer whose gate/up width and down width are each 6 or 8 and launches each group's own kernel; widths that disagree with uniform_k2 stay unverified and keep the grouped path. Scratch is width-independent. Contract: both launches registered pending nvcc 13.0's receipts, with nvcc 13.3's five-SM usage measured by kernel-contract-limits.
tf-cuda-test exl3-prompt-k6 [DIR|none] [BASE]: one synthetic GLM layer (4096 x 1024 per rank, 288 experts, top-8) at every gate/up and down width pair through the prompt kernels against runSlots and against float64 (glm_exl3_tests' tolerance) at 1, 64, 1000 and 4096 rows; a row's bytes in one call, in 1024-row calls and with a rotation a pick; BASE, an earlier exl3_experts fatbin, must give the 4-bit kernels' bytes; then one layer's time. DIR adds layer 4 of a GLMQ checkpoint (rank 0 of 2) the same way.
The prompt output is also measured against the float64 reference with gate and up swapped, as glm-exl3-layer does, and that must fail the same tolerance, so the check is shown able to go red at GLM's shapes. Co-authored-by: MiaAI-Lab <83042094+MiaAI-Lab@users.noreply.github.com>
Co-authored-by: MiaAI-Lab <83042094+MiaAI-Lab@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…mage Main's Kernels.load now takes whether to load block 32's image (a csf0_v1 checkpoint alone); an EXL3 checkpoint passes false, as glm-exl3 does. Co-authored-by: MiaAI-Lab <83042094+MiaAI-Lab@users.noreply.github.com>
…within 600 lines On today's main the new refusal and runner entries put both files past 600 lines. TooManyRanks' message is one line now (the same text), glm-exl3-layer is imported where the runner dispatches it, as exl3-prompt-k6 is, and exl3-prompt-k6's usage entry is one line. Co-authored-by: MiaAI-Lab <83042094+MiaAI-Lab@users.noreply.github.com>
…-id ABI ashhart#2819's direct-slot routing landed after lead/pr2094 was rebased: the prompt kernels take a trailing `int skip`, return for the shared expert before reading any payload, and down writes y[row][slot] straight into the caller's buffer (no staged y). The 3-bit kernels still had the old staged form. This ports them: - exl3_experts.cu: prompt_gu<K2> and prompt_down<K2> are main's 4-bit kernel bodies, unchanged but for the K2 template argument; the 4-bit and 3-bit entry points each call one with main's arguments. The source guard checks the templates and that each entry point only forwards. - The 3-bit records join main's pending prompt records: they were measured for the old ABI, so none is claimed until 13.0 and 13.3 receipts exist. exl3_prompt_records.zig and its 13.3 overrides go. - GLM's prompt scratch is main's (one whole pass, top_k + 1 slots); the scratch test, the k6 device test (caller-owned y, no skip), the dispatch test's run() call and glm-exl3-layer's experts load follow main. - glm-exl3 compares direct bytes to the compact reference only for widths the prompt kernels take; the reference reads each projection's width. - The runner's one-GPU EXL3 commands move to exl3_commands.zig so main.zig stays within 600 lines. Co-authored-by: MiaAI-Lab <83042094+MiaAI-Lab@users.noreply.github.com>
Move the two ashhart#2094 command descriptions into main_usage.zig, the help owner main extracted from the CUDA runner. Preserve every existing main row and its order; keep the contributor command descriptions unchanged.
Move the two #2094 command descriptions into main_usage.zig, the help owner main extracted from the CUDA runner. Preserve every existing main row and its order; keep the contributor command descriptions unchanged.
|
Thank you @MiaAI-Lab. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
Refs #2093.
GLM's CUDA family admits only 4-bit EXL3
mcgrouted experts; anything else iserror.NotExl3Mcg4. This takes each tensor's half-bit width from its trellis shape (whole bits 1..8, mixed per projection inside one layer), templates the decode and prompt expert kernels on it, and keeps the 4-bit path exactly today's: the upstream 4-bit loader runs verbatim in a test and must upload equal bytes; the 4-bit entry points keep their SASS at nvcc 13.3.Four commits, one concern each:
glm cuda: EXL3 mcg experts at any whole-bit width, mixed by projection- admission keeps the codebook check and verifies each width's range; the loader reads widths from the trellises and holds them per projection; scratch stays width-independent.tests: GLM EXL3 at mixed widths, synthetic and a checkpoint's own layers- synthetic mixed-width rigs andglm-exl3-layer, one real checkpoint layer's experts against float64 unpacks.exl3 cuda: the common prompt kernels take 3-bit mcg gate/up and down, by projection group-tf_exl3_prompt_gu_k6/tf_exl3_prompt_down_k6; contract records with 13.0 receipts pending and 13.3's measured usage.tests: exl3-prompt-k6, the 3- and 4-bit prompt kernels at GLM's shapes- the k6 pair against the 4-bit pair's references, edges and shapes.Gates so far (host, no GPU claims):
zig build installgreen with-Dnvcc -Dsm=80,86,89,120,121(nvcc 13.3.1, Zig 0.17.0 per.zig-version);test-cuda-host4705/4708 with 2 fails indrama_voice_tool.zig, untouched by this branch (pre-exist onmain's tree here);tools/zig/lean_check.pyzero findings overmain's baseline count;zig fmtclean. Kernel-contract and per-SM launch receipts on sm_120 hardware post below when the run completes; the 3-bit launches' 13.0 resources stay pending records per the registry's convention, 13.3 measured.Metal, XPU, other codebooks and other families: untouched.