Skip to content

feat: read EXL3 checkpoints on CUDA (any codebook, 1 to 8 bits, mixed-K packs) - #42

Closed
vcruz305 wants to merge 8 commits into
ashhart:mainfrom
vcruz305:pr/exl3
Closed

vcruz305 wants to merge 8 commits into
ashhart:mainfrom
vcruz305:pr/exl3

Conversation

@vcruz305

@vcruz305 vcruz305 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

TensorFold's CUDA engines can now read ExLlamaV3's trellis checkpoints (EXL3) in any linear, at whatever width the checkpoint keeps per tensor, with one kernel shared by every family. Two engines use it in this PR: Qwen3.8-27B (2 to 6 bits, mul1) and Qwen3.8 Flash Next, including mixed-K packs where one expert matrix sits at 2 bits and the next at 8.

The real checkpoints I have on this box are the 27B at 3.00bpw and 4.00bpw, Flash Next's mixed-K SAGE pack and turboderp's 3.05bpw, and MiMo-V2.6-Flash's 2.50bpw. mcg and 3inst are verified bit-exact against ExLlamaV3's reconstruct on real converter output, 50 of 50 groups each, from partial packs. Their full-pack conversions were still running while I wrote this, so beyond that specific check the two codebooks rest on synthetic data, and I say so below rather than leaving it to be discovered.

Speeds on one DGX Spark, greedy, same client for both engines. The 27B 3.00bpw pack with the DFlash2 drafter decodes at 63.2 / 45.7 tok/s (code / chat) against ExLlamaV3's 39.6 / 30.1 on the same pack and drafter. Flash Next's SAGE pack reads 47.3 / 67.3 against ExLlamaV3's serial path at 22.3 / 22.2. Drafted replies are identical to "draft": false replies by token-id SHA-256 on both families, 30 of 30 replies each. That is the check I ran the most times, because it is the one the engine's contract stands on.

Nothing here changes an existing path. GLM-5.3-Flash's own EXL3 kernel is untouched and the MLX 4-bit engines of both families are unchanged. The diff is 49 files, +5,673 / -37, 8 commits, no merge commits, based on bb4b4a3.

What is in it, commit by commit:

  • 28ef5a4, the format, for every codebook and width. src/tensorfold/cuda/exl3/format.py parses a checkpoint's tensor groups out of the safetensors headers alone (trellis int16 [K/16, N/16, 16*bits], suh/svh or the packed su/sv signs, an optional bias, and the zero-size mcg / mul1 marker), names the codebook and the width per tensor, and carries a NumPy float64 reference decoder for every codebook at 1 to 8 bits plus the half widths (mul1). decode.cuh holds the header-only device functions that decode a 16x16 tile straight into the B fragments of two mma.m16n8k16. python -m tensorfold.cuda.exl3.inspect MODEL_DIR prints what a checkpoint holds from its headers without loading it. A family that reads every codebook and width declares EXL3_VARIANT = "any", and TensorFold then checks config.json before anything is downloaded (src/tensorfold/families/__init__.py). pyproject.toml gains the new *.cu / *.cuh package data. Tests: tests/test_exl3_format.py (a bit-by-bit decoder for all 27 codebook and width combinations, the group parsing, the inspector on a synthetic mixed checkpoint) and tests/test_unsupported_checkpoints.py (the refusals). Nothing in this commit imports torch.
  • 2be548d, a row-invariant EXL3 linear, 1 to 128 rows. src/tensorfold/cuda/exl3/linear.{py,cu,cpp}: y = ((((x * suh) @ H_K) @ W_q) @ H_N) * svh + bias, no cuBLAS, no split-K that depends on the row count, no reduction across rows. The K split and the warps a program uses are a function of (K, N) only, the splits are summed in split order, and mma.m16n8k16 keeps rows independent, which is the CUDA recipe's verify contract. tools/bench_exl3.py times it against ExLlamaV3's LinearEXL3.bc.run on a checkpoint's own tensors, with CUDA graphs over enough copies to exceed L2. Tests: tests/cuda/test_exl3_linear.py (row invariance at 1, 2, 3, 16, 17, 64 and 128 rows, the device decoder against the reference bit for bit, a float64 reference, ExLlamaV3 when it is importable) and tests/cuda/test_exl3_checkpoint.py (a real checkpoint's every width against reconstruct).
  • b16f2db, the low-bit loader. At 1 and 2 bits a lane's windows span two 32-bit words, so a warp now loads its k step's words as one coalesced run, takes each tile's two words from their owners by shuffle, and keeps the next k step in flight while the current one decodes. That holds up to 6 bits; at 7 and 8 bits it measured 1 to 2% slower, so those widths load per tile. Same arithmetic in the same order: 2472 outputs over every codebook, width, split and row count are torch.equal to the kernel before this commit.
  • 1703060, grouped routed experts, mixed widths inside a layer. src/tensorfold/cuda/exl3/experts_{grouped.cuh,cu,cpp,cb0.cu,cb1.cu,cb2.cu} and experts.py: one grouped trellis GEMV per projection runs a whole MoE layer in one launch, each expert matrix at its own width (1 to 8 bits in half-bit steps) in any codebook. The codebook is the compilation unit, the widths present in a layer are the instances built, the trellis stays where the checkpoint put it (an expert is a pointer), the grouping happens on the device, and there are no atomics or host synchronisations, so a CUDA graph can capture the pipeline. tests/cuda/test_exl3_experts.py runs the decode against a bit-by-bit decoder and against ExLlamaV3's reconstruct, rows alone against the same rows in windows of 1, 2, 3, 16, 17, 64 and 128, a float64 reference, graph replay against eager after allocator churn, and the fused down+combine against the two launches it replaces.
  • ad19d4a, "return_token_ids" on the CUDA server (src/tensorfold/cuda/server.py, 6 lines). The reply's token ids ride in the response's tensorfold block, and in the final chunk with stream_options.include_tensorfold when streaming. That is how drafted == serial gets checked through the OpenAI path. Nothing changes for a request that does not ask for it.
  • 4b95136, Qwen3.8-27B on EXL3. src/tensorfold/families/qwen3_5/cuda/exl3_load.py fills the same Config/Layer/Weights dataclasses the MLX path fills. The pack's trellis groups run on the shared linear, tensors the pack leaves alone are read as stored, the packs' centred RMSNorm weights (w - 1) get their 1 back, and exl3_load.PLANS holds the measured (K split, warps) per projection shape at 3 and 4 bits, a function of shape and width alone, so a verify window keeps one reduction. cuda/b16.{cu,cpp,py} is the plain fp16/bf16 linear for the unquantized tensors (one warp per output, no cuBLAS). cuda/dflash2.py lets the DFlash2 drafter read the target's 6-bit head over its draft vocabulary by slicing the head's 128-column strips as stored, so the drafter's logits are the target head's bit for bit and nothing is decoded or requantized. tests/cuda/test_qwen27_exl3.py checks that every tuned split keeps a row's bits, a GDN verify window against serial steps on both weight paths, that drafted decoding keeps serial's tokens, and the sliced head against the target head.
  • f836a4b, Qwen3.8 Flash Next on EXL3. src/tensorfold/families/qwen4_exp/cuda/exl3.py (718 lines) fills the same weight structures: dense groups (attention, DeltaNet, MTP, head) on the shared linear with same-input projections stacked side by side, routed experts and the shared expert (as expert 512 of the table) on the grouped kernel at their own widths, the packs' unquantized tensors on an fp16 Triton matmul whose tiles and K split depend on the shape only, and the ple.ngram_embedding shards through ExLlamaV3's n-gram row codec, where a row is an fp16 scale and 160 tail-biting mul1 values, decoded bit for bit like ngram_dequant. MTP drafts decode the head's draft-vocabulary rows and requantize them to 4-bit groups for the draft head; verification uses the full EXL3 head. tests/cuda/test_qwen4_exp_exl3.py checks the fp16 matmul against fp64 and its row invariance, the n-gram rows bit-equal to the row codec, a real layer's experts against fp64, and the model cut to 4 layers: a window of 1 to 128 rows gives one-row steps' logits bit for bit, a kept prefix continues like serial, and MTP-drafted decoding (eager and in CUDA graphs, greedy and sampled) emits serial's tokens.
  • d409822, docs and notices. docs/recipes/exl3.md (the format, what a family declares, the layer's arithmetic, the kernel table, the traps), docs/recipes/exl3-universal-experts.md (the grouped kernel and the measured comparison against ExLlamaV3's two dispatch paths), the EXL3 sections of docs/recipes/qwen3.8-27b.md and docs/recipes/qwen3.8-flash-next.md, docs/recipes/cuda.md, the two recipe lists, README.md, src/tensorfold/families/README.md, src/tensorfold/families/qwen3_5/cuda/README.md (its kernel table gains b16.cu and exl3_load.py), and THIRD_PARTY_NOTICES.md, where the existing ExLlamaV3 entry (MIT, Copyright (c) 2025 Turboderp) now covers the shared module, the grouped expert kernel and the two families' EXL3 readers, and the checkpoints the families list are named with their licenses. The README's speed table and the hero image that mirrors it are unchanged: this PR adds two rows to its checkpoint table (both EXL3 packs, NVIDIA only) and keeps the speeds in the two recipes.

