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

+2 -1
View File
@@ -158,7 +158,8 @@ endif()
# runs embed_lookup_q over a file-backed table with two ranks and the read-ahead racing: the path a
# model's host gather takes and that no geometry reaches. It writes its table beside itself, where
# the filesystem reports its direct-I/O alignment, and again in TMPDIR, where a tmpfs reports none
# and the gather aligns its reads by the block size, as it does on btrfs.
# and the gather aligns its reads by the block size, as it does on btrfs. And once with `resident`,
# from the table's copy in RAM where the process may lock it.
if(TARGET libavx AND TARGET rad-avx-check)
add_test(NAME avx_check
COMMAND rad-avx-check --ref ${RAD_PLUGIN_OUT}/kernels/libref.so