Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI测试不review[fluid_ops] dist_matmul.py #70773

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -438,22 +438,21 @@ def _right_operand_parameter_matmul_backward(ctx, *args, **kwargs):
rank_id,
)
group = new_process_group(group_ranks)
c_allreduce_sum_op = main_block.append_op(
type='c_allreduce_sum',
inputs={'X': kwargs['X@GRAD']},
outputs={'Out': kwargs['X@GRAD']},
all_reduce_sum_op = main_block.append_op(
type='all_reduce',
inputs={'x': kwargs['X@GRAD']},
outputs={'out': kwargs['X@GRAD']},
attrs={
'ring_id': group.id,
'use_calc_stream': True,
'use_model_parallel': True,
OP_ROLE_KEY: OpRole.Backward,
},
)
c_allreduce_sum_op._set_attr(
all_reduce_sum_op._set_attr(
'op_namescope', '/' + ParallelMode.TensorParallel
)
set_comm_op_dist_attr_for_program(
c_allreduce_sum_op,
all_reduce_sum_op,
dist_attr.process_mesh,
X_grad_dist_attr,
ctx,
Expand Down Expand Up @@ -645,7 +644,7 @@ def calc_bwd_cost(self, dist_op, ctx, cluster):
if has_x_grad:
attrs = {"use_calc_stream": True, "use_model_parallel": True}
var_names = backward_op.output("X@GRAD")
c_allreduce_sum_desc_mapping = build_comm_desc_from_dist_op(
all_reduce_sum_desc_mapping = build_comm_desc_from_dist_op(
"c_allreduce_sum",
dist_op,
ctx,
Expand All @@ -657,7 +656,7 @@ def calc_bwd_cost(self, dist_op, ctx, cluster):
AllreduceSumOpCost,
ctx,
processes,
c_allreduce_sum_desc_mapping,
all_reduce_sum_desc_mapping,
cluster,
)
res.append(comm_op_cost_list)
Expand Down Expand Up @@ -946,7 +945,7 @@ def calc_fwd_cost(self, dist_op, ctx, cluster):
attrs = {"use_calc_stream": True, "use_model_parallel": True}

var_names = serial_op.output("Out")
c_allreduce_sum_desc_mapping = build_comm_desc_from_dist_op(
all_reduce_sum_desc_mapping = build_comm_desc_from_dist_op(
"c_allreduce_sum",
dist_op,
ctx,
Expand All @@ -959,7 +958,7 @@ def calc_fwd_cost(self, dist_op, ctx, cluster):
AllreduceSumOpCost,
ctx,
processes,
c_allreduce_sum_desc_mapping,
all_reduce_sum_desc_mapping,
cluster,
)

Expand Down Expand Up @@ -1092,22 +1091,21 @@ def forward(ctx, *args, **kwargs):
matmul_op = copy_op_without_infer_shape(src_op, main_block, ctx, kwargs)

# add allreduce (inplace)
c_allreduce_sum_op = main_block.append_op(
type='c_allreduce_sum',
inputs={'X': Out_var},
outputs={'Out': Out_var},
all_reduce_sum_op = main_block.append_op(
type='all_reduce',
inputs={'x': Out_var},
outputs={'out': Out_var},
attrs={
'ring_id': group.id,
'use_calc_stream': True,
'use_model_parallel': True,
OP_ROLE_KEY: src_op.attr('op_role'),
},
)
c_allreduce_sum_op._set_attr(
all_reduce_sum_op._set_attr(
'op_namescope', '/' + ParallelMode.TensorParallel
)
set_comm_op_dist_attr_for_program(
c_allreduce_sum_op,
all_reduce_sum_op,
op_dist_attr.process_mesh,
out_var_dist_attr,
ctx,
Expand Down Expand Up @@ -1336,7 +1334,7 @@ def calc_bwd_cost(self, dist_op, ctx, cluster):
if has_x_grad:
attrs = {"use_calc_stream": True, "use_model_parallel": True}
var_names = backward_op.output("X@GRAD")
c_allreduce_sum_desc_mapping = build_comm_desc_from_dist_op(
all_reduce_sum_desc_mapping = build_comm_desc_from_dist_op(
"c_allreduce_sum",
dist_op,
ctx,
Expand All @@ -1348,7 +1346,7 @@ def calc_bwd_cost(self, dist_op, ctx, cluster):
AllreduceSumOpCost,
ctx,
processes,
c_allreduce_sum_desc_mapping,
all_reduce_sum_desc_mapping,
cluster,
)
res.append(comm_op_cost_list)
Expand Down Expand Up @@ -1634,7 +1632,7 @@ def calc_fwd_cost(self, dist_op, ctx, cluster):
attrs = {"use_calc_stream": True, "use_model_parallel": True}

var_names = serial_op.output("Out")
c_allreduce_sum_desc_mapping = build_comm_desc_from_dist_op(
all_reduce_sum_desc_mapping = build_comm_desc_from_dist_op(
"c_allreduce_sum",
dist_op,
ctx,
Expand All @@ -1647,7 +1645,7 @@ def calc_fwd_cost(self, dist_op, ctx, cluster):
AllreduceSumOpCost,
ctx,
processes,
c_allreduce_sum_desc_mapping,
all_reduce_sum_desc_mapping,
cluster,
)
res_cost = [cost_mapping, comm_op_cost_list]
Expand Down Expand Up @@ -1780,22 +1778,21 @@ def forward(ctx, *args, **kwargs):
src_op, main_block, ctx, kwargs
)

c_allreduce_sum_op = main_block.append_op(
type='c_allreduce_sum',
inputs={'X': Out_var},
outputs={'Out': Out_var},
all_reduce_sum_op = main_block.append_op(
type='all_reduce',
inputs={'x': Out_var},
outputs={'out': Out_var},
attrs={
'ring_id': group.id,
'use_calc_stream': True,
'use_model_parallel': True,
OP_ROLE_KEY: src_op.attr('op_role'),
},
)
c_allreduce_sum_op._set_attr(
all_reduce_sum_op._set_attr(
'op_namescope', '/' + ParallelMode.TensorParallel
)
set_comm_op_dist_attr_for_program(
c_allreduce_sum_op,
all_reduce_sum_op,
op_dist_attr.process_mesh,
out_var_dist_attr,
ctx,
Expand Down Expand Up @@ -2023,7 +2020,7 @@ def calc_bwd_cost(self, dist_op, ctx, cluster):
if has_x_grad:
attrs = {"use_calc_stream": True, "use_model_parallel": True}
var_names = backward_op.output("X@GRAD")
c_allreduce_sum_desc_mapping = build_comm_desc_from_dist_op(
all_reduce_sum_desc_mapping = build_comm_desc_from_dist_op(
"c_allreduce_sum",
dist_op,
ctx,
Expand All @@ -2035,7 +2032,7 @@ def calc_bwd_cost(self, dist_op, ctx, cluster):
AllreduceSumOpCost,
ctx,
processes,
c_allreduce_sum_desc_mapping,
all_reduce_sum_desc_mapping,
cluster,
)
res.append(comm_op_cost_list)
Expand Down Expand Up @@ -2312,7 +2309,7 @@ def calc_fwd_cost(self, dist_op, ctx, cluster):
attrs = {"use_calc_stream": True, "use_model_parallel": True}

var_names = serial_op.output("Out")
c_allreduce_sum_desc_mapping = build_comm_desc_from_dist_op(
all_reduce_sum_desc_mapping = build_comm_desc_from_dist_op(
"c_allreduce_sum",
dist_op,
ctx,
Expand All @@ -2325,7 +2322,7 @@ def calc_fwd_cost(self, dist_op, ctx, cluster):
AllreduceSumOpCost,
ctx,
processes,
c_allreduce_sum_desc_mapping,
all_reduce_sum_desc_mapping,
cluster,
)

Expand Down Expand Up @@ -2446,22 +2443,21 @@ def forward(ctx, *args, **kwargs):
# copy op
mul_op = copy_op_without_infer_shape(src_op, main_block, ctx, kwargs)

c_allreduce_sum_op = main_block.append_op(
type='c_allreduce_sum',
inputs={'X': Out_var},
outputs={'Out': Out_var},
all_reduce_sum_op = main_block.append_op(
type='all_reduce',
inputs={'x': Out_var},
outputs={'out': Out_var},
attrs={
'ring_id': group.id,
'use_calc_stream': True,
'use_model_parallel': True,
OP_ROLE_KEY: src_op.attr('op_role'),
},
)
c_allreduce_sum_op._set_attr(
all_reduce_sum_op._set_attr(
'op_namescope', '/' + ParallelMode.TensorParallel
)
set_comm_op_dist_attr_for_program(
c_allreduce_sum_op,
all_reduce_sum_op,
op_dist_attr.process_mesh,
out_var_dist_attr,
ctx,
Expand Down
Loading