Repository navigation
Conversation
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 #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 #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.
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: #2094 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.