Skip to content

Commit c73a614

Browse files
authored
[Cleanup] rename internal mkldnn symbols to onednn (#76141)
* Rename TransferLayoutMKLDNN to TransferLayoutOneDNN * Update MKLDNN references to ONEDNN in operators.cmake
1 parent 4b2fc32 commit c73a614

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

cmake/operators.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function(register_onednn_kernel TARGET)
122122
if(${onednn_cc_srcs_len} EQUAL 0)
123123
message(
124124
FATAL_ERROR
125-
"The MKLDNN kernel file of ${TARGET} should contains at least one *.*_onednn_op.cc file"
125+
"The OneDNN kernel file of ${TARGET} should contains at least one *.*_onednn_op.cc file"
126126
)
127127
endif()
128128
if(WITH_ONEDNN)
@@ -138,7 +138,7 @@ function(register_onednn_kernel TARGET)
138138
set(op_name "")
139139
find_register(${onednn_src} "REGISTER_OP_KERNEL" op_name)
140140
if(NOT ${op_name} EQUAL "")
141-
file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(${op_name}, MKLDNN);\n")
141+
file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(${op_name}, ONEDNN);\n")
142142
endif()
143143
endforeach()
144144
endfunction()
@@ -607,9 +607,9 @@ function(op_library TARGET)
607607
endforeach()
608608
endif()
609609

610-
# pybind USE_OP_DEVICE_KERNEL for MKLDNN
610+
# pybind USE_OP_DEVICE_KERNEL for ONEDNN
611611
if(WITH_ONEDNN AND ${onednn_cc_srcs_len} GREATER 0)
612-
# Append first implemented MKLDNN activation operator
612+
# Append first implemented ONEDNN activation operator
613613
if(${ONEDNN_FILE} STREQUAL "activation_onednn_op")
614614
file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(softplus, MKLDNN);\n")
615615
else()

paddle/phi/kernels/transfer_layout_kernel.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void TransferLayoutGeneral(const Context& dev_ctx,
121121

122122
#ifdef PADDLE_WITH_DNNL
123123
template <typename Context>
124-
void TransferLayoutMKLDNN(const Context& dev_ctx,
124+
void TransferLayoutOneDNN(const Context& dev_ctx,
125125
const DenseTensor& x,
126126
DataLayout src_layout,
127127
DataLayout dst_layout,
@@ -152,10 +152,10 @@ void TransferLayoutMKLDNN(const Context& dev_ctx,
152152
}
153153

154154
if (src_layout != DataLayout::ONEDNN && dst_layout == DataLayout::ONEDNN) {
155-
// Case1 - transform from Non-MKLDNN OPKernel to OneDNN OPKernel
155+
// Case1 - transform from Non-OneDNN OPKernel to OneDNN OPKernel
156156
// Just set layout/format. No real transform occur
157157
out->ShareDataWith(x);
158-
// For NHWC data we need reshape of tensors as MKL-DNN
158+
// For NHWC data we need reshape of tensors as OneDNN
159159
// is expecting NHWC dims description order
160160
if (src_layout == DataLayout::NHWC) {
161161
VLOG(4) << "NHWC";
@@ -167,7 +167,7 @@ void TransferLayoutMKLDNN(const Context& dev_ctx,
167167
out->set_mem_desc(out_mem_desc);
168168
} else if (src_layout == DataLayout::ONEDNN &&
169169
dst_layout != DataLayout::ONEDNN) {
170-
// Case2 - transform from OneDNN OPKernel to Non-MKLDNN OPKernel
170+
// Case2 - transform from OneDNN OPKernel to Non-OneDNN OPKernel
171171
// Do transform via OneDNN lib
172172
funcs::TransDataLayoutFromOneDNN(
173173
src_layout, dst_layout, x, out, dev_ctx.GetPlace());
@@ -205,7 +205,7 @@ void TransferLayoutKernel(const Context& dev_ctx,
205205
}
206206

207207
#ifdef PADDLE_WITH_DNNL
208-
TransferLayoutMKLDNN<Context>(dev_ctx,
208+
TransferLayoutOneDNN<Context>(dev_ctx,
209209
x,
210210
static_cast<DataLayout>(src_layout),
211211
static_cast<DataLayout>(dst_layout),

0 commit comments

Comments
 (0)