Skip to content

Commit 8439419

Browse files
EddyLXJfacebook-github-bot
authored andcommitted
Support metadata mask for feature score eviction (#3277)
Summary: Pull Request resolved: #3277 As title, in feature score eviction policy, the 31 bit count in metaheader is float type. Need to handle it in parse util func. Reviewed By: emlin Differential Revision: D80131015 fbshipit-source-id: d295c5db9cf53c6f8c6a62c82b5ac5eeef777980
1 parent f2674a0 commit 8439419

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

torchrec/modules/embedding_configs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ class FeatureScoreBasedEvictionPolicy(VirtualTableEvictionPolicy):
219219
decay_rate: float = 0.99 # default decay by default #TODO: Change to real value
220220
max_training_id_num_per_rank: int = 0 # max number of training ids per rank
221221
target_eviction_percent: float = 0.0 # target eviction percent
222+
inference_eviction_feature_score_threshold: Optional[float] = (
223+
None # 0 means no eviction
224+
)
225+
226+
def __post_init__(self) -> None:
227+
if self.inference_eviction_feature_score_threshold is None:
228+
self.inference_eviction_feature_score_threshold = 0
222229

223230

224231
@dataclass

0 commit comments

Comments
 (0)