diff --git a/paddle/fluid/operators/elementwise/mkldnn/elementwise_mkldnn_op.h b/paddle/fluid/operators/elementwise/mkldnn/elementwise_mkldnn_op.h index e2037d258f16b6bbe85d9c8dd159143120ff848e..e30bafb5a500abf9e6c8ec265a91d73b65103e54 100644 --- a/paddle/fluid/operators/elementwise/mkldnn/elementwise_mkldnn_op.h +++ b/paddle/fluid/operators/elementwise/mkldnn/elementwise_mkldnn_op.h @@ -60,10 +60,6 @@ inline void AddSubNonBroadcast(platform::ReorderMKLDNNHandler* reorder_handler, reorder_attr.set_output_scales(0, scales); auto reorder_p = reorder_handler->AcquireReorder(dst_memory, src_memory, reorder_attr); - platform::RecordEvent record_reorder("int_reorder", - platform::TracerEventType::UserDefined, - 2, - platform::EventRole::kUniqueOp); reorder_p->execute(platform::MKLDNNDeviceContext::tls().get_stream(), *src_memory, diff --git a/paddle/fluid/operators/mkldnn/conv_transpose_mkldnn_op.cc b/paddle/fluid/operators/mkldnn/conv_transpose_mkldnn_op.cc index 5189e89e6170c7353c711db84dd040e74415ac40..21efe523b850ee22f3129b8e703455b36760e8ca 100644 --- a/paddle/fluid/operators/mkldnn/conv_transpose_mkldnn_op.cc +++ b/paddle/fluid/operators/mkldnn/conv_transpose_mkldnn_op.cc @@ -292,7 +292,7 @@ class ConvTransposeMKLDNNHandlerT platform::RecordEvent record_reorder( "int_reorder", platform::TracerEventType::UserDefined, - 2, + 1, platform::EventRole::kUniqueOp); reorder_p->execute( astream, @@ -318,7 +318,7 @@ class ConvTransposeMKLDNNHandlerT platform::RecordEvent record_reorder( "int_reorder", platform::TracerEventType::UserDefined, - 2, + 1, platform::EventRole::kUniqueOp); reorder_p->execute( astream, diff --git a/paddle/fluid/operators/mkldnn/fc_mkldnn_op.cc b/paddle/fluid/operators/mkldnn/fc_mkldnn_op.cc index 28bceeff53607e99d3ed56bc4fb8d9c7bf19c74f..962a96b9bc9781fd6e43e679097785eb95e2cad8 100644 --- a/paddle/fluid/operators/mkldnn/fc_mkldnn_op.cc +++ b/paddle/fluid/operators/mkldnn/fc_mkldnn_op.cc @@ -210,10 +210,17 @@ class FCMKLDNNHandler *user_memory_p, *target_memory_p, attrs); auto& astream = platform::MKLDNNDeviceContext::tls().get_stream(); - reorder_p->execute( - astream, - {{DNNL_ARG_FROM, *user_memory_p}, {DNNL_ARG_TO, *target_memory_p}}); - astream.wait(); + { + platform::RecordEvent record_reorder( + "int_reorder", + platform::TracerEventType::UserDefined, + 1, + platform::EventRole::kUniqueOp); + reorder_p->execute( + astream, + {{DNNL_ARG_FROM, *user_memory_p}, {DNNL_ARG_TO, *target_memory_p}}); + astream.wait(); + } return target_memory_p; } diff --git a/paddle/phi/backends/onednn/onednn_reuse.h b/paddle/phi/backends/onednn/onednn_reuse.h index 65266e56c21dfbfbbd9bb209a729dbc2117a92c2..6ed83e1deca4789efae5d7782b145a5e527bfa80 100644 --- a/paddle/phi/backends/onednn/onednn_reuse.h +++ b/paddle/phi/backends/onednn/onednn_reuse.h @@ -380,7 +380,7 @@ class OneDNNHandlerT { paddle::platform::RecordEvent record_reorder( "int_reorder", paddle::platform::TracerEventType::UserDefined, - 2, + 1, paddle::platform::EventRole::kUniqueOp); reorder_p->execute( astream, @@ -433,7 +433,7 @@ class OneDNNHandlerT { paddle::platform::RecordEvent record_reorder( "int_reorder", paddle::platform::TracerEventType::UserDefined, - 2, + 1, paddle::platform::EventRole::kUniqueOp); reorder_p->execute( astream, @@ -459,7 +459,7 @@ class OneDNNHandlerT { paddle::platform::RecordEvent record_reorder( "int_reorder", paddle::platform::TracerEventType::UserDefined, - 2, + 1, paddle::platform::EventRole::kUniqueOp); reorder_p->execute( astream, @@ -647,7 +647,7 @@ class OneDNNHandlerNoCachingT { paddle::platform::RecordEvent record_reorder( "int_reorder", paddle::platform::TracerEventType::UserDefined, - 2, + 1, paddle::platform::EventRole::kUniqueOp); reorder_p->execute( astream, @@ -678,7 +678,7 @@ class OneDNNHandlerNoCachingT { paddle::platform::RecordEvent record_reorder( "int_reorder", paddle::platform::TracerEventType::UserDefined, - 2, + 1, paddle::platform::EventRole::kUniqueOp); reorder_p->execute( astream, diff --git a/paddle/phi/kernels/onednn/conv_grad_kernel.cc b/paddle/phi/kernels/onednn/conv_grad_kernel.cc index 8d2ff1699940cdd9a2bd4f4e69dc7ff0ecc99d59..4e324d548be20c40af5026b93ae8851a1babeac2 100644 --- a/paddle/phi/kernels/onednn/conv_grad_kernel.cc +++ b/paddle/phi/kernels/onednn/conv_grad_kernel.cc @@ -143,7 +143,7 @@ void ConvGradKernel(const Context& dev_ctx, paddle::platform::RecordEvent record_reorder( "int_reorder", paddle::platform::TracerEventType::UserDefined, - 2, + 1, paddle::platform::EventRole::kUniqueOp); reorder_p->execute( astream, *diff_weights_memory_p, *reorder_dst_memory_p);