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

Commit

Permalink
[MXNET-247] Always build profiler (#10308)
Browse files Browse the repository at this point in the history
* Always build profiler

* Update naive_engine.cc

* remove PROFILE_MESSAGE macro

* Remove USE_PROFILER=1 from CI runs
  • Loading branch information
cjolivier01 authored and piiswrong committed Apr 1, 2018
1 parent 0291f95 commit 121adb6
Show file tree
Hide file tree
Showing 28 changed files with 84 additions and 262 deletions.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,6 @@ if(MSVC AND USE_MXNET_LIB_NAMING)
set_target_properties(mxnet PROPERTIES OUTPUT_NAME "libmxnet")
endif()

if(USE_PROFILER)
add_definitions(-DMXNET_USE_PROFILER)
endif()

add_subdirectory(tests)

include(GNUInstallDirs)
Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ else
NVCCFLAGS += -std=c++11 -Xcompiler -D_FORCE_INLINES -O3 -ccbin $(CXX) $(MSHADOW_NVCCFLAGS)
endif

# CFLAGS for profiler
ifeq ($(USE_PROFILER), 1)
CFLAGS += -DMXNET_USE_PROFILER=1
endif

# CFLAGS for segfault logger
ifeq ($(USE_SIGNAL_HANDLER), 1)
CFLAGS += -DMXNET_USE_SIGNAL_HANDLER=1
Expand Down
39 changes: 14 additions & 25 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ build_centos7_cpu() {
DEV=1 \
USE_LAPACK=1 \
USE_LAPACK_PATH=/usr/lib64/liblapack.so \
USE_PROFILER=1 \
USE_BLAS=openblas \
-j$(nproc)
}
Expand All @@ -191,7 +190,6 @@ build_centos7_mkldnn() {
DEV=1 \
USE_LAPACK=1 \
USE_LAPACK_PATH=/usr/lib64/liblapack.so \
USE_PROFILER=1 \
USE_MKLDNN=1 \
USE_BLAS=openblas \
-j$(nproc)
Expand All @@ -204,7 +202,6 @@ build_centos7_gpu() {
DEV=1 \
USE_LAPACK=1 \
USE_LAPACK_PATH=/usr/lib64/liblapack.so \
USE_PROFILER=1 \
USE_BLAS=openblas \
USE_CUDA=1 \
USE_CUDA_PATH=/usr/local/cuda \
Expand All @@ -216,7 +213,6 @@ build_ubuntu_cpu_openblas() {
set -ex
make \
DEV=1 \
USE_PROFILER=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
-j$(nproc)
Expand All @@ -225,7 +221,6 @@ build_ubuntu_cpu_openblas() {
build_ubuntu_cpu_clang39() {
set -ex
make \
USE_PROFILER=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
USE_OPENMP=0 \
Expand All @@ -237,7 +232,6 @@ build_ubuntu_cpu_clang39() {
build_ubuntu_cpu_clang50() {
set -ex
make \
USE_PROFILER=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
USE_OPENMP=1 \
Expand All @@ -249,7 +243,6 @@ build_ubuntu_cpu_clang50() {
build_ubuntu_cpu_clang39_mkldnn() {
set -ex
make \
USE_PROFILER=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
USE_MKLDNN=1 \
Expand All @@ -262,7 +255,6 @@ build_ubuntu_cpu_clang39_mkldnn() {
build_ubuntu_cpu_clang50_mkldnn() {
set -ex
make \
USE_PROFILER=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
USE_MKLDNN=1 \
Expand All @@ -276,7 +268,6 @@ build_ubuntu_cpu_mkldnn() {
set -ex
make \
DEV=1 \
USE_PROFILER=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
USE_MKLDNN=1 \
Expand All @@ -287,7 +278,6 @@ build_ubuntu_gpu_mkldnn() {
set -ex
make \
DEV=1 \
USE_PROFILER=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
USE_MKLDNN=1 \
Expand All @@ -301,7 +291,6 @@ build_ubuntu_gpu_cuda91_cudnn7() {
set -ex
make \
DEV=1 \
USE_PROFILER=1 \
USE_BLAS=openblas \
USE_CUDA=1 \
USE_CUDA_PATH=/usr/local/cuda \
Expand All @@ -314,7 +303,7 @@ build_ubuntu_amalgamation() {
set -ex
# Amalgamation can not be run with -j nproc
make -C amalgamation/ clean
make -C amalgamation/ USE_BLAS=openblas
make -C amalgamation/ USE_BLAS=openblas
}

build_ubuntu_amalgamation_min() {
Expand All @@ -335,7 +324,7 @@ build_ubuntu_gpu_cmake_mkldnn() {
-DCMAKE_BUILD_TYPE=Release \
-G Ninja \
/work/mxnet

ninja -v
}

Expand All @@ -350,7 +339,7 @@ build_ubuntu_gpu_cmake() {
-DCMAKE_BUILD_TYPE=Release \
-G Ninja \
/work/mxnet

ninja -v
}

Expand All @@ -367,7 +356,7 @@ sanity_check() {

unittest_ubuntu_python2_cpu() {
set -ex
export PYTHONPATH=./python/
export PYTHONPATH=./python/
# MXNET_MKLDNN_DEBUG is buggy and produces false positives
# https://github.com/apache/incubator-mxnet/issues/10026
#export MXNET_MKLDNN_DEBUG=1 # Ignored if not present
Expand All @@ -379,7 +368,7 @@ unittest_ubuntu_python2_cpu() {

unittest_ubuntu_python3_cpu() {
set -ex
export PYTHONPATH=./python/
export PYTHONPATH=./python/
# MXNET_MKLDNN_DEBUG is buggy and produces false positives
# https://github.com/apache/incubator-mxnet/issues/10026
#export MXNET_MKLDNN_DEBUG=1 # Ignored if not present
Expand All @@ -390,17 +379,17 @@ unittest_ubuntu_python3_cpu() {

unittest_ubuntu_python2_gpu() {
set -ex
export PYTHONPATH=./python/
export PYTHONPATH=./python/
# MXNET_MKLDNN_DEBUG is buggy and produces false positives
# https://github.com/apache/incubator-mxnet/issues/10026
# https://github.com/apache/incubator-mxnet/issues/10026
#export MXNET_MKLDNN_DEBUG=1 # Ignored if not present
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
nosetests-2.7 --verbose tests/python/gpu
}

unittest_ubuntu_python3_gpu() {
set -ex
export PYTHONPATH=./python/
export PYTHONPATH=./python/
# MXNET_MKLDNN_DEBUG is buggy and produces false positives
# https://github.com/apache/incubator-mxnet/issues/10026
#export MXNET_MKLDNN_DEBUG=1 # Ignored if not present
Expand All @@ -412,9 +401,9 @@ unittest_ubuntu_python3_gpu() {
# need to separte it from unittest_ubuntu_python2_gpu()
unittest_ubuntu_python2_quantization_gpu() {
set -ex
export PYTHONPATH=./python/
export PYTHONPATH=./python/
# MXNET_MKLDNN_DEBUG is buggy and produces false positives
# https://github.com/apache/incubator-mxnet/issues/10026
# https://github.com/apache/incubator-mxnet/issues/10026
#export MXNET_MKLDNN_DEBUG=1 # Ignored if not present
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
nosetests-2.7 --verbose tests/python/quantization_gpu
Expand All @@ -424,7 +413,7 @@ unittest_ubuntu_python2_quantization_gpu() {
# need to separte it from unittest_ubuntu_python3_gpu()
unittest_ubuntu_python3_quantization_gpu() {
set -ex
export PYTHONPATH=./python/
export PYTHONPATH=./python/
# MXNET_MKLDNN_DEBUG is buggy and produces false positives
# https://github.com/apache/incubator-mxnet/issues/10026
#export MXNET_MKLDNN_DEBUG=1 # Ignored if not present
Expand Down Expand Up @@ -479,7 +468,7 @@ unittest_centos7_gpu() {
python3.6 -m "nose" --with-timer --verbose tests/python/gpu
}

integrationtest_ubuntu_cpu_onnx() {
integrationtest_ubuntu_cpu_onnx() {
set -ex
export PYTHONPATH=./python/
python example/onnx/super_resolution.py
Expand All @@ -496,7 +485,7 @@ integrationtest_ubuntu_gpu_python() {

integrationtest_ubuntu_gpu_caffe() {
set -ex
export PYTHONPATH=/work/deps/caffe/python:./python
export PYTHONPATH=/work/deps/caffe/python:./python
python tools/caffe_converter/test_converter.py
}

Expand Down Expand Up @@ -545,7 +534,7 @@ test_ubuntu_cpu_python3() {
deploy_docs() {
set -ex
pushd .

make docs

popd
Expand Down
11 changes: 1 addition & 10 deletions include/mxnet/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,6 @@
#define MXNET_PREDICT_ONLY 0
#endif

/*!
* \brief define operator message for profiler
*/
#if MXNET_USE_PROFILER
#define PROFILER_MESSAGE(msg) msg
#else
#define PROFILER_MESSAGE(msg) nullptr
#endif

/*! \brief major version */
#define MXNET_MAJOR 1
/*! \brief minor version */
Expand All @@ -121,7 +112,7 @@
/*!
* \brief define function name as profiler message
*/
#define PROFILER_MESSAGE_FUNCNAME PROFILER_MESSAGE(__FUNCTION__)
#define PROFILER_MESSAGE_FUNCNAME (__FUNCTION__)

/*! \brief namespace of mxnet */
namespace mxnet {
Expand Down
3 changes: 0 additions & 3 deletions make/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ DEV = 0
# whether compile with debug
DEBUG = 0

# whether compile with profiler
USE_PROFILER =

# whether to turn on segfault signal handler to log the stack trace
USE_SIGNAL_HANDLER =

Expand Down
Loading

0 comments on commit 121adb6

Please sign in to comment.