Measured on a GB10 (DGX Spark)

One DGX Spark (GB10, driver 580.178.04, CUDA 13.0 through torch 2.11.0+cu130, 128 GB unified, SM clock 2405 to 2418 MHz of 3003 during the timing sessions). Every timing row comes from a gpurun timing session with the GPU otherwise idle and the page cache of each pack dropped before its server starts. The client is the same for every engine, tools/bench_openai.py --tokens 64 --reps 5 (one warm-up, seeds 1234-1238, greedy as temperature 0), and the cell is the median of the five. Each column names the commit its numbers came from. "ExLlamaV3" always means the fork at commit 249f22a, whose package reports 1.5.1.post1; the commit and the version string name the same tree.

The kernels, against ExLlamaV3's

Dense linear, tools/bench_exl3.py, medians of 9 CUDA-graph replays on an idle GB10, the checkpoint's own tensors, the ExLlamaV3 fork at 249f22a on the same tensors (4c37180; docs/recipes/exl3.md carries the same table):

tensor bits bytes rows TensorFold ExLlamaV3 GB/s ratio
MiMo layers.0.self_attn.q_proj 2 12.6 MB 1 57.0 us (221 GB/s) 59.0 us (213 GB/s) 1.04
MiMo layers.0.self_attn.q_proj 2 12.6 MB 16 60.0 us (210 GB/s) 65.9 us (191 GB/s) 1.10
MiMo layers.2.self_attn.o_proj 3 12.6 MB 1 72.9 us (173 GB/s) 73.0 us (172 GB/s) 1.01
MiMo layers.2.self_attn.o_proj 3 12.6 MB 16 68.4 us (184 GB/s) 63.5 us (198 GB/s) 0.93
MiMo layers.41.self_attn.o_proj 6 25.2 MB 1 114.0 us (221 GB/s) 113.5 us (222 GB/s) 1.00
MiMo layers.41.self_attn.o_proj 6 25.2 MB 16 123.7 us (203 GB/s) 116.0 us (217 GB/s) 0.94
MiMo lm_head 6 468.7 MB 1 2074.5 us (226 GB/s) 2071.8 us (226 GB/s) 1.00
MiMo lm_head 6 468.7 MB 16 2113.0 us (222 GB/s) 2045.8 us (229 GB/s) 0.97

The loader commit (b16f2db) measured against the commit before it, same harness, two exclusive slots, GB/s at 1 row: MiMo 2-bit q_proj 157 -> 220, 2-bit o_proj 76 -> 186, 2-bit down_proj 79 -> 193, 3-bit q_proj 158 -> 192, 5-bit q_proj 188 -> 218, 6-bit lm_head 227 -> 232; 27B 3.00bpw 3-bit down_proj 163 -> 194 (160 -> 187 at 8 rows, 153 -> 180 at 16), 4.00bpw 4-bit in_proj_qkv 196 -> 216. Nothing measured got slower, and the 6-bit head cells are within 1.5%. ExLlamaV3's own linear reads 176 to 233 GB/s on the same tensors in the same runs, and the 237 GB/s streaming ceiling of this box is the rest of the gap.

Grouped routed experts, MiMo-V2.6-Flash-RL-EXL3 2.50bpw real layers (mul1, per-expert 2 to 5 bits), tools/mimo_exl3_bench.py, medians of 5 reps x 30 iters x 2 sets, GB/s over the trellis bytes actually read (4c37180/f836a4b parents; docs/recipes/exl3-universal-experts.md has the same table with the intermediate row counts):

