Skip to content

Rename mkldnn.dll to onednn.dll #74511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cmake/external/onednn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ else()
string(REPLACE "/O2 " "" ONEDNN_CFLAG_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
string(REPLACE "/O2 " "" ONEDNN_CXXFLAG_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
set(ONEDNN_LIB
"${ONEDNN_INSTALL_DIR}/bin/mkldnn.lib"
"${ONEDNN_INSTALL_DIR}/bin/onednn.lib"
CACHE FILEPATH "oneDNN library." FORCE)
endif()

Expand Down Expand Up @@ -95,7 +95,7 @@ add_definitions(-DPADDLE_WITH_DNNL)
# copy the real so.0 lib to install dir
# it can be directly contained in wheel or capi
if(WIN32)
set(ONEDNN_SHARED_LIB ${ONEDNN_INSTALL_DIR}/bin/mkldnn.dll)
set(ONEDNN_SHARED_LIB ${ONEDNN_INSTALL_DIR}/bin/onednn.dll)

file(TO_NATIVE_PATH ${ONEDNN_INSTALL_DIR} NATIVE_ONEDNN_INSTALL_DIR)
file(TO_NATIVE_PATH ${ONEDNN_SHARED_LIB} NATIVE_ONEDNN_SHARED_LIB)
Expand All @@ -104,10 +104,10 @@ if(WIN32)
OUTPUT ${ONEDNN_LIB}
COMMAND (copy ${NATIVE_ONEDNN_INSTALL_DIR}\\bin\\dnnl.dll
${NATIVE_ONEDNN_SHARED_LIB} /Y)
COMMAND dumpbin /exports ${ONEDNN_INSTALL_DIR}/bin/mkldnn.dll >
COMMAND dumpbin /exports ${ONEDNN_INSTALL_DIR}/bin/onednn.dll >
${ONEDNN_INSTALL_DIR}/bin/exports.txt
COMMAND echo LIBRARY mkldnn > ${ONEDNN_INSTALL_DIR}/bin/mkldnn.def
COMMAND echo EXPORTS >> ${ONEDNN_INSTALL_DIR}/bin/mkldnn.def
COMMAND echo LIBRARY onednn > ${ONEDNN_INSTALL_DIR}/bin/onednn.def
COMMAND echo EXPORTS >> ${ONEDNN_INSTALL_DIR}/bin/onednn.def
COMMAND
echo off && (for
/f
Expand All @@ -119,10 +119,10 @@ if(WIN32)
echo
%A
>>
${ONEDNN_INSTALL_DIR}/bin/mkldnn.def) && echo on
COMMAND lib /def:${ONEDNN_INSTALL_DIR}/bin/mkldnn.def /out:${ONEDNN_LIB}
${ONEDNN_INSTALL_DIR}/bin/onednn.def) && echo on
COMMAND lib /def:${ONEDNN_INSTALL_DIR}/bin/onednn.def /out:${ONEDNN_LIB}
/machine:x64
COMMENT "Generate mkldnn.lib manually--->"
COMMENT "Generate onednn.lib manually--->"
DEPENDS ${ONEDNN_PROJECT}
VERBATIM)
add_custom_target(onednn_cmd ALL DEPENDS ${ONEDNN_LIB})
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/inference/api/demo_ci/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ if(WITH_MKL)
if(EXISTS ${ONEDNN_PATH})
include_directories("${ONEDNN_PATH}/include")
if(WIN32)
set(ONEDNN_LIB ${ONEDNN_PATH}/lib/mkldnn.lib)
set(ONEDNN_LIB ${ONEDNN_PATH}/lib/onednn.lib)
else()
set(ONEDNN_LIB ${ONEDNN_PATH}/lib/libdnnl.so.3)
endif()
Expand Down Expand Up @@ -324,7 +324,7 @@ if(WIN32)
${LIB_PATH}
COMMAND ${CMAKE_COMMAND} -E copy ${MATH_LIB_PATH}/lib/libiomp5md.dll
${LIB_PATH}
COMMAND ${CMAKE_COMMAND} -E copy ${ONEDNN_PATH}/lib/mkldnn.dll
COMMAND ${CMAKE_COMMAND} -E copy ${ONEDNN_PATH}/lib/onednn.dll
${LIB_PATH})
else()
add_custom_command(
Expand Down
12 changes: 6 additions & 6 deletions paddle/fluid/pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,13 @@ if(WITH_PYTHON)
endif()

if(WITH_ONEDNN)
message("Copied mkldnn.dll for Eager AutoCodeGen")
message("Copied onednn.dll for Eager AutoCodeGen")
add_custom_command(
OUTPUT ${eager_generator_path}/mkldnn.dll
OUTPUT ${eager_generator_path}/onednn.dll
COMMAND ${CMAKE_COMMAND} -E copy ${ONEDNN_SHARED_LIB}
${eager_generator_path}
DEPENDS onednn)
list(APPEND EAGER_CODEGEN_DEPS ${eager_generator_path}/mkldnn.dll)
list(APPEND EAGER_CODEGEN_DEPS ${eager_generator_path}/onednn.dll)
endif()

if(WITH_ONNXRUNTIME)
Expand Down Expand Up @@ -471,11 +471,11 @@ if(WITH_PYTHON)
endif()
if(WITH_ONEDNN)
add_custom_command(
OUTPUT ${op_impl_path}/mkldnn.dll
OUTPUT ${op_impl_path}/onednn.dll
COMMAND ${CMAKE_COMMAND} -E copy ${ONEDNN_SHARED_LIB} ${op_impl_path}
DEPENDS onednn)
list(APPEND OP_IMPL_DEPS ${op_impl_path}/mkldnn.dll)
list(APPEND EAGER_OP_IMPL_DEPS ${op_impl_path}/mkldnn.dll)
list(APPEND OP_IMPL_DEPS ${op_impl_path}/onednn.dll)
list(APPEND EAGER_OP_IMPL_DEPS ${op_impl_path}/onednn.dll)
endif()
if(WITH_ONNXRUNTIME)
add_custom_command(
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/base/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
else:
raise ImportError(
"""NOTE: You may need to run \"export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH\"
if you encounters \"libmkldnn.so not found\" errors. If you have python
if you encounters \"libonednn.so not found\" errors. If you have python
installed in other directory, replace \"/usr/local/lib\" with your own
directory. The original error is: \n"""
+ str(e)
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ if '${WITH_ONEDNN}' == 'ON':
if os.name != 'nt':
package_data['paddle.libs']+=['libdnnl.so.3']
else:
package_data['paddle.libs']+=['mkldnn.dll']
package_data['paddle.libs']+=['onednn.dll']

if '${WITH_ONNXRUNTIME}' == 'ON':
shutil.copy('${ONNXRUNTIME_SHARED_LIB}', libs_path)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ def get_package_data_and_package_dir():
if os.name != 'nt':
package_data['paddle.libs'] += ['libdnnl.so.3']
else:
package_data['paddle.libs'] += ['mkldnn.dll']
package_data['paddle.libs'] += ['onednn.dll']

if env_dict.get("WITH_ONNXRUNTIME") == 'ON':
shutil.copy(env_dict.get("ONNXRUNTIME_SHARED_LIB"), libs_path)
Expand Down
4 changes: 2 additions & 2 deletions test/cpp/inference/infer_ut/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ if(WITH_MKL)
if(EXISTS ${ONEDNN_PATH})
include_directories("${ONEDNN_PATH}/include")
if(WIN32)
set(ONEDNN_LIB ${ONEDNN_PATH}/lib/mkldnn.lib)
set(ONEDNN_LIB ${ONEDNN_PATH}/lib/onednn.lib)
else()
set(ONEDNN_LIB ${ONEDNN_PATH}/lib/libdnnl.so.3)
endif()
Expand Down Expand Up @@ -327,7 +327,7 @@ if(WIN32)
${LIB_PATH}
COMMAND ${CMAKE_COMMAND} -E copy ${MATH_LIB_PATH}/lib/libiomp5md.dll
${LIB_PATH}
COMMAND ${CMAKE_COMMAND} -E copy ${ONEDNN_PATH}/lib/mkldnn.dll
COMMAND ${CMAKE_COMMAND} -E copy ${ONEDNN_PATH}/lib/onednn.dll
${LIB_PATH})
else()
add_custom_command(
Expand Down
Loading