Skip to content

Commit ef94338

Browse files
Fei Yufacebook-github-bot
Fei Yu
authored andcommitted
support shared bucketized features for id score list unified embedding table (#2592)
Summary: Pull Request resolved: #2592 with shared embedding table with multiple features in UE, we need to do sanity check on whether all id score list features in a certain UE group are of same bucketized type. This diff extended sparse embedding bag preprocessing to enable this check with backward compatibility with single feature scenarios. Reviewed By: yusuo Differential Revision: D66314015 fbshipit-source-id: 9ace9d84d545461e5d470db2bb62bfa91eab9b22
1 parent 677cb0d commit ef94338

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

torchrec/distributed/sharding_plan.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -836,9 +836,10 @@ def construct_module_sharding_plan(
836836
module, sharder.module_type
837837
), f"Incorrect sharder for module type {type(module)}"
838838
shardable_parameters = sharder.shardable_parameters(module)
839-
assert (
840-
shardable_parameters.keys() == per_param_sharding.keys()
841-
), "per_param_sharding_config doesn't match the shardable parameters of the module"
839+
assert shardable_parameters.keys() == per_param_sharding.keys(), (
840+
"per_param_sharding_config doesn't match the shardable parameters of the module,"
841+
f"got {list(shardable_parameters.keys())} != {list(per_param_sharding.keys())}"
842+
)
842843

843844
local_size = local_size or get_local_size()
844845
world_size = world_size or dist.get_world_size()

0 commit comments

Comments
 (0)