Open HugoZHL opened 3 years ago
@pleasantrabbit I think we can support Average
easily
@pleasantrabbit I think we can support
Average
easily
Yes, we'll add Average
support.
https://github.com/bytedance/byteps/pull/324 here's the pull request to fix this bug.
Describe the bug In Tensorflow push_pull function,
op
can never equalAverage
sinceop
is a value from Enum class whileAverage
is just a str. This bug causes the push_pull function in Tensorflow to always calculate the SUM of tensors instead of AVERAGE.To Reproduce Steps to reproduce the behavior:
print('Type of op and Average: ', type(op), type(Average))
after lineop = handle_average_backwards_compatibility(op, average)
in tensorflow.push_pull functionop
andAverage
, which will be printed during the setup of Tensorflow graphType of op and Average: <enum 'ReduceOps'> <class 'str'>
Expected behavior Here we cannot compare enum type with str type. There're two solutions to this problem:
op.value
to compare withAverage
in tensorflow.push_pull functionReduceOps
class from a Enum class to a normal classScreenshots here in tensorflow.ops the
ReduceOps
inherits Enumhere in tensorflow.__init__ the program directly compares
op
(which is RecudeOps.Average) toAverage
(which is a str)the function uses
op == Average
to judge whether calculating average of tensors or sum of tensors now it can only give sum of tensors.Environment (please complete the following information): Whatever
Additional context Add any other context about the problem here.