allow MKL-DNN on non-AVX machines (#104)

Signed-off-by: raver119 <raver119@gmail.com>
master
raver119 2019-12-04 09:11:37 +03:00 committed by GitHub
parent 0d14032d26
commit cb18d3d996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 0 additions and 65 deletions

View File

@ -129,10 +129,6 @@ namespace nd4j {
}
PLATFORM_CHECK(avgpool2d) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
if (::optimalLevel() < 2)
return false;
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);

View File

@ -139,10 +139,6 @@ namespace nd4j {
}
PLATFORM_CHECK(avgpool2d_bp) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
if (::optimalLevel() < 2)
return false;
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);

View File

@ -131,10 +131,6 @@ namespace nd4j {
}
PLATFORM_CHECK(avgpool3dnew) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
if (::optimalLevel() < 2)
return false;
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);

View File

@ -144,10 +144,6 @@ namespace nd4j {
}
PLATFORM_CHECK(avgpool3dnew_bp) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
if (::optimalLevel() < 2)
return false;
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);

View File

@ -736,10 +736,6 @@ PLATFORM_IMPL(batchnorm_bp) {
//////////////////////////////////////////////////////////////////////////
PLATFORM_CHECK(batchnorm_bp) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
// if (::optimalLevel() < 2)
// return false;
NDArray* input = INPUT_VARIABLE(0); // 2D:nc, 4D:nchw, 5D:ncdhw
NDArray* mean = INPUT_VARIABLE(1); // [c]
NDArray* variance = INPUT_VARIABLE(2); // [c]

View File

@ -329,10 +329,6 @@ PLATFORM_IMPL(conv2d_bp) {
}
PLATFORM_CHECK(conv2d_bp) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
if (::optimalLevel() < 2)
return false;
auto input = INPUT_VARIABLE(0); // [bS, iH, iW, iC] (NHWC) or [bS, iC, iH, iW] (NCHW)
auto weights = INPUT_VARIABLE(1); // [kH, kW, iC, oC] always
auto bias = block.width() > 3 ? INPUT_VARIABLE(2) : nullptr; // [oC]

View File

@ -375,10 +375,6 @@ PLATFORM_IMPL(conv3dnew_bp) {
}
PLATFORM_CHECK(conv3dnew_bp) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
if (::optimalLevel() < 2)
return false;
auto input = INPUT_VARIABLE(
0); // [bS, iD, iH, iW, iC] (NDHWC) or [bS, iC, iD, iH, iW] (NCDHW)
auto weights = INPUT_VARIABLE(

View File

@ -507,10 +507,6 @@ PLATFORM_IMPL(deconv2d_bp) {
}
PLATFORM_CHECK(deconv2d_bp) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
// if (::optimalLevel() < 2)
// return false;
auto input = INPUT_VARIABLE(0); // [bS, iH, iW, iC] (NHWC) or [bS, iC, iH, iW] (NCDHW)
auto weights = INPUT_VARIABLE(1); // [kH, kW, oC, iC] always
auto bias = block.width() > 3 ? INPUT_VARIABLE(2) : nullptr; // [oC]

View File

@ -223,10 +223,6 @@ PLATFORM_IMPL(deconv2d_tf) {
}
PLATFORM_CHECK(deconv2d_tf) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
// if (::optimalLevel() < 2)
// return false;
auto weights = INPUT_VARIABLE(1); // [kH, kW, iC, oC] always
auto gradO = INPUT_VARIABLE(2); // [bS, oH, oW, oC] (NHWC) or [bS, oC, oH, oW] (NCDHW), epsilon_next
auto gradI = OUTPUT_VARIABLE(0); // [bS, iH, iW, iC] (NHWC) or [bS, iC, iH, iW] (NCDHW), gradI

View File

@ -525,10 +525,6 @@ PLATFORM_IMPL(deconv3d_bp) {
PLATFORM_CHECK(deconv3d_bp) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
// if (::optimalLevel() < 2)
// return false;
auto input = INPUT_VARIABLE(0); // [bS, iD, iH, iW, iC] (NHWC) or [bS, iD, iC, iH, iW] (NCDHW)
auto weights = INPUT_VARIABLE(1); // [kD, kH, kW, oC, iC] always
auto bias = block.width() > 3 ? INPUT_VARIABLE(2) : nullptr; // [oC]

View File

@ -83,10 +83,6 @@ namespace nd4j {
};
PLATFORM_CHECK(lrn) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
if (::optimalLevel() < 2)
return false;
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);

View File

@ -494,11 +494,6 @@ PLATFORM_IMPL(lstmLayer) {
}
PLATFORM_CHECK(lstmLayer) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
// if (::optimalLevel() < 2) {
// return false;
// }
const auto hasBiases = B_ARG(0); // indicates whether biases array is provided
const auto hasInitH = B_ARG(2); // indicates whether initial output is provided
const auto hasInitC = B_ARG(3); // indicates whether initial cell state is provided

View File

@ -135,10 +135,6 @@ namespace nd4j {
}
PLATFORM_CHECK(maxpool2d) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
if (::optimalLevel() < 2)
return false;
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);

View File

@ -164,10 +164,6 @@ namespace nd4j {
}
PLATFORM_CHECK(maxpool2d_bp) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
if (::optimalLevel() < 2)
return false;
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);

View File

@ -141,10 +141,6 @@ namespace nd4j {
}
PLATFORM_CHECK(maxpool3dnew) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
if (::optimalLevel() < 2)
return false;
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);

View File

@ -171,10 +171,6 @@ namespace nd4j {
}
PLATFORM_CHECK(maxpool3dnew_bp) {
// we don't want to use mkldnn if cpu doesn't support avx/avx2
if (::optimalLevel() < 2)
return false;
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);