84
84
CountTimestampMixedEvictionPolicy ,
85
85
data_type_to_sparse_type ,
86
86
FeatureL2NormBasedEvictionPolicy ,
87
+ FeatureScoreBasedEvictionPolicy ,
87
88
NoEvictionPolicy ,
88
89
pooling_type_to_pooling_mode ,
89
90
TimestampBasedEvictionPolicy ,
@@ -235,6 +236,9 @@ def _populate_zero_collision_tbe_params(
235
236
counter_thresholds = [0 ] * len (config .embedding_tables )
236
237
ttls_in_mins = [0 ] * len (config .embedding_tables )
237
238
counter_decay_rates = [0.0 ] * len (config .embedding_tables )
239
+ feature_score_counter_decay_rates = [0.0 ] * len (config .embedding_tables )
240
+ max_training_id_num_per_table = [0 ] * len (config .embedding_tables )
241
+ target_eviction_percent_per_table = [0.0 ] * len (config .embedding_tables )
238
242
l2_weight_thresholds = [0.0 ] * len (config .embedding_tables )
239
243
eviction_strategy = - 1
240
244
table_names = [table .name for table in config .embedding_tables ]
@@ -251,6 +255,20 @@ def _populate_zero_collision_tbe_params(
251
255
raise ValueError (
252
256
f"Do not support multiple eviction strategy in one tbe { eviction_strategy } and 1 for tables { table_names } "
253
257
)
258
+ elif isinstance (policy_t , FeatureScoreBasedEvictionPolicy ):
259
+ feature_score_counter_decay_rates [i ] = policy_t .decay_rate
260
+ max_training_id_num_per_table [i ] = (
261
+ policy_t .max_training_id_num_per_rank
262
+ )
263
+ target_eviction_percent_per_table [i ] = (
264
+ policy_t .target_eviction_percent
265
+ )
266
+ if eviction_strategy == - 1 or eviction_strategy == 5 :
267
+ eviction_strategy = 5
268
+ else :
269
+ raise ValueError (
270
+ f"Do not support multiple eviction strategy in one tbe { eviction_strategy } and 5 for tables { table_names } "
271
+ )
254
272
elif isinstance (policy_t , TimestampBasedEvictionPolicy ):
255
273
ttls_in_mins [i ] = policy_t .eviction_ttl_mins
256
274
if eviction_strategy == - 1 or eviction_strategy == 0 :
@@ -288,6 +306,9 @@ def _populate_zero_collision_tbe_params(
288
306
counter_thresholds = counter_thresholds ,
289
307
ttls_in_mins = ttls_in_mins ,
290
308
counter_decay_rates = counter_decay_rates ,
309
+ feature_score_counter_decay_rates = feature_score_counter_decay_rates ,
310
+ max_training_id_num_per_table = max_training_id_num_per_table ,
311
+ target_eviction_percent_per_table = target_eviction_percent_per_table ,
291
312
l2_weight_thresholds = l2_weight_thresholds ,
292
313
meta_header_lens = meta_header_lens ,
293
314
)
0 commit comments