[Perf][Engram] Serialize offloaded lookups and pack host tables into huge pages (#56926)

Signed-off-by: Juntian Liu <Juntianl777@gmail.com>
Co-authored-by: Kimi Code <noreply@moonshot.cn>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Juntian Liu
2026-09-25 10:52:02 +08:00
committed by GitHub
co-authored by Kimi Code Claude Fable 5.1 mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 48d8880d09
commit 6936e77ba4
6 changed files with 257 additions and 12 deletions
+9
View File
@@ -50,10 +50,19 @@ class EngramConfig:
the other settings allow it, falling back to per-replica tables when DP
replicas are not co-located on one node or /dev/shm cannot hold them."""
use_thp: bool = False
"""Back private CPU-offloaded tables with transparent huge pages (best
effort, falls back to ordinary pinned pages). Prefaulting the tables at
startup takes longer. Requires cpu_offload without dp_shared_memory."""
@model_validator(mode="after")
def _validate_shared_memory(self) -> Self:
if self.dp_shared_memory and not self.cpu_offload:
raise ValueError("dp_shared_memory requires cpu_offload=True")
if self.use_thp and (not self.cpu_offload or self.dp_shared_memory):
raise ValueError(
"use_thp requires cpu_offload=True and dp_shared_memory=False"
)
return self
def verify_model_config(self, model_config: "ModelConfig | None") -> None: