torchrec icon indicating copy to clipboard operation
torchrec copied to clipboard

unify the definition of `EmbeddingTableType`

Open beekbin opened this issue 1 year ago • 3 comments

Summary:

Problem

EmbeddingTableType is introduced recently for ZCH.

There are two same definitions of EmbeddingTableType

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 EmbeddingTableType to torchrec/modules/embedding_configs.py

Differential Revision: D62596655

beekbin avatar Sep 13 '24 18:09 beekbin