Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Merge branch 'fix_deconv_build' of https://github.com/anirudh2290/mxnet
Browse files Browse the repository at this point in the history
… into fix_deconv_flaky_test_final
  • Loading branch information
anirudh2290 committed Jul 10, 2018
2 parents 66db3e5 + 67d00a3 commit 3e6b20a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 32 deletions.
21 changes: 12 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,13 @@ try {
'GPU: MKLDNN_CUDNNOFF': {
node('mxnetlinux-cpu') {
ws('workspace/build-mkldnn-gpu-nocudnn') {
timeout(time: max_time, unit: 'MINUTES') {
withEnv(['CUDNN_DISABLED=ON']) {
timeout(time: max_time, unit: 'MINUTES') {
init_git()
docker_run('ubuntu_build_cuda', 'build_ubuntu_gpu_mkldnn_nocudnn', false)
pack_lib('mkldnn_gpu_nocudnn', mx_mkldnn_lib)
}
}
}
}
}
},
Expand Down Expand Up @@ -681,13 +683,14 @@ try {
'Python3: MKLDNN-GPU-NOCUDNN': {
node('mxnetlinux-gpu') {
ws('workspace/ut-python3-mkldnn-gpu-nocudnn') {
try {
init_git()
unpack_lib('mkldnn_gpu_nocudnn', mx_mkldnn_lib)
python3_gpu_ut('ubuntu_gpu')
publish_test_coverage()
} finally {
collect_test_results_unix('nosetests_gpu.xml', 'nosetests_python3_mkldnn_gpu_nocudnn.xml')
withEnv(['CUDNN_DISABLED=ON']) {
try {
unpack_lib('mkldnn_gpu_nocudnn', mx_mkldnn_lib)
python3_gpu_ut('ubuntu_gpu')
publish_test_coverage()
} finally {
collect_test_results_unix('nosetests_gpu.xml', 'nosetests_python3_mkldnn_gpu_nocudnn.xml')
}
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions python/mxnet/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import logging
import bz2
import zipfile
import ctypes
from contextlib import contextmanager
import numpy as np
import numpy.testing as npt
Expand All @@ -49,8 +48,6 @@
from .ndarray.ndarray import _STORAGE_TYPE_STR_TO_ID
from .ndarray import array
from .symbol import Symbol
from .base import _LIB, check_call



def default_context():
Expand All @@ -71,14 +68,6 @@ def default_dtype():
return np.float32


def cudnn_enabled():
"""Check if cudnn enabled for the MXNet installation
"""
curr = ctypes.c_bool()
check_call(_LIB.MXCUDNNIsEnabled(ctypes.byref(curr)))
return curr.value


def get_atol(atol=None):
"""Get default numerical threshold for regression test."""
# _TODO: get from env variable, different threshold might
Expand Down
10 changes: 0 additions & 10 deletions src/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1319,16 +1319,6 @@ int MXRtcCudaKernelCall(CudaKernelHandle handle, int dev_id, void** args,
API_END();
}

int MXCUDNNIsEnabled(bool *curr) {
API_BEGIN();
#if MXNET_USE_CUDNN
*curr = true;
#else
*curr = false;
#endif
API_END();
}

int MXNDArrayGetSharedMemHandle(NDArrayHandle handle, int* shared_pid, int* shared_id) {
API_BEGIN();
NDArray* arr = reinterpret_cast<NDArray*>(handle);
Expand Down
2 changes: 1 addition & 1 deletion tests/python/gpu/test_operator_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import numpy as np
import unittest
from nose.tools import assert_raises
from mxnet.test_utils import check_consistency, set_default_context, assert_almost_equal, cudnn_enabled
from mxnet.test_utils import check_consistency, set_default_context, assert_almost_equal
from mxnet.base import MXNetError
from mxnet import autograd
from numpy.testing import assert_allclose
Expand Down
3 changes: 2 additions & 1 deletion tests/python/unittest/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def assert_raises_cudnn_disabled(assertion_error=False):
def test_helper(orig_test):
@make_decorator(orig_test)
def test_new(*args, **kwargs):
if mx.test_utils.cudnn_enabled() or mx.context.current_context().device_type == 'cpu':
cudnn_disabled = (os.getenv('CUDNN_DISABLED') == "ON")
if not cudnn_disabled or mx.context.current_context().device_type == 'cpu':
orig_test(*args, **kwargs)
else:
if assertion_error:
Expand Down

0 comments on commit 3e6b20a

Please sign in to comment.