Skip to content

Commit f320c0f

Browse files
继盛xuye.qin
authored andcommitted
Enable reassign_worker for reducers
1 parent 9964ffc commit f320c0f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mars/core/operand/shuffle.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ class MapReduceOperand(Operand):
3838
reducer_ordinal = Int32Field("reducer_ordinal")
3939
reducer_phase = StringField("reducer_phase", default=None)
4040

41+
def __init__(self, *args, **kwargs):
42+
super().__init__(*args, **kwargs)
43+
if self.stage == OperandStage.reduce:
44+
# for reducer, we assign worker at first
45+
self.scheduling_hint.reassign_worker = True
46+
4147
def _new_chunks(self, inputs, kws=None, **kw):
4248
if getattr(self, "reducer_index", None) is None:
4349
index = None

0 commit comments

Comments
 (0)