Paddle
Paddle copied to clipboard
Nested paddle::platform::RecordEvent is not supported yet
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
This error should have no relationship with nested events. We tested the nested case and it did work fine.
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 .