Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions internal/backend/llama.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,23 @@ func (b *LlamaBackend) startLocked(ctx context.Context) error {
"--embeddings",
"--pooling", "last",
"--ctx-size", strconv.Itoa(b.cfg.CtxSize),
// Embedding-only workload: every prompt is unique, so the prompt cache
// (default cap 8 GiB) grows ~14 MiB per request at a ~0% hit rate —
// disable it. Likewise skip REPACK's private anonymous copy of the
// weights so they stay on the shared, reclaimable mmap (-640 MiB
// resident, ~+20% embed latency on CPU). One slot instead of auto(4):
// embeds are short one-shot requests, and 4 slots quadruple the KV
// cache (~940 MiB at ctx 2048) for concurrency this workload lacks.
"--cache-ram", "0",
"--no-repack",
"--parallel", "1",
// Smaller physical batch + quantized KV: compute scratch scales with
// ubatch and the KV with ctx×precision; neither changes results or the
// max input length, only peak memory (and adds modest latency).
"--batch-size", "256",
"--ubatch-size", "256",
"--cache-type-k", "q8_0",
"--cache-type-v", "q8_0",
"--host", b.cfg.Host,
"--port", "0", // OS-assigned
}
Expand Down
Loading