n-gram table: --ngram-table ram reads it from a locked copy in RAM

embed_lookup_q reads the n-gram table through a row cache and direct reads,
and about half of a step's rows are first-seen, so steps wait on the drive.
--ngram-table ram (default disk, unchanged) copies the table into locked
huge pages in the background, checks the copy against the mapping and then
serves the gather from memory. MemAvailable, RLIMIT_MEMLOCK and the cgroup
limit are checked first; if any is short the table stays on disk. The flag
reaches the plugin as an optional `resident` parameter of embed_lookup_q.
This commit is contained in:
keptn42 authored and StillDeadcode committed 2026-10-05 12:52:50 +02:00
1 parent 4252353bc2
commit e6c8a3d7fa
18 files changed
+363 -56

No files matched your search

+5
View File
@@ -91,6 +91,11 @@ Every one of these options is needed:
- **`--network host`**: the server binds the host's addresses directly, IPv4 and IPv6, with no
NAT in front of it.
And one more for `--ngram-table ram`: **`--ulimit memlock=-1`**. The copy of the n-gram table is
locked in RAM, and Docker's default memlock limit is far below its 47.7 GiB; without it the server
says so at the first request and reads the table from the container as it does by default.
`deploy/compose/common.yaml` sets it.
The image sets `GPU_MAX_ALLOC_PERCENT=100` and `GPU_MAX_HEAP_SIZE=100`. The HIP runtime's defaults
cap one allocation, and the heap, below what the placement plan hands out.