"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "26ce60c46d128b820674e99c847304d1e424b661"
Unverified Commit bb6cec23 authored by Rhett Ying's avatar Rhett Ying Committed by GitHub
Browse files

[BugFix] fix incorrect name when fetch data in sparse optim (#3808)

parent 8f0136b0
...@@ -130,6 +130,17 @@ class DistEmbedding: ...@@ -130,6 +130,17 @@ class DistEmbedding:
""" """
return self._tensor.tensor_name return self._tensor.tensor_name
@property
def data_name(self):
"""Return the data name of the embeddings
Returns
-------
str
The data name of the embeddings
"""
return self._tensor._name
@property @property
def kvstore(self): def kvstore(self):
"""Return the kvstore client """Return the kvstore client
......
...@@ -74,7 +74,7 @@ class DistSparseGradOptimizer(abc.ABC): ...@@ -74,7 +74,7 @@ class DistSparseGradOptimizer(abc.ABC):
# will send grad to each corresponding trainer # will send grad to each corresponding trainer
if self._world_size > 1: if self._world_size > 1:
# get idx split from kvstore # get idx split from kvstore
idx_split = kvstore.get_partid(name, idics) idx_split = kvstore.get_partid(emb.data_name, idics)
idx_split_size = [] idx_split_size = []
idics_list = [] idics_list = []
grad_list = [] grad_list = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment