Skip to content

Commit 8513fe6

Browse files
authored
[AutoParallel] Fix pipeline visualization tool (cherry-pick from f086447) (#71695)
* fix profile tool
1 parent dbaed63 commit 8513fe6

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

paddle/fluid/framework/new_executor/pir_interpreter.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,7 @@ void PirInterpreter::RunInstructionBase(InstructionBase* instr_node) {
19391939
::pir::Operation* op = instr_node->Operation();
19401940
if (!calculate_stream_timer_->IsStarted() && op_name != "pd_op.feed" &&
19411941
!op->HasAttribute("ring_id") && op_name != "pd_op.shadow_feed" &&
1942-
op_name != "pd_op.full_int_array") {
1942+
op_name != "pd_op.full" && op_name != "pd_op.full_int_array") {
19431943
VLOG(3) << "Start calculated stream timer from op: " << op_name;
19441944
calculate_stream_timer_->Start();
19451945
}

python/paddle/distributed/auto_parallel/static/profiler_helper_static.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def process_one_machine_log(log_dir, multi_machine_idx=-1):
150150
step_infos.append([float("inf"), float("-inf")])
151151
step_infos[i][0] = min(step_infos[i][0], info[0])
152152
step_infos[i][1] = max(step_infos[i][1], info[1])
153+
return start_step
153154

154155
if args.multi_machine:
155156
multi_machine_dirs = os.listdir(args.log_dir)
@@ -162,9 +163,9 @@ def process_one_machine_log(log_dir, multi_machine_idx=-1):
162163
machine_num = len(multi_machine_dirs)
163164
for i, d in enumerate(multi_machine_dirs):
164165
_logger.info(f"Process machine {i}")
165-
process_one_machine_log(d, i)
166+
start_step = max(process_one_machine_log(d, i), start_step)
166167
else:
167-
process_one_machine_log(args.log_dir)
168+
start_step = process_one_machine_log(args.log_dir)
168169

169170
for i, info in enumerate(step_infos):
170171
start_time = info[0]

python/paddle/profiler/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from __future__ import annotations
1616

1717
import functools
18+
import logging
1819
import sys
1920
from contextlib import ContextDecorator, contextmanager
2021
from typing import TYPE_CHECKING
@@ -271,6 +272,9 @@ def job_schedule_profiler_range(iter_id, start, end, exit_after_prof=True):
271272
def switch_job_schedule_profiler(
272273
model, iter_id, start, end, exit_after_prof=True
273274
):
275+
logging.info(
276+
f"Schedule Profiler start at step {start} and end at step {end}"
277+
)
274278
with job_schedule_profiler_range(
275279
iter_id, start, end, exit_after_prof
276280
) as status:

0 commit comments

Comments
 (0)