Repository navigation
Conversation
Assisted-by: Claude Co-authored-by: Cursor <cursoragent@cursor.com>
Assisted-by: Claude Co-authored-by: Cursor <cursoragent@cursor.com>
Assisted-by: Claude Co-authored-by: Cursor <cursoragent@cursor.com>
… context Assisted-by: Claude Co-authored-by: Cursor <cursoragent@cursor.com>
…mmap On devices without mmap support (iGPUs) --load-mode auto turns mmap off and --lazy-mode auto resolved to off (ggml-org#28160), so a 27 GiB engram table was copied into a regular CPU buffer. On a host with little RAM (Strix Halo with a 96 GiB carve-out leaves 31.6 GiB) this pages and halves prefill. Keep the tensors resident as before, but still read a tensor lazily when it is larger than a quarter of the host memory. Co-authored-by: Cursor <cursoragent@cursor.com>
unmap_fragment was a no-op on Windows, so with --load-mode mmap the pages read to upload the offloaded weights stayed in the working set (~25 GiB on a 31.6 GiB host). A view cannot be unmapped in parts, so remove the pages from the working set with VirtualUnlock instead; they stay mapped and in the standby list. Co-authored-by: Cursor <cursoragent@cursor.com>
…ad on Windows With --load-mode mmap the pages of the offloaded weights stayed resident until the end of the load (peak working set ~25.6 GiB, ~0.1 GiB available on a 31.6 GiB host). Drop each tensor's pages right after its upload. Co-authored-by: Cursor <cursoragent@cursor.com>
…he draft context" This reverts commit ccecb0c. With the PLE table read lazily (AMD-Ecosystem#221) the prefetch shows no gain in steady state decode. Assisted-by: Claude Co-authored-by: Cursor <cursoragent@cursor.com>
Assisted-by: Claude Co-authored-by: Cursor <cursoragent@cursor.com>
A tile wider than the batch (e.g. one decode query in an 8-query tile) iterated over ncols1*n_kv_max list entries, mostly -1 padding. Co-authored-by: Cursor <cursoragent@cursor.com>
…ists One block scans a whole mask row in 2048-column chunks, so in decode the scan of a 64K mask was ~1 us per 1K columns. With fewer lists than SMs use 1024 threads per block. Co-authored-by: Cursor <cursoragent@cursor.com>
…hint Qwen QSA layers pass a full-length mask that keeps ~2K cells plus an n_kv_max hint. The sparse gather was enabled only on NVIDIA and CDNA, so RDNA read the whole KV cache. Small batches take the narrowest sparse WMMA tile that holds them: 2x8 for decode, 4x8 for MTP verify, 8x8 up to 8 queries. A list holds the union of the queries in a tile and a gathered row costs about 1.5 dense rows, so require K >= 1.5x the list length. GGML_HIP_FA_SPARSE=0 disables it. Add QSA eval cases for 2-8 queries and perf cases around the crossover.
GQA 12 batches of more than 8 queries went to ncols2=4, which has no sparse variant, so every QSA layer read the whole KV cache during prefill. When the sparse condition holds, pad GQA to ncols2=8 instead and gather with the 8x8 tile: a list is the union of 8 neighbouring queries, about 4x n_kv_max for the real QSA masks. The dense kernel is slower per row at these sizes, so the gather already wins at K >= 6x n_kv_max even for independent random masks. Add QSA prompt-batch eval cases, and perf cases with selections drawn from a shared pool of cells to mimic the overlap of neighbouring queries.
kpool_build_state stamped the pools it marks in a per-cell array that lived in the memory context, so every decode call allocated and zeroed kv_size entries (1 MiB at 262144 cells, ~0.17 ms per call, four calls per MTP round). Keep the array and its generation counter in the memory instead.
A sequence edit after the first position (e.g. dropping the rejected drafts of a speculative round) rebuilt the whole k-pool layout of the sequence from the cell set, ~0.9 ms per call at 32K context and four calls per MTP round. The cells before the edit and the pools made of them only are unchanged, so keep them and regroup from the last kept pool.
…conv input The conv input of the linear attention layers is concat(state, transpose(x)). Cover the shapes of Qwen3.8-Flash-Next (10240 channels, 1, 3 and 2048 tokens) and add the prefill shape to the perf cases. Co-authored-by: Cursor <cursoragent@cursor.com>
When the CONCAT has no other use, the conv reads the state and the (transposed) x in place: one thread per channel, so the loads of x and the stores are coalesced. The non-contiguous CONCAT it replaces ran at ~40 GB/s. graph_optimize keeps both concat inputs alive until the last fused node. Co-authored-by: Cursor <cursoragent@cursor.com>
…columns The full conv input is then read only by SSM_CONV, so a backend can fuse the two. Decode and MTP batches (no more tokens than the state columns plus n_rs_seq) keep the single concat. Co-authored-by: Cursor <cursoragent@cursor.com>
Eval cases for 2-8 queries and for prompt batches with partial tiles, with independent random selections and with selections drawn from a shared pool of cells, which mimics the overlap of neighbouring queries of the QSA indexer. Perf cases from 8K to 64K cells for 512 and 2048 queries, and for MTP verify / draft blocks at 32K. Co-authored-by: Cursor <cursoragent@cursor.com>
…NA3.5 GQA 12 prompt batches used the 8x8 sparse tile: 8 queries x 8 heads, so each KV head needed 2 tiles that both gather the union of the 8 queries (about 4x n_kv_max for the real QSA masks). The WMMA work of a tile grows with that union and dominates the kernel, the K/V gather is the smaller part. Use a 2x16 tile instead: all 12 heads of a KV head in one 16-head tile (one gather per KV head) over the union of only 2 queries, which is about 0.4x the union of 8 at 32K-64K. The kernel is 1.6-1.8x faster than the 8x8 tile for shared-pool masks close to the real indexer at 32K-64K cells, and it beats the dense kernel from 4x n_kv_max cells on, so 8K-deep prompts (10K cells) now take the sparse path too. The (256, 256, 2, 16) MMA instance is only compiled for HIP. Co-authored-by: Cursor <cursoragent@cursor.com>
…verify batches Eval cases: TOP_K of 512 out of 1.5K to 32K pools for 1, 3 and 20 rows, with ties at the threshold, with many -inf (invisible pools), and over the batch dimensions; LIGHTNING_INDEXER with 4 heads for token counts that are not a multiple of a WMMA token tile and key counts that are not a multiple of the key tile, for F32 and F16 keys, with 1 to 3 streams. Perf cases: the pooled indexer of Qwen3.8-Flash-Next at 8K, 32K and 64K context for a 2048 token batch and a verify batch, and TOP_K of 512 of the same pools for 1, 3 and 2048 rows. Co-authored-by: Cursor <cursoragent@cursor.com>
The radix path of TOP_K takes 10 launches per call (4 histogram passes, 4 selects, init, gather), each re-reading the row. For the Qwen QSA indexer that is 512 of 8.8K (32K context) to 17K (64K context) scores per token, 12 layers per ubatch, and also every decode and MTP verify step. Hold the row (up to 32768 columns) in registers of one block instead: four 8-bit radix passes over the keys that match the prefix found so far give the 512th largest key T, then the keys above T and the lowest columns of the keys equal to T are written. The selected set is the one of the radix path (the lowest columns win ties, checked against the exact host top-k on 127K rows of real 32K and 64K prompts: no difference). The order in a row is unspecified, as before. Only on RDNA3.5 (GGML_HIP_TOPK_BLOCK overrides), and only for rows between 1025 and 32768 columns, other cases keep their path. Kernel time at 2048 rows: 32K context pools (8768) 2.64 -> 0.60 ms, 64K (16960) 5.0 -> 1.42 ms; a single row (decode, verify): 40 -> 8 us at 8768 and 36 -> 11 us at 16960. Co-authored-by: Cursor <cursoragent@cursor.com>
LIGHTNING_INDEXER with 4 heads has no WMMA tile (a head tile needs 16 rows), so prompt batches ran the float tile kernel at 4 TFLOPS: 4.8 ms per layer at 32K context and 9.8 ms at 64K, 3% to 5% of a pp2048 ubatch. Use the 4 heads of 4 tokens as the 16 rows of the A operand, so a wave scores a 16 key column tile for 4 tokens, 8 waves share a staged half precision key tile (as the tile kernel, keys are rounded to half). The float queries are split into a high and a low half and both are accumulated in float, which keeps the float precision of the products: scores differ from the float tile kernel only by the summation order (max 1e-5 absolute, last bits of most scores). Rows are ordered so that a lane of the accumulator holds the 4 heads of 2 tokens and the ReLU, weights and mask add need no cross lane reduction. Only for RDNA3 / RDNA3.5 with F32 or F16 keys and at least 16 tokens, on by default on RDNA3.5 only (GGML_HIP_INDEXER_WMMA overrides); smaller batches (decode, MTP verify) keep the vector kernel. 2048 tokens at 32K / 64K context: 4.70 -> 1.17 ms and 9.0 -> 2.26 ms. On real 32K and 64K prompts the top-512 set of a row differs from the float kernel's in 0.02% of the rows (a pool at the 512th place whose score is within a rounding error of the next). Co-authored-by: Cursor <cursoragent@cursor.com>
Assisted-by: GPT-5.6 Sol Co-authored-by: Cursor <cursoragent@cursor.com>
…pt and verify batches Co-authored-by: Cursor <cursoragent@cursor.com>
…A3.5 The fused weighted reduction of the experts (MUL by the routing weights and the chain of ADDs) used one thread per column and 4 byte loads, 100 GB/s on [2560,10,2048]. For prompt batches without a q8_1 copy of the result, each thread now sums 4 consecutive columns with float4 loads, the loads of all experts issued up front. The products and sums are spelled out (__fmul_rn, fmaf) in the order of the scalar kernel, so that the result is bit for bit the same. On by default on RDNA3.5 for at least 16 tokens; GGML_HIP_MOE_REDUCE_X4=0 / 1 turns it off / on. Co-authored-by: Cursor <cursoragent@cursor.com>
…MMA on RDNA3.5 The router (F32 512x2560, 2048 tokens) went through hipBLAS sgemm at 2.5 TFLOPS. Both operands are split into a high and a low half (x = x_hi + x_lo, 22 of the 24 bits) and multiplied as x_hi*w_hi + x_lo*w_hi + x_hi*w_lo on the WMMA units with float accumulation, 64x64 outputs per block of 4 waves. The three products of 16 values of K are summed in a fresh accumulator and added to the running float sum, since the accumulation inside a WMMA does not round to nearest. The error against a double precision product is that of a float GEMM or a little smaller. Used for F32 products with at least 16 tokens, 16 rows, K a multiple of 32 and 16 byte aligned rows; on by default on RDNA3 / RDNA3.5 devices tuned for 3.5 (GGML_HIP_F32_WMMA=0 / 1 turns it off / on). Co-authored-by: Cursor <cursoragent@cursor.com>
…s than SMs on RDNA3.5 Assisted-by: Claude
…om its target The shared MTP files (qwen4exp.nextn_shared_target_tensors, 2.79 GB instead of 4.14 GB) leave token_embd and output out, and failed to load with "token_embd.weight not found". Load the two tensors as optional when the file has no trunk, and let the draft context borrow them from the target model through ctx_other, like the DFlash and Eagle3 drafts: the embedding rows come from the target's token_embd and the draft logits from the target's output, so the draft head reads the target's q6_K head instead of its own Q8_0 copy. The context checks the target (same arch, width, vocabulary, both tensors present) and refuses to load such a head on its own. The shared files need two more things: - they carry compress ratio 0 for the MTP block (dense attention), where the self-contained file says 4 (QSA). A dense MTP block must not build the k-pool inputs (the indexer key indexes had no buffer and set_input asserted) and needs no indexer cache in the draft memory; - ctx_other is set for such a draft now, so the MTP driver must not take it for the shared KV cache of the gemma4 assistant: check the architecture too. A self-contained head loads and runs as before. Co-authored-by: Cursor <cursoragent@cursor.com>
…on long contexts, --spec-draft-qsa (default auto)
The shared MTP files store the MTP block with compress ratio 0, dense attention, where the self-contained file
says 4 (QSA). A dense draft step reads the whole KV cache, QSA only the selected blocks. Round times of the
UD-IQ4_XS sweep (verify and two draft steps, shared head, dense against QSA, 2 runs each):
context 1K 4K 8K 16K 32K 48K 64K
dense 59.1 59.8 61.8 61.4 63.9 66.6 69.3 ms
QSA 60.2 61.1 63.0 62.6 63.9 65.5 67.0 ms
prefill - - - - +1.2 +2.9 +4.9 s longer with dense attention
QSA is 1 to 1.2 ms slower up to 16K (the indexer), equal at 32K, and faster from there on, and the draft
accepts more with dense attention at 1K.
Add llama_context_params::mtp_qsa and --spec-draft-qsa {auto,on,off} (LLAMA_ARG_SPEC_DRAFT_QSA) for such a
block, replacing the LLAMA_MTP_QSA experiment. auto (the default) attends densely while the cache holds fewer
than 40960 cells and through QSA from there on, a little above the break-even. A block that the GGUF stores
with QSA (the self-contained file) is unchanged by every setting.
Switching in the middle of a request needs the indexer state of the whole context: the indexer keys of every
cell and the pooled keys of the completed blocks. So with auto (and on) the draft memory keeps the indexer
cache and every draft decode, dense or not, writes the keys and re-pools the blocks it completes; only the
selection (the pooled key gather, the lightning indexer, the top-k and the sparse attention) is left out of a
dense step. That costs about 1 ms per round (1.6%) on a short context, with identical output, and nothing on
a context whose cache can never reach the length (n_ctx per sequence below 40960 behaves as off and keeps no
state). The k-pool input of a dense step is the light one, without the four pool inputs nothing reads: such
inputs without a consumer corrupted the draft decode at about 4.8K positions.
A request that crosses the length, in the prefill or in the generation, gives the same tokens and the same
draft acceptance as always-QSA (4096 prompt, switch in the prefill: identical 512 tokens, 297/426 drafts;
49152 prompt: identical 256 tokens, 148/213 drafts). On a 64K context the shared head with auto is 3% to 7%
faster per round than with dense attention (sweep, and matched text over 200 tokens).
Co-authored-by: Cursor <cursoragent@cursor.com>
A verify batch only stashes the target hidden rows. The next draft step decodes the accepted rows and the new token together, with logits on the last row, so the draft weights are read once. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds a 64x64 shared-memory transpose for F32 dim-0 CONCAT with a contiguous prefix and a transposed second input on RDNA3.5.
2. SCALE + SILU fusion 3. Short-row CONCAT: one thread per element 4. ADD + UNARY + MUL fusion 5. Shared expert gate multiply-add fusion 6. Up to 1024 threads for small f32 matmuls
…and the narrow q8_0 down Co-authored-by: Cursor <cursoragent@cursor.com>
…q8_0 down Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…rnels on RDNA3.5 Decode (one token) of qwen4exp on RDNA3.5: - hyper-connections: the pre-mix with its gate product and injection, SCALE -> SILU in the MMVQ, and the post-combine with the next RMS_NORM + MUL and its q8_1 copy - MoE: the routed and shared expert gate/up with the GLU in one kernel, the down stage with the weighted sum and the shared gate in another, cheaper sign handling of the IQ grid types - the F32 router GEMV and the top-k selection in one kernel, reading BF16 copies of the router weights made before graph capture (GGML_CUDA_ROUTER_F32 keeps the F32 weights) - gated delta net: the state read in place, the convolution step with the q/k norms, alpha/beta in one kernel, the output norm and sigmoid gate in the z MMVQ - QSA: the k-pool step in one kernel, top_k writing its columns directly - flash attention, 256/256 decode tile: two warp groups split DV, 5 stream-k blocks per WGP All but the BF16 router and the stream-k split keep the greedy output of the previous build. With them, against the previous build (wikitext-2, 4 x 2048, one token per ubatch): KLD 0.0153, top-1 agreement 97.1%, PPL ratio 0.9987, within the spread of the previous build itself between ubatch sizes 1 and 512 (KLD 0.0155, top-1 96.8%). Strix Halo, p2048 n128 decode: 39.0 -> 32.0 ms/token.
…e qwen4exp decode branch Where both add the same fusion (the shared expert gated residual, scale + silu), the decode branch's kernels are kept.
Each warp takes a contiguous chunk of the tokens, so the compact rows stay sorted by token and the output is unchanged. A prompt batch of 2048 tokens takes 0.18 instead of 0.71 ms per call on Strix Halo.
The fused RMS norm + inject of a prompt batch also writes the D4 q8_1 copy that the Q8_0 MMQ of the HC down projection reads, quantized as quantize_mmq_q8_1 does, so that MMQ skips its quantization.
Their kernels use all 256 VGPRs and spill, so a MoE prompt batch with about 20 tokens per expert takes the 48 column tile instead. A 2048 token prompt with -ub 1024 takes 3.01 instead of 3.21 s on Strix Halo.
… on RDNA3.5 Prompt batches of qwen4exp on RDNA3.5 (gfx1151): - moe-wmma: BF16 WMMA expert GEMMs over a weight layout repacked in place at graph start (gate+up+SWIGLU fused, down writes BF16 rows, empty column groups skipped); the fused decode MoE GEMVs (mmvq) read the repacked experts; test-backend-ops cases for the Qwen shapes - hc-wmma: the HC mix of a prompt batch in two kernels (up + pre, and the down split by stream with the inject merged and a fixed summation order), the combine of a block fused with the mix of the next one, and a BF16 copy of the mixed stream that the dense and MoE GEMMs read directly - gated_delta_net: a chunked prompt kernel for S_v 128 with a scalar gate - dense-wmma: a BF16 WMMA GEMM for the dense projections in place of hipBLASLt (tiled weight copies made at graph start, 128/256 row tiles, consecutive MUL_MATs of the same input in one launch); hipBLAS is pre-warmed so its first use is not inside the first prompt - mul_mat_f32_few_rows for F32 weights of at most 8 rows - the ssm_out gate fused with its q8_1 quantization; MoE weighted reduction reading BF16 expert rows GGML_CUDA_NO_DENSE_WMMA, GGML_CUDA_NO_HC_WMMA, GGML_CUDA_NO_HC_POST_MIX and GGML_CUDA_NO_MOE_DOWN_BF16 turn the paths off.
… first layers From 64 tokens on, the PLE gather is ordered after the layers before the PLE layer and the row prefetch runs on a background thread. The scheduler skips the cross-backend synchronization before a small CPU split without inputs whose results overlap no memory that the earlier splits read or write (an integrated GPU reads host buffers in place, so the check covers inputs copied asynchronously from host buffers).
From 32 tokens on, the inject matmul of an HC mix is expanded into the graph as soon as the normalized streams exist, so it sits next to the norm where the CUDA HC mix kernel finds it, without a backend reordering of the graph.
…se WMMA GEMM The F32 weights of a prompt batch (the MoE router, the alpha and beta gates of the linear attention) go to a variant of the dense BF16 WMMA kernel that reads both operands in place as F32 and splits them into BF16 high and residual parts on the way to the LDS: lo*hi + hi*lo + hi*hi, or lo*hi + hi*hi for weights that hold BF16 values only (checked once per weight at graph start, true for the Qwen routers and gates). BF16 operands alone cost measurable quality; the residual of the activations brings the KLD back within range. The last row tile may be partial (gates of 48 rows). The products of one input are grouped also while an earlier group still has products to skip, and qwen4exp places the alpha and beta products of a prompt batch next to each other, so that they run in one launch. GGML_CUDA_NO_DENSE_F32 keeps the F32 weights on their previous kernels.
…batch in one kernel The CONCAT of the conv state and the raw input, SSM_CONV, SILU and the L2 norms (RMS_NORM, SCALE) of q and k in front of the gated delta net become one kernel that reads the raw input and the conv state in place: a block per head and 32 tokens, v into the SILU output, q and k into the SCALE outputs. The arithmetic is that of the nodes (the norm as rms_norm_f32 reduces a row of 128), so the results are bit for bit the same. qwen4exp orders the gate, beta and state of a prompt batch before the convolution and writes the conv state back after the GDN, so that the chain follows the CONCAT directly. GGML_CUDA_NO_GDN_CONV turns the kernel off.
…pert rows moe_weighted_reduction_x4<T, N> loads the rows of all N experts of a token (F32, or the BF16 rows of the MoE down products) 4 columns per thread and sums them as moe_weighted_reduction_f32 does, bit for bit.
donghanbj
marked this pull request as draft
November 29, 2026 19:05
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.
Overview
Lowers prefill time (TTFT) and raises decode speed for Qwen3.8-Flash-Next (
qwen4exp, UD-IQ4_XS) on Strix Halo (gfx1151). The branch starts athalo-perf-opt-rocm(b1a040d) and adds 47 commits in three parts:mm_ids_helperscans the tokens of an expert with 8 warps.The MoE WMMA path is opt-in: set
GGML_CUDA_MOE_WMMA=1. All numbers below use it.Additional information
Strix Halo (Ryzen AI Max+ 395, Radeon 8060S), TheRock 10.3 nightly.
Server, natural-text prompts of the exact length over streamed chat completions:
llama-server -b 4096 -ub 2048 -fa on --ctx-checkpoints 0 --load-mode dio, 256 output tokens, no speculative decoding, median of 4 runs (131K: 1 run for the baseline). TTFT / decode:The two columns come from two machines of the same model: the baseline ran at the default power level (no sudo there), this PR with the perf level set to high.
Baseline without and with MTP, same client and machine as the baseline column above (MTP: Q4_K draft,
--spec-type draft-mtp --spec-draft-n-max 3):With MTP the draft model also prefills the prompt, so TTFT grows by 1-7%. This PR with MTP was only measured in the long generations below.
Quality,
llama-perplexityKL divergence against the F16 model (wiki.test.raw, ctx 2048, 4 chunks, ub 2048): mean KLD 0.015471, same top token 96.92%, PPL ratio 1.0010. For scale, the baseline's own batch-size variance (ub 512 against ub 1) is KLD 0.0155, 96.82%, 0.9960. The BF16 WMMA paths change the numerics; the fusions of 25b2305 and a9c5e45 are bit-identical.At ub 1024, against the baseline's ub 1 logits, the KLD is 0.0161 with 96.65% same top token and PPL ratio 0.9915, slightly above that variance. The value is the same before the prefill commits, so it comes from the merged decode and #221 changes.
Tests (
test-backend-opson ROCm0): MUL_MAT_ID 1055/1055, GATED_DELTA_NET 43/43, SSM_CONV 60/60, CONCAT 221/221.More measurements of this PR
All on one Strix Halo with the perf level set to high, UD-IQ4_XS unless noted. "Without #221" is the same decode and prefill work on b1a040d without the #221 merge (branch
donghan/qwen4exp-prefill-rdna35-np); it shows what the sparse QSA attention of #221 adds.2K prompt,
llama-completion(2064 tokens):Prompt length,
llama-completion -b 4096 -ub 4096, TTFT / decode:Long generations (
llama-server, code prompts sent as token ids, 8192 generated tokens withignore_eos,-b 2048 -ub 2048, 1 run), TTFT / decode:The MoE WMMA kernels cover the IQ expert types; the Q4_K_XL experts stay on MMQ.
Long generations without and with MTP, this PR (MTP: shared-embedding Q8_0 draft, 3 draft tokens). With greedy decoding and 8192 forced tokens the outputs fall into repetition loops, which inflates the acceptance and the MTP decode rate, so the time per verify cycle (MTP) next to the time per token (no MTP) is the comparison that does not depend on the acceptance.
UD-IQ4_XS:
UD-Q4_K_XL:
A cycle verifies the 3 draft tokens plus one: it pays off when more than about 1.1 tokens (IQ4_XS, 67.3 / 31.7 - 1) of each draft are accepted on average. On normal text (2048 generated tokens, end of sequence allowed; measured on the branch without #221 with the Q4_K draft) the acceptance was 65%, about 2.96 tokens per cycle, which gives an estimated decode speedup of about 1.4x at these cycle times.
ubatch size, the long-generation server flags with
-b=-ub: 32K takes 25.70 s at ub 2048, 24.19 s at ub 4096 and 23.94 s at ub 8192; 120K takes 102.83 s at ub 2048 and 96.00 s at ub 8192. Decode does not change.Requirements