From 5042d2ad9fe6d98da7ff81775d23717604f8aa93 Mon Sep 17 00:00:00 2001 From: ciyong Date: Mon, 26 Aug 2019 10:30:08 +0800 Subject: [PATCH] [MKLDNN] Fix out of bound access of req vector (#16000) * remove unnecessary creation of req vector * retrigger CI --- src/operator/subgraph/mkldnn/mkldnn_conv.cc | 5 +---- src/operator/subgraph/mkldnn/mkldnn_fc.cc | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/operator/subgraph/mkldnn/mkldnn_conv.cc b/src/operator/subgraph/mkldnn/mkldnn_conv.cc index b7776d648e18..be2716f139ed 100644 --- a/src/operator/subgraph/mkldnn/mkldnn_conv.cc +++ b/src/operator/subgraph/mkldnn/mkldnn_conv.cc @@ -426,15 +426,12 @@ void SgMKLDNNConvOperator::Forward(const OpContext &ctx, MKLDNNStream::Get()->Submit(); } else { std::vector new_inputs; - std::vector new_req; if (has_bias) { new_inputs = {data, cached_weight_, cached_bias_}; - new_req = {req[in_data], req[in_weight], req[in_bias]}; } else { new_inputs = {data, cached_weight_}; - new_req = {req[in_data], req[in_weight]}; } - MKLDNNConvolutionForwardFullFeature(full_conv_param, ctx, fwd_.get(), new_inputs, new_req, + MKLDNNConvolutionForwardFullFeature(full_conv_param, ctx, fwd_.get(), new_inputs, req, {output}); } diff --git a/src/operator/subgraph/mkldnn/mkldnn_fc.cc b/src/operator/subgraph/mkldnn/mkldnn_fc.cc index 22432193dcf9..6ebbb79d2571 100644 --- a/src/operator/subgraph/mkldnn/mkldnn_fc.cc +++ b/src/operator/subgraph/mkldnn/mkldnn_fc.cc @@ -188,16 +188,13 @@ void SgMKLDNNFCOp::Forward(const OpContext &ctx, initialized_ = true; } std::vector new_inputs; - std::vector new_req; if (has_bias) { new_inputs = {data, weight, cached_bias_}; - new_req = {req[fullc::kData], req[fullc::kWeight], req[fullc::kBias]}; } else { new_inputs = {data, weight}; - new_req = {req[fullc::kData], req[fullc::kWeight]}; } - MKLDNNFCForwardFullFeature(full_param_, ctx, fwd_.get(), new_inputs, new_req, out_data); + MKLDNNFCForwardFullFeature(full_param_, ctx, fwd_.get(), new_inputs, req, out_data); if (mkldnn_param.quantized && !mkldnn_param.enable_float_output) { float *min_output_ptr = out_data[quantized_fullc::kOutMin].data().dptr();