layer (expert widths) rows TensorFold TF + CUDA graph ExLlamaV3 exl3_moe_mixedk ExLlamaV3 exl3_moe_coop
L3 (2-bit everywhere) 1 179.6 GB/s 195.6 49.9 (3.6x slower) 177.8
8 219.6 222.0 77.8 (2.8x) 220.2
L30 (2-3 bit) 1 209.7 217.2 70.5 (3.0x) not dispatched
8 224.7 226.3 115.9 (1.9x)
L47 (2-4 bit) 1 204.2 209.2 86.7 (2.4x) not dispatched
8 210.3 213.5 140.0 (1.5x)

The part that matters for reading that table: MiMo's layers are mixed-K, so what ExLlamaV3 actually dispatches there is its per-expert exl3_moe_mixedk path, and this kernel is 1.5x to 3.6x faster per layer. Where a layer is uniform, ExLlamaV3 dispatches its coop kernel instead, and coop is still the faster of the two on this box. On the uniform L3 layer the two are within 2% (179.6 against 177.8 at 1 row, 219.6 against 220.2 at 8), and on the GLM-5.3-shaped synthetic 4-bit mcg layer coop reads 219 to 232 GB/s against 208 to 220 here. This work does not beat coop on uniform layers. It removes the mixed-K penalty and lands at coop's level rather than above it. The dense table says the same thing: ExLlamaV3 is ahead on the small-N 3-bit shapes at 16 rows (184 against 198 GB/s) and on the 6-bit 16-row cells (203 against 217, 222 against 229).

Qwen3.8-27B, EXL3 packs and the MLX 4-bit checkpoint

tensorfold serve, or ExLlamaV3's Generator behind a minimal OpenAI shim (-cs 8192), DFlash2 at its default 7 drafts. Dynamic draft length was slower on every column. Cells are code / chat, as the project's README table has them. Every number in this table comes from 4c37180 on wip/exl3-engines, measured before this branch existed, so treat it as this code's numbers rather than this branch's; a re-run on pr/exl3 is in flight and I will paste it in a comment. The 27B rows use turboderp/Qwen3.8-27B-exl3 revision 6fe61ad6 (3.00bpw) and 113cf7ab (4.00bpw), drafted with z-lab/Qwen3.8-27B-DFlash2.

GB/token Code, greedy Chat, greedy ExLlamaV3 code / chat, greedy ratio (ours / theirs)
TensorFold, EXL3 3.00bpw + DFlash2 10.14 63.2 45.7 39.6 / 30.1 1.60 / 1.52
TensorFold, EXL3 4.00bpw + DFlash2 13.18 52.1 45.3 35.8 / 25.7 1.46 / 1.76
TensorFold, MLX 4-bit + DFlash2 14.42 48.2 44.9 ExLlamaV3 does not serve it
TensorFold, EXL3 3.00bpw, serial 10.14 16.7 16.6 16.5 / 16.5 1.01 / 1.01
TensorFold, EXL3 4.00bpw, serial 13.18 14.5 14.4 15.8 / 15.8 0.92 / 0.91
TensorFold, MLX 4-bit, serial 14.42 12.8 12.8 ExLlamaV3 does not serve it
BF16 (reference, for the bandwidth floor) 51.25 n/a n/a n/a n/a

GB/token is the weight bytes one serial decode step reads (every linear, the head, one embedding row, the norms) at the bits per weight the engine actually holds. The bandwidth floor at the measured 237 GB/s streaming ceiling of this box is 23.4 tok/s at 3.00bpw and 18.0 at 4.00bpw, and the measured serial step is 16.7 and 14.5, so a step is 59.4 ms of wall time against a 42.8 ms floor. On the GPU that step is 57.8 ms, of which the EXL3 projections are 51.9 ms for 10.1 GB (194 GB/s) and the 6-bit head alone 238 GB/s. What is left is drafting: the tree verifies several rows a round, and the recipe's step profile plus the --no-drafts rows above is the bookkeeping behind it. Sampled columns are in docs/recipes/qwen3.8-27b.md; 3.00bpw code sampled is 82.1 (ours) against 45.0 (ExLlamaV3).

Quality, same eval set and engine, teacher-forced (~/tfwork/results/qwen27b-quality.md; wikitext-2 test, 16 x 1024-token windows, 16,368 scored positions, full 248,320-token vocabulary, fp64 sums):

checkpoint bits/weight body / head GB/token NLL dNLL vs BF16 top-1 vs BF16 mean KLD
BF16 (reference) 16 / 16 51.25 2.0328 0 1 0
EXL3 2.50bpw 2.517 / 6.00 8.62 2.0775 +0.0447 0.8759 0.0854
EXL3 3.00bpw 3.017 / 6.00 10.14 2.0430 +0.0102 0.9126 0.0431
EXL3 4.00bpw 4.016 / 6.00 13.18 2.0400 +0.0072 0.9534 0.0122
MLX 4-bit 4.501 / 4.50 14.42 2.0640 +0.0312 0.8975 0.0480
EXL3 5.00bpw 5.015 / 6.00 16.22 2.0361 +0.0033 0.9693 0.0042

The 3.00bpw pack beats the MLX 4-bit checkpoint on every measure here and is cheaper to read (KLD 0.0431 against 0.0480, 10.14 against 14.42 GB/token) even though the MLX pack is nominally wider. The arithmetic floor of this measurement is KLD 2.11e-04, because the engine returns bf16 logits. Brackets and the row-level caveats are in the file the table comes from.

Qwen3.8 Flash Next, both EXL3 packs

Cells are code / chat, greedy and sampled, median of seeds 1234-1238. Every number here comes from 5e76c85 on wip/flashnext-exl3, measured before this branch existed. ExLlamaV3 (249f22a) has no draft support for this model, so its column is its serial path.

pack engine Code, sampled Chat, sampled Code, greedy Chat, greedy
mixed-K SAGE 4.15bpw (2-8 bits) TensorFold, MTP drafts 58.2 52.0 47.3 67.3
TensorFold, serial 34.3 34.0 34.5 33.5
ExLlamaV3, serial 22.3 22.2 22.3 22.2
turboderp 3.05bpw TensorFold, MTP drafts 79.1 56.3 79.0 62.4
TensorFold, serial 34.9 34.9 35.1 35.0
ExLlamaV3, serial 37.0 36.9 37.1 36.9
MLX 4-bit (the existing path) TensorFold, MTP drafts 66.8 59.4 71.8 58.6
TensorFold, serial 36.8 36.7 37.0 36.8

Two things about that table. The SAGE pack's code prompt emits a real <think> block where the other packs and the chat prompt do not, so SAGE's drafted row is a much longer reply than its neighbours: the numbers are real, the comparison across packs is not, though SAGE's own serial against drafted pair is. And SAGE is a mixed-K pack of ours, so it is the one row here with no ExLlamaV3 counterpart for drafting at all.

