Skip to content

Commit f093a7b

Browse files
committed
allow inference test to generate timeline
generate timeline file PYTHONPATH=/paddle/dev/my/build2/python/ python /paddle/dev/my/Paddle2/tools/timeline.py --profile_path=train=run_inference_profiler --timeline_path=/tmp/timeline_infer visualize it open url chrome://tracing
1 parent 2bff03b commit f093a7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

paddle/fluid/inference/tests/test_helper.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void TestInference(const std::string& dirname,
105105
state = paddle::platform::ProfilerState::kCPU;
106106
} else {
107107
#ifdef PADDLE_WITH_CUDA
108-
state = paddle::platform::ProfilerState::kCUDA;
108+
state = paddle::platform::ProfilerState::kAll;
109109
// The default device_id of paddle::platform::CUDAPlace is 0.
110110
// Users can get the device_id using:
111111
// int device_id = place.GetDeviceId();
@@ -143,7 +143,7 @@ void TestInference(const std::string& dirname,
143143
}
144144
// Disable the profiler and print the timing information
145145
paddle::platform::DisableProfiler(paddle::platform::EventSortingKey::kDefault,
146-
"load_program_profiler.txt");
146+
"load_program_profiler");
147147
paddle::platform::ResetProfiler();
148148

149149
// 3. Get the feed_target_names and fetch_target_names
@@ -208,7 +208,7 @@ void TestInference(const std::string& dirname,
208208
// Disable the profiler and print the timing information
209209
paddle::platform::DisableProfiler(
210210
paddle::platform::EventSortingKey::kDefault,
211-
"run_inference_profiler.txt");
211+
"run_inference_profiler");
212212
paddle::platform::ResetProfiler();
213213
}
214214

0 commit comments

Comments
 (0)