Repository navigation
Conversation
b028d43 to
db6eaf3
Compare
|
The M5 Ultra run on Q4_K_M: it serves, and it's far too slow to land as it is.
Two runs read the same, loading in about 42 s. That's about 13 times slower at one stream, and adding streams gives nothing, so something per round isn't sharing. These aren't an A/B against main, because main refuses a GGUF, so the verdict line reads RED for that reason alone; the comparison is against this box's recent MLX runs of the same model. Reply quality against the MLX replies hasn't been compared yet. We've parked the Q8_0 run, which would take about three more hours of the box to say the same thing. This stays out of the queue until we know where the time goes. |
|
Where the time goes on Q4_K_M, from reading the code on this head; no GPU profile yet, so the shares are unmeasured. Every dense projection uses the generic weight-only kernel instead of the MLX lane and tensor kernels, which need different metadata and do different floating-point operations. It loses the fused projections, and it repeats the weight work for each row, which fits the flat result across streams. Nothing runs on the CPU. There's no small switch that gets most of it back exactly: that would take a GGUF-specific exact projection, qualified on its own. So this is a compatibility path at about 3.8 tok/s on an M5 Ultra, not a fast path. It stays out of the queue until we decide it's worth landing as that, with the speed stated in the recipe. |
Port the complete control-token stop set and tokenizer comparison from #1955. Check both providers against the same 834 varied strings, vocabulary slots, added-token flags and rendered chat IDs. Keep FIM controls ordinary for decoding and leave unused padding slots unmapped. Document the measured generic projection path under Unreleased.
On today's main, attention.zig, qwen27_served.zig and hf_text.zig passed 600 lines with the GGUF changes. The GGUF source choice moves to native/qwen27_source.zig, the attention head binding to a free function with its test in attention_gguf_test.zig, and the clear_thinking field test to hf_fields_test.zig. No behaviour changes.
Main dropped q27_norm, its Norm parameters and normThreads as unlaunched (#2816), but the GGUF path launches that kernel with FP32 gains. It returns, unchanged, as qwen27/gguf_norm.metal, compiled after glue.metal only by the GGUF kernels, with its ABI back in glue.zig and its size check. The runtime source set compiles it too.
db6eaf3 to
ed3efe7
Compare
|
Closing for now: GGUF Q4_K_M served at 3.8 tok/s against MLX's 48.7 on the same Mac, about 13 times slower, with no gain from more streams, and the branch now conflicts with main. It can come back once we know where the time goes.
|
Part of #1920, stacked on #2064 (the adapter): review only the last two commits.
What this changes
tensorfold-native serve model.ggufnow opens dense Qwen3.8-27B Q4_K_M and Q8_0 files on Metal, including a directory containing one GGUF. Config, vocabulary, merges, token kinds, BOS/EOS and chat template come from that GGUF. Other source types and missing keys refuse by name.Packed codes and F32 affine tables retain their bits. Six-bit codes widen losslessly to eight bits, retaining their 16-element groups. GGUF DeltaNet value heads are repeat-major, so the loader copies the corresponding rows, columns, convolution taps and small vectors into native key-major order. Negative exponential decay becomes the existing kernel's explicit logarithmic input. Norm gains stay F32. No shader or kernel entry point changes. Native MLX loader functions and all 676 shader files are unchanged; the existing projection recording tests and attention defaults remain green.
Checks on this head
Receipt
M3 Ultra, 256 GiB, Zig 0.17.0, the observed ggml-org GGUF revision
a316ea527fde32c12487be7574e2db5ac2ad2a7e. Core's independent decoder checks the first layer's eight matrix classes in each format: 383,221,760 weights, zero different bits and zero different binary64 fixed-input projection rows after source layout conversion. Paired scalar checks over all 48 linear layers pin the head order independently; the old identity assumption produces wrong replies.Q4_K_M serves three fixed fact/arithmetic/code prompts greedily for 32 tokens each, 96 total, with thinking/drafts off, temperature zero, EOS ignored, context 1024, one stream and prompt cache off. Exact rendered prompt IDs are retained. A separate CPU forward independently decodes the original weights, retains source head order, uses binary64 arithmetic and checkpoint BF16 rounding points, and matches all first eight tokens per case: 24/24, zero mismatches, minimum top-two margin 0.625. It shares neither native repacks nor the native head-permutation helper.
Observed readiness/physical process footprint: Q4_K_M 61.99 s / 27.63 GiB; Q8_0 79.33 s / 35.78 GiB. File-cache state is uncontrolled and the files had already been read. These are not cold-load or peak-load figures. The three short Q4 requests decode at about 2.8 tok/s; there was no earlier GGUF serving baseline, and no speed improvement is claimed.
The affected Metal weight-only panel, filtered by name with all launch-limit checks enabled: 22 variants pass gates 1-4, 88 controls red as planted, zero limit problems. It includes the new mlx8/group16/F32 admission. Other formats' numeric bounds are unchanged. Generic/CUDA admission and the original 21 CUDA variants stay unchanged; only Metal-specific validation and buffer boundaries admit the extra group. This is a filtered receipt, not the full Metal contract or another chip's numeric qualification.
Remaining unchecked: other GPUs, Q8_0 generation/reference, long contexts, concurrency and a live MLX A/B. GGUF drafter/vision/slide/TP/speed-up/disk-learning combinations remain refused. Equality with a separately quantized MLX checkpoint is not claimed. No new weights or third-party source are distributed.
Refs #1920. Qwen3.8-27B GGUF serving now keeps the complete stop set and matches the MLX text assets. This follow-up ports #1955's stop-set and tokenizer-comparison pieces onto the existing served adapter, one commit on parent
924abf3c9cd226670aa0a0dab0395e0c694b6fcd.A shared checked reader keeps the GGUF's declared EOS and its end-of-text control, producing
[248046,248044]in both model config and server text. Ordinary end-of-text spellings refuse. Tokenization's add_eos flag appends only the primary EOS. The six FIM/repository/file added tokens remain ordinary for skip-special decoding, and unused vocabulary slots stay absent.The actual GGUF and MLX text providers match on both supplied formats: 834 varied strings, 1668 full/masked encodings, 6674 decodes, every one of 248320 vocabulary slots, all 33 added-token records, both stop sets and a 33-token rendered chat prompt. Both sides use the native tokenizer/template engines with independently loaded assets. The baseline caught 25 decode differences, six flag differences, 243 padding-slot differences and the missing second stop in each format; all are zero after the fix. The default corpus and comparison tool are in the tree; the check reads GGUF metadata and MLX text assets.
Q4_K_M and Q8_0 both use the generic weight-only projection for their affine linear products. Q4_K uses four-bit/group32 storage, Q6_K widens losslessly to eight-bit/group16, and Q8_0 uses eight-bit/group32; all keep F32 coefficients. The parent's Q4_K_M receipt on an M3 Ultra with 256 GiB decoded at about 2.8 tok/s on three short greedy 32-token requests. Q8_0 shares the generic path; no Q8 generation-speed receipt is claimed. The recipe states these limits, and the CHANGELOG update stays under Unreleased.
Five source controls fail and restore. Lean is 424 inherited findings, zero new. Native files, all kernels and the MLX text loader are unchanged. Plain Linux: 31/31 steps succeeded. Plain Mac: 250/250 steps succeeded. Standard graph: 666/670 steps succeeded (2 failed); 9759/9815 tests passed (54 skipped, 2 failed). The two failures are the inherited HTTPS tunnel-count assertion with byte-identical baseline source. The original independent weight/CPU-forward receipts remain on the parent; no new model or device qualification is claimed for this text follow-up.