Skip to content

llama-bench: add kv-offload/workspace sweep flags - #70

Draft
Piggidragon wants to merge 1 commit into
GenerelSchwerz:llama/devfrom
Piggidragon:bench/kv-workspace-flags
Draft

llama-bench: add kv-offload/workspace sweep flags#70
Piggidragon wants to merge 1 commit into
GenerelSchwerz:llama/devfrom
Piggidragon:bench/kv-workspace-flags

Conversation

@Piggidragon

Copy link
Copy Markdown

Summary

  • --kv-gpu-layers, --kv-cpu-pinned, --recurrent-state-offload, --phase-aware-workspace, and --live-context-workspace exist as CLI/server context params (common/arg.cpp) but were never wired into llama-bench's own arg parser (it doesn't use common_params_parse, so new flags need a manual port).
  • Adds them to cmd_params / cmd_params_instance / test the same way the existing no_kv_offload / no_op_offload flags are handled: sweepable <0|1> lists for the four booleans (-kvcp, -rso, -paw, -lcw), a sweepable int list for kv-gpu-layers (-kvgl), applied on llama_context_params in to_llama_cparams().
  • These only affect context params (not model params), so equal_mparams() is unchanged and model reuse between test instances is unaffected.
  • Documented in tools/llama-bench/README.md.

Test plan

  • cmake --build --target llama-bench succeeds
  • llama-bench --help shows the new flags with correct defaults
  • llama-bench -m <missing> -kvgl 4,8 -kvcp 1 -paw 0,1 -o csv reaches model-load (parsing succeeds) and the CSV header includes the new columns in the right place
  • -o md only shows columns for values that were actually swept/changed from default (matches existing convention for no_kv_offload etc.)

🤖 Generated with Claude Code

https://claude.ai/code/session_012ghb3E6Q59LzHoLebeGzEu

kv-gpu-layers, kv-cpu-pinned, recurrent-state-offload,
phase-aware-workspace, and live-context-workspace exist as CLI/server
context params (common/arg.cpp) but were never ported to llama-bench's
own arg parser, so they could not be swept like the other KV-offload
flags (no-kv-offload, no-op-offload). Wire them into cmd_params,
cmd_params_instance, and test the same way no_kv_offload/no_op_offload
already are: sweepable <0|1> lists for the four bools, a sweepable int
list for kv-gpu-layers, applied on llama_context_params in
to_llama_cparams(). They only affect context params, not model params,
so equal_mparams() is unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ghb3E6Q59LzHoLebeGzEu
@github-actions github-actions Bot added documentation Improvements or additions to documentation examples labels Sep 4, 2026
@Piggidragon
Piggidragon marked this pull request as draft September 5, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant