[GH-ISSUE #5268] [Engine] qwen35moe on a Tesla P40 (sm_61): decode falls from 67 to 11 tok/s as the prompt grows to 24K (same GGUF on llama.cpp holds 69-78) #3136

Open
opened 2026-11-07 14:38:21 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @sarge18 on GitHub (Nov 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5268

Area

[Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source?

Terminal (the strata command)

What happened

On a Tesla P40 (sm_61, experimental CUDA 12 path), the Qwen3.6-35B-A3B own-engine path (qwen35moe, strata-q36) decodes at 67 tok/s on a short prompt, but decode speed falls steeply as the prompt grows: 50.7 tok/s at a 4K prompt, 21.1 at 12K, 13.0 at 16K and 10.9 at 24K. The same GGUF on the same card under llama.cpp v0.9.0 (--spec-type draft-mtp --spec-draft-n-max 2) holds 69–78 tok/s over the same prompts. Without drafting, llama.cpp still holds 42–46.

Drafting does not explain it: acceptance stays high at every length (18 of 20 at 24K). The cost per generated token grows with the context. Prefill does not show the same drop: 790 / 778 / 663 tok/s at 4K / 12K / 24K.

From the engine's own lines (one P40, greedy, thinking off, 32K window):

strata serve: session 0: prompt 4124 tokens = 0 reused + 4124 read in 5221 ms (790.0 tok/s), 31 generated in 612 ms (50.7 tok/s), drafts accepted 20 of 22 (stop)
strata serve: session 0: prompt 12056 tokens = 0 reused + 12056 read in 15488 ms (778.4 tok/s), 28 generated in 1327 ms (21.1 tok/s), drafts accepted 19 of 20 (stop)
strata serve: session 0: prompt 15920 tokens = 0 reused + 15920 read in 21183 ms (751.5 tok/s), 64 generated in 4940 ms (13.0 tok/s), drafts accepted 37 of 56 (length)
strata serve: session 0: prompt 23952 tokens = 0 reused + 23952 read in 36132 ms (662.9 tok/s), 29 generated in 2657 ms (10.9 tok/s), drafts accepted 18 of 20 (stop)

The numbers repeat to within ±0.1 tok/s across two runs, and the 16K case falls in 11.6–13.0 over three repetitions. The load line is strata-q36: hybrid experts: 168 of 256 per layer in VRAM (12.30 GiB), all 18.75 GiB in pinned host memory, so a third of each layer's experts stay in host memory. Possibly related: #3303 (the q36 KV cache is fp32 with no --kv option). I have not profiled whether the time goes to attention over the KV cache or to something else. I also do not know whether newer cards show the same curve; this may be specific to the P40, which has very slow FP16. Decode by context length on any supported card would show whether it is P40-only.

Smallest steps or command that reproduce it

Config written by strata install --family qwen36 --model UD-Q4_K_XL --cuda 12 --gpu 1 --context 32768 (engine command as launched):

strata --serve --native Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf --max-context 32768 --prefill auto --mtp 2

Then send one greedy request (temperature 0, top_k 1, and presence_penalty 0, frequency_penalty 0, repetition_penalty 1 set explicitly, see #3354) with a ~4K, ~12K and ~24K token prompt and max_tokens 64. Compare the "generated in … tok/s" figure in the engine log.

Reproduction status

Reproduced locally

Strata version

0.2.10 (Terminal), engine package 0.1.56 linux-x86_64-cuda-cuda12 (signed, from the v0.2.10 feed)

Graphics card, memory and system

1× Tesla P40 24 GB (sm_61; 22.4 GiB usable) of two in a Dell R730, 2× Xeon E5-2698 v4 (no AVX-512), 499 GiB RAM, Ubuntu 26.04, driver 580.173.02. The engine runs pinned to the GPU's NUMA node (numactl --cpunodebind=1 --preferred=1). Nothing else ran on the card.

Model, size and settings

Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf, 22,853,663,008 bytes, sha256 55983c5a…e9f1 (the setup.py pin). 32K context, --mtp 2, one request at a time, thinking off.

Logs

The four request lines are above. Comparison on the same machine and file: llama.cpp v0.9.0 (cd959bae, built for sm_61), -ngl 99 --n-cpu-moe 0 -fa on, all experts in VRAM: decode 73.9 / 77.6 / 68.7 tok/s at 4K / 12K / 24K with draft-mtp n_max 2, and 46.0 / 44.5 / 42.4 without drafting.


Measured and written up with the help of an AI assistant (Claude); the numbers come from the engine's own log lines quoted above.

Originally created by @sarge18 on GitHub (Nov 5, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5268 ### Area [Engine] (speed, kernels, models, the server and API) ### Desktop app, Terminal or source? Terminal (the `strata` command) ### What happened On a Tesla P40 (sm_61, experimental CUDA 12 path), the Qwen3.6-35B-A3B own-engine path (`qwen35moe`, `strata-q36`) decodes at 67 tok/s on a short prompt, but decode speed falls steeply as the prompt grows: **50.7 tok/s at a 4K prompt, 21.1 at 12K, 13.0 at 16K and 10.9 at 24K**. The same GGUF on the same card under llama.cpp v0.9.0 (`--spec-type draft-mtp --spec-draft-n-max 2`) holds 69–78 tok/s over the same prompts. Without drafting, llama.cpp still holds 42–46. Drafting does not explain it: acceptance stays high at every length (18 of 20 at 24K). The cost per generated token grows with the context. Prefill does not show the same drop: 790 / 778 / 663 tok/s at 4K / 12K / 24K. From the engine's own lines (one P40, greedy, thinking off, 32K window): ``` strata serve: session 0: prompt 4124 tokens = 0 reused + 4124 read in 5221 ms (790.0 tok/s), 31 generated in 612 ms (50.7 tok/s), drafts accepted 20 of 22 (stop) strata serve: session 0: prompt 12056 tokens = 0 reused + 12056 read in 15488 ms (778.4 tok/s), 28 generated in 1327 ms (21.1 tok/s), drafts accepted 19 of 20 (stop) strata serve: session 0: prompt 15920 tokens = 0 reused + 15920 read in 21183 ms (751.5 tok/s), 64 generated in 4940 ms (13.0 tok/s), drafts accepted 37 of 56 (length) strata serve: session 0: prompt 23952 tokens = 0 reused + 23952 read in 36132 ms (662.9 tok/s), 29 generated in 2657 ms (10.9 tok/s), drafts accepted 18 of 20 (stop) ``` The numbers repeat to within ±0.1 tok/s across two runs, and the 16K case falls in 11.6–13.0 over three repetitions. The load line is `strata-q36: hybrid experts: 168 of 256 per layer in VRAM (12.30 GiB), all 18.75 GiB in pinned host memory`, so a third of each layer's experts stay in host memory. Possibly related: #3303 (the q36 KV cache is fp32 with no `--kv` option). I have not profiled whether the time goes to attention over the KV cache or to something else. I also do not know whether newer cards show the same curve; this may be specific to the P40, which has very slow FP16. Decode by context length on any supported card would show whether it is P40-only. ### Smallest steps or command that reproduce it Config written by `strata install --family qwen36 --model UD-Q4_K_XL --cuda 12 --gpu 1 --context 32768` (engine command as launched): ``` strata --serve --native Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf --max-context 32768 --prefill auto --mtp 2 ``` Then send one greedy request (temperature 0, top_k 1, and `presence_penalty 0`, `frequency_penalty 0`, `repetition_penalty 1` set explicitly, see #3354) with a ~4K, ~12K and ~24K token prompt and `max_tokens` 64. Compare the "generated in … tok/s" figure in the engine log. ### Reproduction status Reproduced locally ### Strata version 0.2.10 (Terminal), engine package `0.1.56 linux-x86_64-cuda-cuda12` (signed, from the v0.2.10 feed) ### Graphics card, memory and system 1× Tesla P40 24 GB (sm_61; 22.4 GiB usable) of two in a Dell R730, 2× Xeon E5-2698 v4 (no AVX-512), 499 GiB RAM, Ubuntu 26.04, driver 580.173.02. The engine runs pinned to the GPU's NUMA node (`numactl --cpunodebind=1 --preferred=1`). Nothing else ran on the card. ### Model, size and settings Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf, 22,853,663,008 bytes, sha256 `55983c5a…e9f1` (the `setup.py` pin). 32K context, `--mtp 2`, one request at a time, thinking off. ### Logs The four request lines are above. Comparison on the same machine and file: llama.cpp v0.9.0 (`cd959bae`, built for sm_61), `-ngl 99 --n-cpu-moe 0 -fa on`, all experts in VRAM: decode 73.9 / 77.6 / 68.7 tok/s at 4K / 12K / 24K with draft-mtp n_max 2, and 46.0 / 44.5 / 42.4 without drafting. --- *Measured and written up with the help of an AI assistant (Claude); the numbers come from the engine's own log lines quoted above.*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3136
No description provided.