torchrec
torchrec copied to clipboard
unify the definition of `EmbeddingTableType`
Summary:
Problem
EmbeddingTableType is introduced recently for ZCH.
There are two same definitions of EmbeddingTableType
- one is defined in torchrec/fb/distributed/sparsenn_configs.py
- The other is defined in minimal_viable_ai/core/model_family_api/configs.py
Problem is that
The fields of EmbeddingTable defined in minimal_viable_ai/core/model_family_api/configs.py will be assigned to the EmbeddingTable defined in torchrec/fb/distributed/sparsenn_configs.py.
The assignment happens at minimal_viable_ai/sandbox/umia_hstu/umia_configs_utils.py for model publish. So if the EmbeddingTable are different, the assignment will fail.
solution from this diff
- Option1: keep one of them, and the other import it. This would cause dependency loop;
- Option2(this diff): move the definition of
EmbeddingTableTypeto torchrec/modules/embedding_configs.py
Differential Revision: D62596655