Repository navigation
moe: continuous adaptive expert cache eviction with exponential decay - #38
code-martin wants to merge 2 commits into
Conversation
…ision - Replace static cudaMalloc with CUDA Virtual Memory Management (cuMemAddressReserve, cuMemCreate, cuMemMap/cuMemUnmap, cuMemSetAccess) - Add graceful fallback to cudaMalloc on devices without VMM support - Preserve base virtual address space across resizes so that CUDA graph captures and slot pointers remain valid - Add shrink() and grow() methods to ExpertCache - Add RESIZE <bytes> and GROW <bytes> interactive stdin commands to strata engine - Start StrataEngine before Vision in main() so the model sees full free VRAM - Keep vision encoder idle at server boot (0 bytes VRAM allocated during text gen) - Spawn strata-vision.exe on-demand inside Vision.encode() only while encoding - Coordinate engine VMM shrink (resize) before vision startup and grow after exit - Recover 500+ expert cache slots (~2460 vs 1840) on 10-12 GB GPUs
- Track routing usage frequencies per layer during token generation - Implement dynamic expert swapping between VRAM resident slots and host RAM - Add exponential frequency decay (0.985 factor per round) to prevent cache sticking - Add hysteresis gain threshold to avoid thrashing - Add ADAPT interactive command and per-request adaptation trigger in server
|
Thanks for the work and the write-ups. I went through all three carefully, and I'm not merging them as they are - here is why, so the useful parts can come back in a shape that fits: #37 (VMM cache + on-demand vision):
#38 (adaptive eviction): it mostly retunes the adaptation the engine already has (0.7 was already exponential decay), the new #39 (telemetry): it changes What I'd gladly take as small separate PRs against current main: the per-request decode hit rate (the DONE fields, the Monitor column), keeping the root checkpoint (only the first turn boundary), the |
…-tuning Measure expert-transfer tuning on asymmetric V100 PCIe links
Summary
Implements continuous, non-blocking MoE expert cache adaptation between VRAM resident slots and host RAM during multi-turn generation.
Motivation
Static expert placement profiles calibrated on generic corpora often yield low hit rates (~25–35%) when operating in specialized domains or conversations in other languages. Continuous adaptation enables the cache to dynamically follow conversation context.
Key Changes
Testing