Serially, on the mixed-K pack TensorFold is 1.51x to 1.55x ExLlamaV3's serial path, and on the uniform 3.05bpw pack it is 5 to 6% behind it (34.9 against 37.0). That pack is one ExLlamaV3 has tuned for, and it is the one place in this PR where ExLlamaV3's serial decode wins. Both EXL3 packs are also 5 to 9% behind TensorFold's own MLX 4-bit path in serial. With drafts, both packs beat ExLlamaV3's serial speed by 1.5x to 2.1x.

On the same packs, teacher-forced over 2,048 positions, the two engines' mean NLLs agree within 0.0005 (SAGE 1.0640 against 1.0642; 3.05bpw 0.8510 against 0.8506) and their top-1 accuracies within half a point (0.718 against 0.720; 0.774 against 0.779). The per-position NLL difference has a mean absolute value of about 0.10 and a median of 0.018 / 0.011, which sounds large next to the agreement figures, so here is the context: ExLlamaV3 reproduces its own top-1 on only 96.4% (SAGE) and 97.2% (3.05bpw) of positions when the same text is split differently, meaning the first 1,025 tokens on their own instead of as part of all 2,049. Where its top two logits are at least 0.5 apart the two engines agree on 98.8% / 99.1% of positions, and 99.7% at a gap of 1.0. Two engines that keep near-ties differently look like this.

Measured after this branch was frozen, and belonging to the follow-up PR rather than this one: the same 3.05bpw pack with TensorFold's newer default drafting policy (depth 6, confidence 0.6) reads 91.6 / 71.8 / 55.3 tok/s (code / devops / prose, 400 tokens, min-median-max of 3) against TabbyAPI on this box at 87.2 / 63.9 / 54.9, with serial at 36.0 to 36.1 and the best policy measured at 94.5 (depth 7, confidence 0.75). At 128 tokens it is 77.1 / 59.4 / 54.1 against 76.2 / 56.7 / 55.1, at 64 tokens 82.4 / 56.7 / 56.6 against 83.6 / 57.6 / 61.2, so prose is behind at very short replies. Time to first token is 0.14 to 0.18 s against 0.51 to 0.77 s. TabbyAPI runs the recipe's 8-bit KV where ours is bf16. Nothing on this box reached 100 tok/s in any arm: the best single request was 94.46 (TensorFold, code, 400 tokens), then exllamav3's 89.52 and the recipe's own chat.py at 80.04. Greedy replies diverge between the two engines inside the first 10% of the reply (first differing token: code 7 of 400, devops 48, prose 26). TensorFold's replies are identical across repeats, TabbyAPI's are not. Those numbers, the policy sweep and the changes behind them live in ~/tfwork/results/flashnext-recipe.md.

Tests

Host suite, no GPU, the same command and --ignore set on every tree:

PYTHONPATH=<tree>/src python -m pytest tests -q -p no:cacheprovider -rf \
  --ignore=tests/test_alternating_kv.py --ignore=tests/test_dflash_tree_search.py
  • upstream/main bb4b4a3: 4 failed, 130 passed, 27 skipped in a venv with no torch (~/tfwork/venv-notorch: numpy, tokenizers, jinja2, safetensors, huggingface_hub, pytest), and 4 failed, 130 passed, 27 skipped with torch present (~/tensorfold/venv, CUDA_VISIBLE_DEVICES=).
  • Every commit of this branch, 28ef5a4 through d409822, same command on the no-torch venv: 4 failed, 167 passed, 28 skipped, the same counts on all eight commits. d409822 on the torch venv: 4 failed, 168 passed, 27 skipped. The 27 against 28 skip difference between those two rows is the venv, where one MLX-only test skips rather than passes when torch is present, not the branch.
  • The same four failures appear on all three trees, all present on upstream/main, none of them ours: this box has no MLX (test_nucleus_without_top_k_matches_the_whole_vocabulary_draw imports mlx.core), the CLI refuses a model with no CUDA engine before the context check (test_context_override_cannot_exceed_model_window), and the other two import a family's MLX kernel package (test_every_family_names_an_importable_kernel_version, test_serve_finishes_a_config_only_cache_before_loading).
  • The two files that carry the new format's tests on the tip: tests/test_exl3_format.py 36 passed, 1 skipped (no-torch venv), and tests/test_unsupported_checkpoints.py 9 passed, against 8 on upstream/main.
  • Logs: ~/tfwork/scratch/p/host/summary.txt and ~/tfwork/scratch/p/host/notorch_<rev>.log.

CUDA tests, run from the installed wheel built at the tip with nothing on sys.path but the wheel. The tests are copied out of git archive d409822 with --rootdir outside the source tree, so a stale source tree cannot be what ran. One file per invocation, so each count stands on its own, with ninja on PATH and a fresh TORCH_EXTENSIONS_DIR:

TENSORFOLD_EXL3_MODEL=<MiMo-V2.6-Flash-RL-EXL3 2.50bpw> \
  python -m pytest -q tests/cuda/test_exl3_linear.py        # 56 passed
  python -m pytest -q tests/cuda/test_exl3_checkpoint.py    #  9 passed
  python -m pytest -q tests/cuda/test_exl3_experts.py       # 85 passed, 18 skipped
  python -m pytest -q tests/test_exl3_format.py             # 37 passed  (host, no GPU)
TENSORFOLD_QWEN27_EXL3=<qwen27b-exl3-3.00bpw> TENSORFOLD_QWEN27_DRAFTER=<z-lab/Qwen3.8-27B-DFlash2> \
  python -m pytest -q tests/cuda/test_qwen27_exl3.py        # 14 passed
TENSORFOLD_EXL3_FLASHNEXT=<flashnext-exl3-sage-4.15bpw> \
  python -m pytest -q tests/cuda/test_qwen4_exp_exl3.py     # 16 passed

The 18 skips in the expert file are the ExLlamaV3 comparison cells this ExLlamaV3 fork cannot instantiate: the half-integer widths only exist with mul1, and its reconstruct stops at 3.5. After the run the extension cache held six .so files for six extension directories, so every kernel this branch ships got built from this source inside the run.

One thing worth knowing about that first attempt: it failed with 187 errors, and the cause was environmental, not this branch. The JIT builds died because ninja was not on PATH, which left empty extension directories behind, and the next import of each of those found a directory with no .so. Those runs are not in the numbers above. If you build these tests yourself, put ninja on PATH and clear TORCH_EXTENSIONS_DIR first.

Per-commit evidence. Each commit checked out detached in its own worktree (~/tfwork/wt/p-commits) with its own TORCH_EXTENSIONS_DIR, because the two linear commits share the extension name tensorfold_exl3_linear_v2 and no commit should be served another's .so. Real packs named by the same environment variables.

commit what it is its own tests
28ef5a4 the format and the refusals 46 passed (tests/test_exl3_format.py + tests/test_unsupported_checkpoints.py)
2be548d the row-invariant linear 65 passed (tests/cuda/test_exl3_linear.py + test_exl3_checkpoint.py)
b16f2db the low-bit loader 65 passed (the same two files, on the changed kernel)
1703060 the grouped experts 85 passed, 18 skipped (tests/cuda/test_exl3_experts.py)
4b95136 Qwen3.8-27B on the tip: 14 passed (tests/cuda/test_qwen27_exl3.py, 66 s). The per-commit run got 8 passed and then hung in test_window_rows_equal_serial_steps, ten minutes asleep with the GPU idle, so it was killed and is not counted. Re-run afterwards at this commit with its own TORCH_EXTENSIONS_DIR: 35 s, passed. The hang was a build lock in the extension directory that eight commits shared
f836a4b Flash Next 16 passed (tests/cuda/test_qwen4_exp_exl3.py)
ad19d4a return_token_ids server imports and starts clean (9 skipped in that run; no GPU)
d409822 docs only 11 changed markdown files listed, package imports clean

Row invariance and exactness, as the recipe book asks (torch.equal, never allclose):

  • the dense linear at 1, 2, 3, 16, 17, 64 and 128 rows, every codebook and width, against the 1-row result (tests/cuda/test_exl3_linear.py);
  • the grouped experts at the same row counts and widths, plus a real MiMo layer's rows alone against an 8-row window (tests/cuda/test_exl3_experts.py);
  • both the linear and the expert kernels equal ExLlamaV3's reconstruct bit for bit;
  • the grouped pipeline is torch.equal to GLM-5.3-Flash's own exl3_mm.routed on 4-bit mcg data, GLM's arithmetic in the same order, and within 2e-4 relative of a float64 reconstruct-based reference;
  • on the 27B, a GDN verify window equals serial steps and the drafter's sliced head equals the target head bit for bit; on Flash Next, a 1-to-128-row window gives one-row steps' logits bit for bit.

Drafted == serial through tensorfold serve, comparing the token-id SHA-256 of every reply between "draft": false and drafts on (two prompts, the raw prompt as chat, two 256-token chats, greedy and seeds 1234-1238):

  • Flash Next 3.05bpw + MTP: 30 of 30 replies equal (4,224 tokens, 1,337 rounds, 3.16 tokens a round) on 5e76c85, and the same 30 of 30 with the same aggregates on pr/exl3 at d409822, from the installed wheel through tensorfold serve (~/tfwork/results/p/sha_fn-3.05.json).
  • Qwen3.8-27B 3.00bpw + DFlash2: 30 of 30 replies equal (4,224 token ids, 926 rounds) on pr/exl3 at d409822 (~/tfwork/results/p/sha_q27-3.00.json). The 27B server does not report draft tallies the way Flash Next's does. The same harness on wip/exl3-engines at 4c37180 gave 12 of 12 replies on 3.00bpw and 12 of 12 on 4.00bpw, greedy and five seeds.
  • Flash Next's SAGE pack: 30 of 30 replies equal on 5e76c85 (4,224 tokens, 1,444 rounds, 2.93 tokens a round).

