Skip to content

Commit

Permalink
Profiler can get elapsed time of sendop (#9345)
Browse files Browse the repository at this point in the history
  • Loading branch information
gongweibao authored Mar 24, 2018
1 parent 8090eb6 commit cffe1a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions paddle/fluid/operators/send_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ limitations under the License. */

#include <future>
#include "paddle/fluid/operators/detail/grpc_client.h"
#include "paddle/fluid/platform/profiler.h"

namespace paddle {
namespace operators {
Expand Down Expand Up @@ -59,6 +60,9 @@ class SendOp : public framework::OperatorBase {
platform::DeviceContextPool& pool = platform::DeviceContextPool::Instance();
auto& ctx = *pool.Get(place);

// For profiling
platform::RecordEvent record_event(Type(), &ctx);

auto client_var_name = Output("RPCClient");
PADDLE_ENFORCE_NOT_NULL(scope.FindVar(client_var_name),
"Can not find variable '%s' in the scope.",
Expand Down

0 comments on commit cffe1a9

Please sign in to comment.