From ca9fd64f7fe2527dc66ccda5c9045d966764b2dc Mon Sep 17 00:00:00 2001 From: cheng cheng <472491134@qq.com> Date: Sat, 25 Jun 2022 05:43:25 +0800 Subject: [PATCH] remove useless pipeline buffer between cpu to stage 0 (#8484) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- oneflow/core/job_rewriter/pipeline_buffer_pass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oneflow/core/job_rewriter/pipeline_buffer_pass.cpp b/oneflow/core/job_rewriter/pipeline_buffer_pass.cpp index 11374db6eb8..c726b9c1e74 100644 --- a/oneflow/core/job_rewriter/pipeline_buffer_pass.cpp +++ b/oneflow/core/job_rewriter/pipeline_buffer_pass.cpp @@ -293,7 +293,7 @@ Maybe PipelineBufferPass::Apply(const OpGraph& op_graph, JobBuilder* job_b const int64_t dst_stage_id = GetStageIdHint(dst_node); if (src_node->parallel_desc().device_type() == DeviceType::kCPU && dst_node->parallel_desc().device_type() == DeviceType::kCUDA) { - if (src_stage_id == 0 && (dst_stage_id == max_stage_id || dst_stage_id == 0)) { + if (src_stage_id == 0 && dst_stage_id == max_stage_id) { TryInsertOrUseBufferOpToDstNode(edge, total_stage_num * 2, &buffer_op_name2op_conf, &buffer_op_name2parallel_conf, &mut_op_name2conf); return;