From 92bf678253d1a6aa449db1ce4235d086bd3e041d Mon Sep 17 00:00:00 2001 From: Wojciech Uss Date: Thu, 24 Sep 2020 12:20:51 +0000 Subject: [PATCH] use oneDNN GRU INT8 optimized version use faster data format --- cmake/external/mkldnn.cmake | 2 +- paddle/fluid/operators/fused/mkldnn/fusion_gru_mkldnn_op.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/external/mkldnn.cmake b/cmake/external/mkldnn.cmake index c0adda0da31..e3ac8624a80 100644 --- a/cmake/external/mkldnn.cmake +++ b/cmake/external/mkldnn.cmake @@ -20,7 +20,7 @@ SET(MKLDNN_SOURCE_DIR ${THIRD_PARTY_PATH}/mkldnn/src/extern_mkldnn) SET(MKLDNN_INSTALL_DIR ${THIRD_PARTY_PATH}/install/mkldnn) SET(MKLDNN_INC_DIR "${MKLDNN_INSTALL_DIR}/include" CACHE PATH "mkldnn include directory." FORCE) SET(MKLDNN_REPOSITORY https://github.com/oneapi-src/oneDNN.git) -SET(MKLDNN_TAG 64a48f9565aa72f6359917b3406328075a409939) +SET(MKLDNN_TAG 361725600224f41b7347a1c6bee9b04d1e6c14d7) # Introduce variables: # * CMAKE_INSTALL_LIBDIR diff --git a/paddle/fluid/operators/fused/mkldnn/fusion_gru_mkldnn_op.cc b/paddle/fluid/operators/fused/mkldnn/fusion_gru_mkldnn_op.cc index 5fad1b116de..58ecc6731f0 100644 --- a/paddle/fluid/operators/fused/mkldnn/fusion_gru_mkldnn_op.cc +++ b/paddle/fluid/operators/fused/mkldnn/fusion_gru_mkldnn_op.cc @@ -95,7 +95,7 @@ class GRUMKLDNNHandler : public platform::MKLDNNHandlerT { // Create memory descriptors auto input_md = MKLDNNMemDesc({Ti, N, IC}, MKLDNNGetDataType(), - MKLDNNMemoryFormat::any); + MKLDNNMemoryFormat::ntc); auto weight_x_md = MKLDNNMemDesc({L, D, IC, G, OC}, weights_dt, MKLDNNMemoryFormat::any); auto weight_h_md = @@ -103,7 +103,7 @@ class GRUMKLDNNHandler : public platform::MKLDNNHandlerT { auto bias_md = MKLDNNMemDesc({L, D, G, OC}, MKLDNNGetDataType(), MKLDNNMemoryFormat::ldgo); auto hidden_md = MKLDNNMemDesc({Ti, N, OC}, MKLDNNGetDataType(), - MKLDNNMemoryFormat::any); + MKLDNNMemoryFormat::ntc); auto h0_md = MKLDNNMemDesc({L, D, N, OC}, MKLDNNGetDataType(), MKLDNNMemoryFormat::ldnc); -- GitLab