Skip to content

Commit 8b9301e

Browse files
EddyLXJfacebook-github-bot
authored andcommitted
Adding KVZCHEvictionTBEConfig in FBGEEM
Summary: X-link: facebookresearch/FBGEMM#2067 See diff D85604160, this KVZCHEvictionTBEConfig is in FBGEMM and used in torchrec. Both FBGEEM and torchrec are open source in github. It is required to land first, otherwise torchrec github build will throw error {F1983027645} Reviewed By: emlin Differential Revision: D83896528
1 parent ed0c4cb commit 8b9301e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

fbgemm_gpu/fbgemm_gpu/split_table_batched_embeddings_ops_common.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,19 @@ def validate(self) -> None:
240240
), "backend_return_whole_row can only be enabled when enable_optimizer_offloading is enabled"
241241

242242

243+
class KVZCHEvictionTBEConfig(NamedTuple):
244+
# Eviction trigger model for kvzch table: 0: disabled, 1: iteration, 2: mem_util, 3: manual, 4: id count, 5: free_mem
245+
kvzch_eviction_trigger_mode: int = 2 # mem_util
246+
# Minimum free memory (in GB) required before triggering eviction when using free_mem trigger mode.
247+
eviction_free_mem_threshold_gb: int = 200 # 200GB
248+
# Number of batches between checks for free memory threshold when using free_mem trigger mode.
249+
eviction_free_mem_check_interval_batch: int = 1000
250+
# The width of each feature score bucket used for threshold calculation in feature score-based eviction.
251+
threshold_calculation_bucket_stride: float = 0.2
252+
# Total number of feature score buckets used for threshold calculation in feature score-based eviction.
253+
threshold_calculation_bucket_num: Optional[int] = 1000000 # 1M
254+
255+
243256
class BackendType(enum.IntEnum):
244257
SSD = 0
245258
DRAM = 1

0 commit comments

Comments
 (0)