Commit 772e394
add auto feature score collection to EC (pytorch#5030)
Summary:
Pull Request resolved: pytorch#5030
X-link: meta-pytorch/torchrec#3474
X-link: https://github.com/facebookresearch/FBGEMM/pull/2043
Enable feature score auto collection in ShardedEmbeddingCollection based on static feature to score mapping.
If user needs custom score for specific id, they can disable auto collection and then change model code explicitly to collect score for each id.
Here is the sample eviction policy config in embedding_table config to enable auto score collection:
virtual_table_eviction_policy=FeatureScoreBasedEvictionPolicy(
training_id_eviction_trigger_count=260_000_000, # 260M
training_id_keep_count=160_000_000, # 160M
enable_auto_feature_score_collection=True,
feature_score_mapping={
"sparse_public_original_content_creator": 1.0,
},
feature_score_default_value=0.5,
),
Additionally the counter collected previously during EC dedup is not used by kvzch backend, so this diff removed that counter and allow KJT to transfer a single float32 weight tensor to backend. This allows feature score collection for EBC since there could have another float weight for EBC pooling already.
Reviewed By: RachelZheng, EddyLXJ
Differential Revision: D83945722
fbshipit-source-id: 2dc71f6601de055b982f62ca3d73cdbe5fba2dce1 parent a486a69 commit 772e394
File tree
2 files changed
+2
-4
lines changed- fbgemm_gpu
- fbgemm_gpu/tbe/ssd
- src/dram_kv_embedding_cache
2 files changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2089 | 2089 | | |
2090 | 2090 | | |
2091 | 2091 | | |
2092 | | - | |
| 2092 | + | |
2093 | 2093 | | |
2094 | 2094 | | |
2095 | 2095 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
773 | | - | |
774 | 773 | | |
775 | 774 | | |
776 | 775 | | |
| |||
785 | 784 | | |
786 | 785 | | |
787 | 786 | | |
788 | | - | |
789 | | - | |
| 787 | + | |
790 | 788 | | |
791 | 789 | | |
792 | 790 | | |
| |||
0 commit comments