Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

Nested paddle::platform::RecordEvent is not supported yet

Open Xreki opened this issue 8 years ago • 2 comments

I want to get the total runtime of Executor.Run(). When I add paddle::platform::RecordEvent record_event("run_inference", paddle::platform::DeviceContextPool::Instance().Get(place)); to timing Executor.Run(), it failed with the following error:

138: terminate called after throwing an instance of 'std::logic_error'
138:   what():  basic_string::_S_construct null not valid

Xreki avatar Mar 05 '18 12:03 Xreki

This error should have no relationship with nested events. We tested the nested case and it did work fine.

kuke avatar Mar 06 '18 05:03 kuke

It seems caused by the newly introduced global variable:

https://github.com/PaddlePaddle/Paddle/blob/ea4e6c7af78adecc009b847379f6df5db224ed45/paddle/fluid/platform/device_tracer.cc#L30-L30

Every RecordEvent will set and clear the variable. It is temporarily fixed by #8782 .

Xreki avatar Mar 06 '18 08:03 Xreki