Style and hygiene. LF in the index, git diff --check clean, git ls-files --eol i/lf for every file I touched. No version bump. Torch is imported only inside engine modules, since the CLI imports every family on the Mac too. New *.cu/*.cuh package data in pyproject.toml. Versioned extension names (tensorfold_exl3_linear_v2, tensorfold_exl3_experts_v1). ruff check --select E4,E7,E9,F,E501,W --line-length 120 over the 27 changed .py files reports 17 findings; the same command on the 13 of those files that exist on upstream/main reports 10, all of them still present (5 E501, 4 E741, 1 F401). The 7 new ones are all E741, using I as the expert width in cuda/exl3/experts.py and its test, a rule the tree already carries 50 of. I can fold a rename in if you would rather have those files clean.

Overlap with other open PRs

Checked with git merge-tree --write-tree against each open external PR's head as I wrote this, and by intersecting changed-file lists:

PR files we both touch git merge-tree vs pr/exl3
#9 README.md, docs/recipes/README.md, src/tensorfold/families/README.md, THIRD_PARTY_NOTICES.md conflicts: README.md, docs/recipes/README.md (both merge cleanly with upstream/main)
#10 README.md, docs/recipes/README.md conflict: README.md (clean with upstream/main)
#28 README.md clean
#29 docs/recipes/qwen3.8-flash-next.md, docs/recipes/README.md, README.md, src/tensorfold/families/__init__.py clean
#34 docs/recipes/qwen3.8-27b.md, README.md, src/tensorfold/families/qwen3_5/__init__.py clean
#35 src/tensorfold/cuda/server.py clean
#37 README.md clean

I will rebase on whichever of those lands first. The only real overlap is a table row and a list line in README.md and docs/recipes/README.md, so it is a small conflict either way.

What is not claimed

  • GLM-5.3-Flash on a real EXL3 checkpoint was not run here. Its own path (families/glm5_next/cuda/exl3.py, 4-bit mcg, routed experts only) is untouched by this PR, and there was no GLM EXL3 checkpoint on this box. What I checked is parity on GLM-5.3-shaped synthetic 4-bit mcg data against GLM's own exl3_mm.routed, torch.equal, not on a real GLM pack.
  • Codebooks on real checkpoints. mul1 is verified on real packs: every quantized tensor of turboderp/Qwen3.8-27B-exl3 4.00bpw decodes bit for bit like ExLlamaV3's reconstruct, 409 of 409 groups, and the same holds for the MiMo pack and the Flash Next packs through their family tests. mcg and 3inst have real partial packs here, 50 of 50 groups each and bit-exact, including the mcg marker values and the absence of markers in 3inst. The full-pack conversions for mcg, 3inst and a mixed per-tensor recipe were still running, so I have not measured agreement, NLL or speed on those packs. Everything else about those two codebooks, and the half-bit widths, rests on synthetic data plus the NumPy reference and the bit-by-bit decoder, plus the 4-bit mcg parity above.
  • Where ExLlamaV3 is still faster. Its uniform exl3_moe_coop path reads 219 to 232 GB/s on uniform layers against 208 to 220 here, up to about 5%. Its LinearEXL3 wins several 16-row cells of the dense table (3-bit small-N: 198 against 184 GB/s; 6-bit: 217 against 203 and 229 against 222). On the 27B's 4.00bpw pack its serial decode is 10% ahead (15.8 against 14.5 tok/s), and on Flash Next's uniform 3.05bpw pack 5 to 6% ahead (37.0 against 34.9).
  • Quantization quality is measured for the 27B only, and only against a BF16 reference. The Flash Next agreement table is against ExLlamaV3, not against a BF16 forward. Row invariance says nothing about whether serial output is right.
  • No 8-bit KV cache for these families. TensorFold has none for qwen3_5 or qwen4_exp, so every long-context number here is a bf16 KV cache against the recipe's -cq 8,8. The engine's context capacity is fixed at start and one stream decodes at a time, both documented in the two recipes' Limits sections.
  • Prefill is not tuned. It runs 64-row chunks through the decode kernels, so prompt processing is slower than a dedicated prefill kernel would be.

Not in this PR

MiMo-V2.6-Flash's engine is a follow-up: the grouped expert kernel this PR adds is what it needs, but its reader, its bench and its numbers are not here. The Flash Next serving improvements measured while this branch was frozen are also a follow-up, covering per-shape K splits, the graph-captured draft pick, 128-row prefill chunks instead of 64, and the depth-6 / confidence-0.6 default drafting policy that takes the 3.05bpw pack to 91.6 / 71.8 / 55.3 tok/s at 400 tokens against TabbyAPI's 87.2 / 63.9 / 54.9 on the same box. Their numbers, tables and method are in ~/tfwork/results/flashnext-recipe.md, and none of it is in any commit of this branch. One line to be plain about where that stands: cold 24k prefill is 481 tok/s against TabbyAPI's 642 on this box and the recipe's published 1,129, so prefill is the known weak spot rather than decoding. Both follow-ups are separate PRs, offered once this one is in and rebased on it.

If you would rather review this in two pieces, the kernel infrastructure (cuda/exl3/* plus the server's return_token_ids) and then the two families that use it, say so and I will split it at that boundary. That is exactly where the branch's commits already fall.

- cuda/exl3/format.py: the EXL3 format as checkpoints store it (3inst, mcg
  and mul1 codebooks; 1 to 8 bits, and 1.5 / 2.5 / 3.5 with mul1), each
  tensor group parsed from the safetensors headers (bits, codebook, K, N,
  suh/su, svh/sv, bias), a numpy reference decoder, and require_config: a
  checkpoint's config.json checked before anything is downloaded.
- cuda/exl3/decode.cuh: header-only device functions that decode a 16x16
  tile of any codebook and width straight into mma.m16n8k16 B fragments.
- python -m tensorfold.cuda.exl3.inspect MODEL_DIR: bits per category,
  codebooks, plain tensors and any unreadable group, from headers alone.
- families: a family whose CUDA engine reads every codebook and width
  declares EXL3_VARIANT = "any" (EXL3_VARIANT_ANY); require_readable then
  refuses an EXL3 config the module does not read (an unknown codebook, a
  head width outside 1-8, an average outside 1-8 bits), naming the tested
  checkpoints. Nothing here imports torch.
- tests/test_exl3_format.py: every codebook and width against a
  bit-by-bit decoder, group parsing, the inspector on a synthetic mixed
  checkpoint; tests/test_unsupported_checkpoints.py: the refusals.
The dense half of EXL3 support, for every family (docs/recipes/exl3.md): y = x @ W + bias for 1 to
128 rows with W = diag(suh) H W_q H diag(svh), no cuBLAS.

- cuda/exl3/linear.cu: rot_in (the input Hadamard) and the linear kernel: each warp owns a fixed run
  of k tiles and decodes them straight into mma.m16n8k16 fragments with per-lane cached loads, one
  128-column block and K split per program, K splits added in split order by the last program to
  arrive (one atomic counter), fp32 sums, output Hadamard then * svh + bias. The k ranges depend
  only on (K, N), so no output depends on how many rows are being computed.
- cuda/exl3/linear.py: Exl3Linear.load / from_tensors (strips or stored read order, packed su/sv
  signs), plan(), out/xh/z buffers, fp16/bf16/fp32 in and out, optional scratch. A group the
  index does not name is looked up in the shards' headers, and a group no shard holds is named in
  the error ("<prefix>.trellis is in no file of <dir>").
- tests/cuda/test_exl3_linear.py: row invariance at 1, 2, 3, 16, 17, 64 and 128 rows, the device
  decoder bit for bit against format.unpack, a float64 reference, and ExLlamaV3 when it is
  importable. tests/cuda/test_exl3_checkpoint.py, with TENSORFOLD_EXL3_MODEL: every width of a real
  checkpoint decodes bit for bit like ExLlamaV3's reconstruct, and the layer's forward matches
  ExLlamaV3's.
- tools/bench_exl3.py: the layer against ExLlamaV3's LinearEXL3 on a checkpoint's own tensors (CUDA
  graphs over enough copies to exceed L2).
…e next k step in flight

At 1 and 2 bits a lane's windows span two 32-bit words of a 16x16 tile, so the warp loads its k
step's words as one coalesced run (tile_words / 32 = 2 or 4 words a lane) and each lane takes its
two words of a tile from their owners by shuffle, instead of every lane loading its own two
through the read-only cache. The next k step's words are loaded while the current one is decoded,
up to 6 bits; at 7 and 8 bits a step is 224 or 256 B of words a warp and the same build
prefetching there reads 1-2% slower, so those widths load per tile. The reduction buffer is half
as deep (a program now holds WK * min(M, 8) rows of 128 floats). Same arithmetic in the same
order: 2472 outputs over every codebook, width, split and row count are torch.equal to the kernel
before this commit.

Measured on one DGX Spark (GB10), exclusive GPU, tools/bench_exl3.py (CUDA graphs over copies
that exceed L2, median of 9 replays), rows 1/8/16, SM clock 2405-2418 MHz of 3003, before and
after this commit in two exclusive slots of the same harness, GB/s at 1 row:

  MiMo-V2.6-Flash 2.50bpw 2-bit q_proj      4096x12288   157 -> 220
  MiMo-V2.6-Flash 2.50bpw 2-bit o_proj      8192x4096     76 -> 186
  MiMo-V2.6-Flash 2.50bpw 2-bit down_proj   4096x16896    79 -> 193
  MiMo-V2.6-Flash 2.50bpw 3-bit q_proj      4096x12288   158 -> 192
  MiMo-V2.6-Flash 2.50bpw 5-bit q_proj      4096x12288   188 -> 218
  Qwen3.8-27B 3.00bpw 3-bit down_proj       17408x5120   163 -> 194
  Qwen3.8-27B 4.00bpw 4-bit in_proj_qkv     5120x10240   196 -> 216

ExLlamaV3's own linear reads 176-233 GB/s on the same tensors in the same runs, so the 2-bit rows
now come out at its level instead of 25-60% behind. Nothing measured was slower (the 6-bit heads
are within 1.5%).
- cuda/exl3/experts.cu, experts_grouped.cuh, experts_cb{0,1,2}.cu: one
  grouped trellis GEMV launch per projection covers a whole MoE layer
  whose experts each carry their own width (1 to 8 bits in half-bit
  steps) in the 3inst, mcg or mul1 codebook, read in place through
  per-expert pointer tables; device grouping, input rotations, the SwiGLU
  epilogue, and the down epilogue and the fixed-order combine fused into
  one launch. No atomics, no host synchronisation, nothing allocated per
  call, so a CUDA graph can capture it.
- cuda/exl3/experts.py: prepare / prepare_stacked / Scratch / routed /
  dequant. Tile settings and K splits depend only on the shape.
- On 4-bit mcg experts with the GLM tile settings every kernel does the
  GLM path's arithmetic in its order: per-slot and combined outputs are
  bit-identical to families/glm5_next's exl3_mm.routed.
- tests/cuda/test_exl3_experts.py: the decode against a bit-by-bit
  decoder for every codebook and width and against ExLlamaV3's
  reconstruct; mixed-width rows alone equal the same rows in windows of
  1, 2, 3, 16, 17, 64 and 128 (torch.equal); a float64 reference; GLM
  parity at 1 to 16 rows; the lane map for every width; graphs captured
  at 1, 2, 4 and 8 rows replay torch.equal to eager after allocator churn
  and new inputs; the fused down + combine equals the two launches.
A request with "return_token_ids": true gets the reply's token ids in the response's "tensorfold"
block (streamed replies: in the final chunk, also with stream_options.include_tensorfold), so
drafted == serial can be checked by token-id SHA-256 through the OpenAI path of tensorfold serve.
Nothing changes for a request that does not ask.
The qwen3_5 CUDA engine reads EXL3 packs (turboderp/Qwen3.8-27B-exl3, any codebook and width) as
well as the MLX 4-bit checkpoint. weights.load picks the path from the checkpoint's
quantization_config; the MLX path is untouched.

- cuda/exl3_load.py: an EXL3 pack loads into the same Config/Layer/Weights dataclasses the MLX
  path fills in. Trellis groups run on the row-invariant EXL3 linear (cuda/exl3); the tensors the
  pack leaves alone (the embedding, the GDN's in_proj_a/b, conv, A_log and dt_bias) are read as
  stored. The layer keeps only its strip-ordered copy of the words.
- The packs store the five centred RMSNorm weights (input, post-attention, q and k norms, the final
  norm) centred on 0, as the HF module computes x * (1 + w); the loader adds 1. The GDN's gated
  norm, A_log, dt_bias, conv and in_proj_a/b carry no offset (checked tensor by tensor against the
  MLX checkpoint).
- cuda/b16.{cu,cpp,py}: the plain fp16/bf16 linear for those unquantized tensors: one warp per
  output, 16-byte loads, each lane's strided run of k summed in fp32 and the 32 lane sums added by
  a fixed xor butterfly, so an element's bits depend on its own row and column only. No cuBLAS.
- exl3_load.PLANS: the (K split, warps) that were fastest at one and twelve rows for the down, GDN
  qkv/z/out and attention o projections at 3 and 4 bits. Like plan(), a function of the shape and
  width alone, so the rows of a verify window keep one reduction.
- cuda/dflash2.py: the drafter reads the target's 6-bit head over its draft vocabulary by slicing
  the head's 128-column strips as they are stored, with the target's K split, so its logits are the
  target head's bit for bit; nothing is decoded or requantized. The embedding is read by row. A
  two-rank drafter still needs the MLX checkpoint's head.
- families/qwen3_5: turboderp/Qwen3.8-27B-exl3 among the tested checkpoints, QUANT_METHODS
  cuda = (mlx, exl3), EXL3_VARIANT = "any".
- tests/cuda/test_qwen27_exl3.py: every tuned split keeps a row's bits alone or among 16; a GDN
  verify window on EXL3 and plain weights equals serial steps, rows and committed state; drafted
  decoding keeps serial's tokens; the sliced head equals the target head. With
  TENSORFOLD_QWEN27_EXL3 and TENSORFOLD_QWEN27_DRAFTER, the real pack's drafted replies equal
  serial by SHA-256 of the token ids (greedy and two seeds).
The qwen4_exp CUDA engine reads EXL3 packs of Qwen3.8 Flash Next as well as its MLX 4-bit
checkpoint: any codebook, a width per tensor (mixed-K packs such as a 2-8 bit SAGE pack), one GPU.
The MLX path is unchanged; weights.load hands an EXL3 pack to cuda/exl3.py, which fills the same
Weights dataclasses.

- Dense trellis groups (attention, DeltaNet, MTP fc, head) on the row-invariant EXL3 linear;
  projections reading the same input are stacked side by side, and at one row each part writes
  straight into its column slice (no scratch copy).
- Routed experts and the shared expert (as expert 512 of one table) on the grouped EXL3 expert
  kernel, each expert matrix at its own width. The fp32 router, its top-k with id tie-break and the
  slot-ordered write-back are the MLX path's; the EXL3 branch takes the top-k alone
  (moe.select_rows), since the expert kernel groups the window itself.
- Tensors the packs leave unquantized (hyper-connection down/inject/up, DeltaNet in_proj_a/b,
  n-gram key/value) on an fp16 Triton matmul whose tiles and K split depend on the shape only.
- The n-gram tables are ExLlamaV3's row codec, not EXL3 tiles: a row is an fp16 scale and 160
  values of K bits in a tail-biting mul1 trellis, plus a per-head bias. ple_rows decodes them as
  ngram_dequant does; the rows stay in the checkpoint, memory-mapped.
- The packs store every centred RMSNorm weight as gamma - 1 (hyper-connection, q/k, indexer,
  n-gram and MTP input norms): the loader detects it and adds 1 in fp32. DeltaNet's gated norm,
  A_log, dt_bias, conv weights and the router are the MLX checkpoint's values.
- turboderp's packs keep the MTP mixer in mtp_hyper_connection_mixer_patch.safetensors, outside
  the index; the reader takes it from there.
- MTP drafts: the head's draft-vocabulary rows decoded through the EXL3 linear and requantized to
  4-bit groups of 32 for the draft head (drafts change speed only; verify uses the full head).
- families/qwen4_exp: QUANT_METHODS cuda = (mlx, exl3), EXL3_VARIANT = "any"; check() accepts an
  EXL3 pack and notes a missing MTP head.
- tests/cuda/test_qwen4_exp_exl3.py: the fp16 matmul against fp64 and row-invariant (windows of
  1, 2, 3, 16, 17, 64, 128 rows); ple_rows bit-equal to the row codec at 2-8 bits. With
  TENSORFOLD_EXL3_FLASHNEXT=<pack>: the centred norms, n-gram rows bit-equal to ngram_dequant, a
  real layer's experts against fp64 and row-invariant, and the model cut to 4 layers: windows of
  1..128 rows give one-row steps' logits bit for bit, a kept prefix continues like serial, and
  MTP-drafted decoding (eager and CUDA graphs, greedy and sampled) emits serial's tokens.
…X checkpoints

- docs/recipes/exl3.md: the format, what a family declares, using the module, the layer's
  arithmetic, a kernel table, the linear against ExLlamaV3's on real tensors, and the traps.
- docs/recipes/exl3-universal-experts.md: the grouped routed-expert kernel, where the width enters,
  against ExLlamaV3's mixed-K and coop dispatch on MiMo-V2.6-Flash's real experts, and how its
  exactness is checked.
- docs/recipes/qwen3.8-27b.md, qwen3.8-flash-next.md: serving the EXL3 packs, drafted == serial,
  agreement with ExLlamaV3 on the same packs, speed against ExLlamaV3 and the MLX checkpoint.
- docs/recipes/cuda.md, docs/recipes/README.md, README.md, families/README.md,
  families/qwen3_5/cuda/README.md: the module, the checkpoints and the kernels.
- THIRD_PARTY_NOTICES.md: the ExLlamaV3 entry covers the shared module, the expert kernel and the
  two families' EXL3 readers; the EXL3 packs the families list, with their licenses.
@vcruz305

vcruz305 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Two follow-ups, both from runs that finished after I opened this.

Timing re-measure on pr/exl3. I started the full re-run of the timing arms and killed it after four minutes, because at that rate it needs over an hour of exclusive GPU and only the arms below got through. Same harness as the tables above, exclusive session, SM clock 2405 to 2411 MHz, medians of 5, greedy:

  • 27B 3.00bpw serial: 15.90 code / 15.87 chat (the table above has 16.7 / 16.6 from 4c37180)
  • 27B 3.00bpw + DFlash2: 60.24 / 43.45 (the table above has 63.2 / 45.7)
  • ExLlamaV3 serial on the same pack: 16.48 code, against 16.5 before

The two 27B drafted cells read about 4% lower on this branch than in the earlier session while the ExLlamaV3 cell reads the same, and I do not want to sell that as either a regression or a match: this box's run-to-run spread on this model is wider than that (in one arm the five reps ranged from 56.2 to 78.9 tok/s). The tables above stay labeled with the commit each number came from. If you would rather see every cell re-run on the branch, I will spend the hour.

The per-commit row for 4b95136. It now says what happened. That run got 8 tests passed and then hung in test_window_rows_equal_serial_steps, about ten minutes asleep with the GPU idle, so it was killed and is not counted. I have since run that file at 4b95136 again, in its own worktree with a fresh TORCH_EXTENSIONS_DIR, and it passes in 35 seconds. The hang was the shared extension directory: eight commits had been built into one TORCH_EXTENSIONS_DIR, and the process was waiting on a build lock, not on the GPU. Nothing in the branch is failing, and the tip's 14 of 14 covers that commit.

Codebooks. mcg and 3inst are still partial-pack only: 50 of 50 groups each, bit-exact against reconstruct, including the mcg marker values and the absence of markers in 3inst. The full conversions (mcg, 3inst, and a mixed per-tensor recipe) are still running on this box, and I will post their agreement, NLL and speed here when they land.

@ashhart

ashhart commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Thanks @vcruz305, this is a big and careful piece of work, and beating ExLlamaV3 on its own packs is a strong result. We're reviewing it now and targeting 0.3.6, after tonight's 0.3.5: it needs to merge with 0.3.5's CUDA changes, and we'll run the exactness and speed checks on our Sparks. Your commits will land under your name, and review notes will follow here.

@ashhart

ashhart commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Phenomenal work!

@ashhart

ashhart commented Sep 28, 2026

Copy link
Copy Markdown
Owner

EXL3 on CUDA is in 0.3.6 as experimental: your eight commits (b16fb91 through 654e4ad) shipped under your name. Both packs are exact on the lanes: 9/9 drafted equal to serial, resumed prompts 6/6, and four concurrent streams equal their solo runs. On one DGX Spark against vLLM with MTP=3, the 27B pack decodes 1.62-3.56x and Flash Next's 1.79-1.91x, and Flash Next's pack admits its full 262k window with 21 GiB less GPU memory. Prompt processing is about half the MLX checkpoints' speed today. An FP8 prompt path over your decoded tiles is next, in 0.3.6.1. Thank you for a careful, well-measured PR. #47 is next in line.

Release: https://github.com/ashhart/TensorFold/releases/tag/v0.3.6

@ashhart ashhart closed this Sep 28, 2026
ashhart added a commit that referenced this pull request Oct 14, 2026
ashhart added a commit that referenced this pull request Oct 14, 2026
Main keeps its newer app work and its credits page; the release brings the engine changes since 1.0.10, followed by the EXL3 docs and credit (#42).
ashhart added a commit that referenced this pull request Oct 18, 2026
…rts for every codebook and width

The merged commit is #837's with its author, date and message, without its five fixture scripts under
zig/tests/cuda/oracle/: they import the Python engine, which does not land here. The tests still read recorded
bytes from a folder when one is given. The kernel list, the runtime's exports, the test runner's usage and
qlinear's weight views take both sides. #837's kernels port the Python engine's EXL3 module from #42.

Co-authored-by: vcruz305 <[email protected]>
ashhart pushed a commit that referenced this pull request Oct 25, 2026
…nsorfold block

The #840 row (Python #42, @vcruz305): a request that sends
return_token_ids gets the reply's token ids in tensorfold.token_ids,
the same slice token_sha/token_sha256 hash, on the whole reply and on
the streamed finish event. Without the flag, replies are unchanged.

Co-authored-by: vcruz305 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants