[GH-ISSUE #2406] Image encoder on the GPU costs ~35-44% decode and ~40% prompt speed on a 16 GB card (DETAILS.md says 2-8%) #971

Closed
opened 2026-11-04 01:47:25 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @olituks on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2406

Setup: RTX 4080 SUPER 16 GB (PCIe 4.0 x16), Ryzen 7 7800X3D, 64 GB RAM, Windows 11, driver 616.92 (CUDA 13.4),
Strata 0.1.44.1 (296b59d2), IQ3_S, 196,608-token context, KV q4_0 + --kv-grow, calibrated settings.

What changed: only "vision": {"gpu": true} -> "gpu": false in strata-iq3_s.json. Engine args identical.

Results (BENCH.bat --long, 3 runs each, medians; full report in #2404 ):

Vision on GPU Vision on CPU Change
Chat decode tok/s 65.7 88.6 +34.9%
Agent session decode tok/s 68.1 98.1 +44.1%
4K prompt tok/s 1590 2165 +36.1%
16K prompt tok/s 2125 3456 +62.6%
32K prompt tok/s 2150 3489 +62.3%
Agent turn TTFT s 2.37 1.85 -22%

Engine facts from the two runs:

Vision on GPU Vision on CPU
expert_slots 4023 4552
expert_cache_mib 7862 8888
vram_free_mib 61 87

The vision-on-CPU result was reproduced in a second, separate engine start (prompt throughput within 0.3%, decode
within 5%). A real agent session afterwards (~90K tokens in context) generated at 97 tok/s with an 81.8% expert-cache
hit (72-80% before the change).

Why I'm reporting it: DETAILS.md ("Speed with images on") describes the GPU encoder as 2-8% slower, from ~1,000
fewer experts in VRAM. Here the cache gained 529 experts (+13%, about 1 GiB), but speed went up 35-62%. vram_free_mib
is almost the same in both runs, so it does not look like the engine simply had more headroom.

Questions:

  • Is this expected on a 16 GB card at a long context, for example because --prefill auto borrows expert-cache slots
    and gets larger chunks with a bigger cache?
  • Could the encoder's VRAM (the reservation, or its CUDA context while idle) cost more than its size suggests?
  • If it is expected, setup could recommend --vision cpu on 16 GB cards and DETAILS.md could mention it.

Happy to run more tests (logs, --dump-routing, a specific build) if useful.

Originally created by @olituks on GitHub (Oct 14, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/2406 **Setup:** RTX 4080 SUPER 16 GB (PCIe 4.0 x16), Ryzen 7 7800X3D, 64 GB RAM, Windows 11, driver 616.92 (CUDA 13.4), Strata 0.1.44.1 (296b59d2), IQ3_S, 196,608-token context, KV q4_0 + `--kv-grow`, calibrated settings. **What changed:** only `"vision": {"gpu": true}` -> `"gpu": false` in `strata-iq3_s.json`. Engine args identical. **Results** (`BENCH.bat --long`, 3 runs each, medians; full report in #2404 ): | | Vision on GPU | Vision on CPU | Change | | --- | ---: | ---: | ---: | | Chat decode tok/s | 65.7 | 88.6 | +34.9% | | Agent session decode tok/s | 68.1 | 98.1 | +44.1% | | 4K prompt tok/s | 1590 | 2165 | +36.1% | | 16K prompt tok/s | 2125 | 3456 | +62.6% | | 32K prompt tok/s | 2150 | 3489 | +62.3% | | Agent turn TTFT s | 2.37 | 1.85 | -22% | Engine facts from the two runs: | | Vision on GPU | Vision on CPU | | --- | ---: | ---: | | `expert_slots` | 4023 | 4552 | | `expert_cache_mib` | 7862 | 8888 | | `vram_free_mib` | 61 | 87 | The vision-on-CPU result was reproduced in a second, separate engine start (prompt throughput within 0.3%, decode within 5%). A real agent session afterwards (~90K tokens in context) generated at 97 tok/s with an 81.8% expert-cache hit (72-80% before the change). **Why I'm reporting it:** DETAILS.md ("Speed with images on") describes the GPU encoder as 2-8% slower, from ~1,000 fewer experts in VRAM. Here the cache gained 529 experts (+13%, about 1 GiB), but speed went up 35-62%. `vram_free_mib` is almost the same in both runs, so it does not look like the engine simply had more headroom. Questions: - Is this expected on a 16 GB card at a long context, for example because `--prefill auto` borrows expert-cache slots and gets larger chunks with a bigger cache? - Could the encoder's VRAM (the reservation, or its CUDA context while idle) cost more than its size suggests? - If it is expected, setup could recommend `--vision cpu` on 16 GB cards and DETAILS.md could mention it. Happy to run more tests (logs, `--dump-routing`, a specific build) if useful.
Author
Owner

@olituks commented on GitHub (Oct 17, 2026):

<html> <html><head></head>

Follow-up with a controlled test on 0.1.45 (same machine, same config, --host-core last; only the vision setting and --vram-reserve-mib change; BENCH.bat --long, 3 runs each, medians). Slots and free VRAM are from the engine log; per-process VRAM from \GPU Process Memory(*)\Dedicated Usage during the run.

Config Expert slots Free at load Min free while capturing verify windows strata / strata-vision VRAM Agent decode tok/s Chat decode tok/s 32K prompt tok/s
encoder on CPU, reserve 350 4550 87 MiB 0 MiB ~15 GB / - 99.5 90.0 3500
B1: encoder on GPU, reserve 350 4021 0 MiB 0 MiB 14023 / 1234 MB 59.7 55.2 2107
B2: encoder on GPU, reserve 1500 3383 1200 MiB 1084 MiB 13162 / 1290 MB 88.9 82.9 3467

What this shows:

  • The slowdown is not the expert count: B2 has 16% fewer slots than B1 and is ~50% faster (prompt +65%).
  • It is not the encoder process being present either: in B2 it still holds 1.29 GB on the GPU.
  • Zero free VRAM alone is not enough: with the encoder on the CPU the engine also reaches 0 MiB while capturing its verify windows and stays fast. The 40% loss appears when the card is full AND a second process holds VRAM.
  • B2 vs encoder-on-CPU (-8 to -11% decode, -1% long prompts) is in line with the 3-5% you measured on Linux plus the extra cache given up to the reserve.

My guess (not verified) is WDDM paging GPU memory to system RAM when two processes share a full card, which Linux does not do and would explain why it does not reproduce there. The GPU-encoder path might be fine on Windows with ~1.2 GB left free; the CPU default for cards under 24 GB avoids it altogether.

Correction to my earlier comment: the prompt chunk and the startup "free" figure were not the cause.

Feel free to close this if the CPU default is the intended fix; I’m happy to run the Sysmem Fallback test if you want the mechanism confirmed.

</html> </html>
<!-- gh-comment-id:6233286751 --> @olituks commented on GitHub (Oct 17, 2026): <html> <body> <!--StartFragment--><html><head></head><body><p>Follow-up with a controlled test on 0.1.45 (same machine, same config, <code>--host-core last</code>; only the vision setting and <code>--vram-reserve-mib</code> change; <code>BENCH.bat --long</code>, 3 runs each, medians). Slots and free VRAM are from the engine log; per-process VRAM from <code>\GPU Process Memory(*)\Dedicated Usage</code> during the run.</p> Config | Expert slots | Free at load | Min free while capturing verify windows | strata / strata-vision VRAM | Agent decode tok/s | Chat decode tok/s | 32K prompt tok/s -- | -- | -- | -- | -- | -- | -- | -- encoder on CPU, reserve 350 | 4550 | 87 MiB | 0 MiB | ~15 GB / - | 99.5 | 90.0 | 3500 B1: encoder on GPU, reserve 350 | 4021 | 0 MiB | 0 MiB | 14023 / 1234 MB | 59.7 | 55.2 | 2107 B2: encoder on GPU, reserve 1500 | 3383 | 1200 MiB | 1084 MiB | 13162 / 1290 MB | 88.9 | 82.9 | 3467 <p>What this shows:</p> <ul> <li>The slowdown is not the expert count: B2 has 16% fewer slots than B1 and is ~50% faster (prompt +65%).</li> <li>It is not the encoder process being present either: in B2 it still holds 1.29 GB on the GPU.</li> <li>Zero free VRAM alone is not enough: with the encoder on the CPU the engine also reaches 0 MiB while capturing its verify windows and stays fast. The 40% loss appears when the card is full AND a second process holds VRAM.</li> <li>B2 vs encoder-on-CPU (-8 to -11% decode, -1% long prompts) is in line with the 3-5% you measured on Linux plus the extra cache given up to the reserve.</li> </ul> <p>My guess (not verified) is WDDM paging GPU memory to system RAM when two processes share a full card, which Linux does not do and would explain why it does not reproduce there. The GPU-encoder path might be fine on Windows with ~1.2 GB left free; the CPU default for cards under 24 GB avoids it altogether.</p> <p>Correction to my earlier comment: the prompt chunk and the startup "free" figure were not the cause.</p> <p>Feel free to close this if the CPU default is the intended fix; I’m happy to run the Sysmem Fallback test if you want the mechanism confirmed.</p></body></html><!--EndFragment--> </body> </html>
Author
Owner

@Niko1221 commented on GitHub (Oct 19, 2026):

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6271015609 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#971
No description provided.