Skip to content

perf: EP-aware DBCache default (CPU 0.25 on, GPU off) - #7

Merged
KakaruHayate merged 2 commits into
mainfrom
feature/perf-ep-aware-dbcache
Aug 16, 2026
Merged

perf: EP-aware DBCache default (CPU 0.25 on, GPU off)#7
KakaruHayate merged 2 commits into
mainfrom
feature/perf-ep-aware-dbcache

Conversation

@KakaruHayate

Copy link
Copy Markdown
Owner

Measured (10s clip, seed 42):\n- CPU nsteps=8: cache ON 14.0s vs OFF 25.4s (big win)\n- Vulkan nsteps=8: Q8 cache ON 1.05s vs OFF 0.88s (regression); F32 ON 0.62s vs OFF 0.67s (marginal win)\n\nSo the blanket 'DBCache on for multi-step' (PR #4) default is wrong on GPU, especially with quantized weights (split-path per-step host round trips). Make it EP-aware:\n\n- \db_cache_threshold\ default -1 = auto: CPU -> 0.25, GPU backends (vulkan/cuda/metal) -> 0 (off)\n- explicit --cache-threshold (incl. 0) unchanged\n- README EN/CN updated\n\nVerified locally: CPU n8 default keeps cache (14.1s / 33 notes); Vulkan Q8 n8 default now cache-off 0.912s / 33 notes.

Measured: DBCache's split path helps CPU (-45% at nsteps=8) but on GPU the
per-step host round-trips regress quantized weights (Vulkan+Q8 nsteps=8:
cache ON 1.05s vs OFF 0.88s = +20%; F32: ON 0.62s vs OFF 0.67s = minor
benefit). Make the default EP-aware instead of blanket-on:

- InferParams.db_cache_threshold default becomes -1 (auto): CPU -> 0.25,
  GPU backends (vulkan/cuda/metal) -> 0 (off); explicit values unchanged
- CLI: --cache-threshold default 'auto'; help updated
- README EN/CN: document the EP-aware default
ggml_backend_name returns 'Vulkan0' (etc.), so the exact lowercase match missed; use case-insensitive substring so GPU defaults to DBCache-off.
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 538a12e0-79fe-4c28-934a-13e339f5d54c


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@KakaruHayate
KakaruHayate merged commit a7ee42a into main Aug 16, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant