Repository navigation
[mem_cache] skip duplicates host evict via environ - #38462
Conversation
|
/tag-and-rerun-ci |
452e329 to
7e9d504
Compare
|
/rerun-failed-ci |
alphabetc1
left a comment
There was a problem hiding this comment.
Could you also implement this policy for the Rust TreeCore? Currently this environment variable is silently ignored when SGLANG_UNIFIED_RADIX_TREE_CORE_BACKEND=rust.
Please also provide benchmark results showing the transfer reduction and throughput impact.
The profiling and benchmark results have been attached. However, I'm not familiar with the Rust-side implementation, so I'm unable to adapt it at this time. Apologies for that. |
|
/rerun-failed-ci |
Motivation
When device-side memory is constrained, evicted cache lines are continuously offloaded to host memory. Once host memory reaches capacity, a host-side eviction policy must be enforced. Under a write-back strategy, cache lines that are redundantly held on both device and host are preferentially selected for eviction. Consequently, prefix cache lines that were previously offloaded from device to host may be re-transmitted, thereby degrading overall throughput during benchmarking.
Modifications
To mitigate the throughput degradation caused by redundant re-transmission of prefix cache lines, we introduce an environment variable SGLANG_HICACHE_SKIP_HOST_DUPLICATE_RECLAIM that bypasses the _reclaim_full_host_duplicates eviction path. When set to 1, the system skips the preferential eviction of device–host duplicate cache lines and proceeds directly to the general host eviction routine (drive_host_eviction), thereby preserving previously offloaded prefix entries on the host side and avoiding unnecessary re-offloading overhead.
Accuracy Tests
None
Speed Tests and Profiling
140k + 95%cache
Before:

After:

Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ✅ Run #34211872549
Latest PR Test (Extra): ❌ Run #34211872289
Latest PR Test (AMD ROCm 7.2): ❌ Run #34211872520