Repository navigation
Conversation
c29b86c to
5e2af9d
Compare
5e2af9d to
721149d
Compare
|
Thanks for the mention in #268, @Arminova, and for #247: I hadn't seen it when I opened this, and we overlap on To keep out of #247's way I'm splitting this PR:
On #268: agreed that Volta keeps @ashhart, if you would rather review this in a different order or shape, tell me and I'll adapt. |
Triton's tl.dot has no tensor-core path on Volta (0.2 TFLOPS) and the shared FP8 and bf16 extensions need sm_80, so the Qwen3.8-27B MLX 4-bit weights get their own kernels, with the row-invariance contract kept: - Decode: mma.m8n8k4 from registers, one weight column a thread, weights repacked once at load (Tiled), rows scaled by a power of two so every bf16 value is an exact fp16, fp32 sums; the K split is a function of the weight's shape and its slices add in order, so a row never depends on the row count. Rows reach the kernel in its fragment order. - Prompts: a dense fp16 copy of each weight and one cuBLASLt algorithm pinned per weight shape (split-K off), so a row's chain over K is the same at every row count and any chunking. - Extensions declare Volta with need=VOLTA; the FP8 and sm_80 builds keep their clear refusal. - The Volta-only tests skip elsewhere; sm_80-only modules skip on Volta with their reasons. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
- Tree attention (attention_volta.cu): attention.py's chunk partials on mma.m8n8k4, one per-warp routine under two kernels (chunks wholly below the committed keys with every window row in one block; the rest per row with its path keys). A row's partial never depends on its warp mates and a key on a path gives the same bits as the same key committed, so drafted rows equal serial ones. - Prompt attention: PyTorch's memory-efficient (CUTLASS) attention in fp16, one key head at a time with its query heads on the batch axis and its keys and values broadcast without a copy; query rows pad back to a 128-aligned position so a row's tile never moves with chunking. - DFlash2's block attention (draft_attention_volta.cu), with its shape and shared-memory limits checked. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The Qwen3.8 engine states its own capability floor at admission (the MLX checkpoint runs on sm_70; EXL3 and NVFP4 packs are refused by name there), and both planners count the fp16 key and value staging of the prompt attention. README, the recipe's V100 section with measurements, the family's kernel map and a changelog entry. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
721149d to
93f3572
Compare
|
Thank you, @RoscoeTT. We are taking this as community-supported: the V100 kernels land under your name, marked experimental, with the refusals by name kept. Nobody here runs a V100 and our CI has none, so our review covers the shared code and the lane rounds, and correctness on the card rests on receipts from V100 users. We plan to port it in a coming release, and #292 follows it. |
|
Thanks for #264. We built our Volta work on top of it and have opened it as #374 to #380 (NVFP4 27B on sm_70, Qwen3.6 Since #264 is on 0.6.3, those branches carry its three commits replayed onto v0.6.5, with your authorship kept:
Take whatever helps. If you rebase #264 yourself, we will restack ours on it. |
|
Thank you, @RoscoeTT. Bringing the 27B to V100s under the same contracts, a K split chosen from the weight's shape and rows that never depend on the row count, and then writing up where llama.cpp still wins, made this easy to trust. The Python engine is frozen (#286), so this won't merge. Zig CUDA builds for one target today, GB10 at sm_121, and runs only Nemotron, from the command line. Volta waits for Zig CUDA to take an sm_70 target and for the 27B family on the Zig engine. When both are in place, your |
Qwen3.8-27B (the MLX 4-bit checkpoint with its DFlash2 drafter) on Tesla V100s, compute capability 7.0. Volta has no Triton tensor-core path (
tl.dotruns at 0.2 TFLOPS there) and the shared FP8 and bf16 tensor-core extensions need sm_80, so this adds the family's own sm_70 kernels under the same contracts. Measured on Tesla V100 32 GB cards. Related to #139 (the minimum NVIDIA card class): the README's NVIDIA section now says what runs on Volta and what does not.This PR does not add an int8 cache. #247 adds
--kv-dtype int8for the 27B; after it lands I'll follow up with its packed rows on Volta, so one flag means one thing on every GPU. With the bf16 cache, one 32 GB V100 serves a window of about 164,000 tokens with the drafter.What runs where
kernels/qmm_volta.cu:mma.m8n8k4from registers, one weight column a thread, weights repacked once at load (Tiled), rows pre-scaled by a power of two so every bf16 value is an exact fp16, fp32 sumskernels/attention_volta.cu:attention.py's chunk partials onmma.m8n8k4draft_attention_volta.cugdn.cu, unchanged; it compiles and keeps its bits on sm_70Drafted replies equal this engine's own serial decoding (the exactness sweeps pass at every window width); the bits differ from the sm_80+ engine's. EXL3 and NVFP4 packs are refused on Volta by name, and
--prefill-fp8is refused as before. Extensions declare Volta support withneed=VOLTA; the others keep their clear refusal at startup.Measurements
One Tesla V100 32 GB (PCIe; the machine caps these cards at 200 W against their stock 250 W, so every figure below is at the cap), greedy, drafts on,
--context 163840(the startup estimate admits 164,400 with the drafter), a needle in the middle of the prompt, found at every depth, peak memory 29.6 GB:Two V100s with NCCL peer access (
--tp 2) fill a 17,000-token prompt 26% faster than one and decode at about the same speed; without peer access NCCL falls back to host memory and the pair gains nothing.How this compares with llama.cpp
Same card, same settings, one client for both engines: stock
Qwen3.8-27B,--context 65536, f16/bf16 KV, greedy, thinking off, a fresh prefix on every request, tokens counted with the model's own tokenizer. llama.cpp is the rig's build (b11115) onunsloth/Qwen3.8-27B-GGUFUD-Q4_K_M(about 4.7 bits a weight; TensorFold's MLX checkpoint is about 4.5), with its MTP sidecar and withz-lab/Qwen3.8-27B-DFlash2-GGUF, each at several draft lengths. Both engines ran under the same 200 W cap, and every cell is the median of 1 to 3 requests. A run with the cap removed follows at the end of this description.Decode, tok/s after the first token, llama.cpp's best configuration in each column:
--no-drafts)Prefill, tok/s, cold prompt:
-ub 512-ub 2048This is not magic, and the table shows where it is not:
-ub 2048(1.4 to 1.6 times against its default). The speculative llama.cpp runs were measured at-ub 512only, so their prefill figures are lower than a tuned run would give.Tests and what is not covered
tests/cuda/test_qmm_volta.py: rows independent of the row count on the decode kernel and on the prompt GEMM (any chunking and offset), both against an fp32 reference, and the tiled layout round-tripping.tests/cuda/test_attention_volta.py: the attention against fp32 softmax attention, and a row's partial the same alone, in a chain, in a tree, committed or not.--parallel Nis exercised by the test suite but not under load on hardware, and there is no V100 in CI.Docs: a V100 section in the README and in
docs/recipes/qwen3.8-27b.md, rows in the family's kernel map, a changelog entry.Without the power cap
The cards run at 200 W here by policy, against a stock 250 W; their power and cooling have since been raised, so I repeated the whole matrix on one card at 250 W (same client, same configurations). Over that run the card peaked at 274 W, its lowest SM clock was 1,222 MHz, it stayed under 73 C, and the 250 W limit still throttled it for 8% of the busy seconds.
-ub 2048(1.31, 1.19 and 1.14 times).