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

Switch to cached op in the testing suite #18579

Merged
merged 76 commits into from
Jun 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
a9fca08
add default ctx to cachedop fwd
Jun 7, 2020
4239a4e
add test
Jun 7, 2020
f0738aa
perl fix
Jun 7, 2020
0222b49
initial commit
Jun 8, 2020
4a26dc3
update sparse tests
Jun 8, 2020
0819c55
add aux_states
Jun 8, 2020
6fe9240
Merge remote-tracking branch 'origin/master' into exec-v2
Jun 8, 2020
a217c85
fix aux-state type
Jun 8, 2020
613f0b8
fix some tests
Jun 8, 2020
a955a2a
fix check symbolic forwrad/backward
Jun 9, 2020
feb1e9b
fix symbolic grad check
Jun 9, 2020
39fbabe
Merge remote-tracking branch 'origin/master' into exec-v2
Jun 9, 2020
2359053
arg_dict fixes
Jun 9, 2020
ec733c8
Merge remote-tracking branch 'haibin/cached_op_init' into exec-v2
Jun 9, 2020
198f110
support init ops
Jun 9, 2020
fa81716
support forward only graph
Jun 9, 2020
98d856f
fix check symbolic backward stype
Jun 10, 2020
f870260
Merge remote-tracking branch 'origin/master' into exec-v2
Jun 11, 2020
b914316
add missing file
Jun 11, 2020
0bc69b0
resolve merge conflict
Jun 12, 2020
87b6a12
replace extension test bind
Jun 13, 2020
f2ea289
replace bind with _bind
Jun 13, 2020
2d62a0d
simplify backward_mul implementation
Jun 13, 2020
2fd0b01
small fix
Jun 13, 2020
865f1d2
drop contrib.sparseembedding
Jun 13, 2020
4d9384c
remove simple_bind in test sparse ops
Jun 13, 2020
de1371b
use simple_bind
Jun 13, 2020
a6dbed8
replave simple bind in quantization
Jun 13, 2020
dc1a0fd
fix aux index
Jun 14, 2020
d535e89
update amp simple_bind calls
Jun 14, 2020
aa0f9ac
drop ifft
Jun 14, 2020
cb989b3
fix a bug found in subgraph op
Jun 14, 2020
a31ee87
add aux_array method
Jun 14, 2020
57a4e0d
replace symbols
Jun 14, 2020
ecb0230
minor fix
Jun 14, 2020
17ba0f3
fix executor default context
Jun 14, 2020
104e650
fix import
Jun 14, 2020
3c59821
Merge remote-tracking branch 'origin/master' into exec-v2
Jun 14, 2020
8ec4938
bug fix for nd.where
Jun 14, 2020
8cdb0ce
add subgraph test
Jun 14, 2020
9a6af7a
fix forward grad req
Jun 14, 2020
9634c1e
fix batch dot dtype
Jun 14, 2020
7afcc90
remove unused code
Jun 15, 2020
967a493
fix slice dtype
Jun 15, 2020
7a8b73f
fix attach grad
Jun 15, 2020
27d927c
Merge remote-tracking branch 'origin/master' into exec-v2
Jun 15, 2020
64f47d9
remove tests for non-existing sparse ops
Jun 15, 2020
da8690f
MXCachedOpGetOptimizedSymbol
Jun 16, 2020
18978c4
fix foreach test
Jun 16, 2020
809b413
enhance err msg
Jun 16, 2020
66d3c5c
skip failed test
Jun 16, 2020
088c02e
add docs
Jun 16, 2020
70a6c99
add docs
Jun 16, 2020
b782109
fix lint
Jun 17, 2020
07d14ce
fix lint, remove quantization
Jun 18, 2020
25a5cc6
Merge branch 'exec-v2' of github.com:eric-haibin-lin/mxnet into exec-v2
Jun 18, 2020
08f638b
fix lint
Jun 18, 2020
6cf0869
fix conflict
Jun 18, 2020
631cafa
fix lint
Jun 18, 2020
70f38b4
fix lint
Jun 18, 2020
1ee94dd
fix build and import
Jun 18, 2020
8b467f2
fix import
Jun 18, 2020
5f92eb3
fix perl call
Jun 18, 2020
935e004
fix test
Jun 18, 2020
7b7e39f
remove perl binding
Jun 18, 2020
5a4ad35
remove reshape test
Jun 19, 2020
1ea994f
fix profiler, trt
Jun 19, 2020
9b3709f
remove tensorrt test
Jun 19, 2020
72ba4d1
remove quantization tests
Jun 19, 2020
4a28777
merge with master
Jun 19, 2020
5cc82b9
fix import
Jun 19, 2020
3881230
fix conflcit
Jun 19, 2020
ab66f22
Merge remote-tracking branch 'origin/master' into exec-v2
Jun 19, 2020
ea43ece
fix lint
Jun 19, 2020
3f79b31
Merge branch 'master' of https://github.com/dmlc/mxnet into exec-v2
Jun 20, 2020
c1cf4b4
skip buggy test
Jun 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions cd/mxnet_lib/mxnet_lib_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ def get_pipeline(mxnet_variant, build_fn) {
}
}

if (mxnet_variant.startsWith('cu')) {
tests["${mxnet_variant}: Quantization Python 3"] = {
stage("${mxnet_variant}: Quantization Python 3") {
timeout(time: max_time, unit: 'MINUTES') {
test_gpu_quantization_py3(mxnet_variant)
}
}
}
}

parallel tests
}

Expand Down Expand Up @@ -103,17 +93,6 @@ def unittest_py3(mxnet_variant) {
}
}

// Tests quantization in P3 instance using Python 3
def test_gpu_quantization_py3(mxnet_variant) {
node(NODE_LINUX_GPU_P3) {
ws("workspace/mxnet_${libtype}/${mxnet_variant}/${env.BUILD_NUMBER}") {
def image = get_environment(mxnet_variant)
ci_utils.unpack_and_init("mxnet_${mxnet_variant}", get_stash(mxnet_variant), false)
ci_utils.docker_run(image, "unittest_ubuntu_python3_quantization_gpu", true)
}
}
}

// Pushes artifact to artifact repository
def push(mxnet_variant) {
node(NODE_LINUX_CPU) {
Expand Down
4 changes: 0 additions & 4 deletions ci/docker/Dockerfile.build.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ RUN update-java-alternatives -s java-1.8.0-openjdk-amd64
COPY install/ubuntu_julia.sh /work/
RUN /work/ubuntu_julia.sh

# PDL::CCS missing on 18.04
COPY install/ubuntu_perl.sh /work/
RUN /work/ubuntu_perl.sh

# MXNetJS nightly needs emscripten for wasm
COPY install/ubuntu_emscripten.sh /work/
RUN /work/ubuntu_emscripten.sh
Expand Down
3 changes: 0 additions & 3 deletions ci/docker/Dockerfile.build.ubuntu_cpu_julia
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ RUN /work/ubuntu_scala.sh
COPY install/ubuntu_clojure.sh /work/
RUN /work/ubuntu_clojure.sh

COPY install/ubuntu_perl.sh /work/
RUN /work/ubuntu_perl.sh

COPY install/ubuntu_julia.sh /work/
RUN /work/ubuntu_julia.sh

Expand Down
27 changes: 0 additions & 27 deletions ci/docker/install/ubuntu_perl.sh

This file was deleted.

40 changes: 0 additions & 40 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,6 @@ cd_unittest_ubuntu() {

pytest -m 'not serial' -n 4 --durations=50 --verbose tests/python/unittest
pytest -m 'serial' --durations=50 --verbose tests/python/unittest
pytest -n 4 --durations=50 --verbose tests/python/quantization

# https://github.com/apache/incubator-mxnet/issues/11801
# if [[ ${mxnet_variant} = "cpu" ]] || [[ ${mxnet_variant} = "mkl" ]]; then
Expand Down Expand Up @@ -963,7 +962,6 @@ unittest_ubuntu_python3_cpu() {
MXNET_ENGINE_TYPE=NaiveEngine \
pytest -m 'not serial' -k 'test_operator' -n 4 --durations=50 --cov-report xml:tests_unittest.xml --cov-append --verbose tests/python/unittest
pytest -m 'serial' --durations=50 --cov-report xml:tests_unittest.xml --cov-append --verbose tests/python/unittest
pytest -n 4 --durations=50 --cov-report xml:tests_quantization.xml --verbose tests/python/quantization
}

unittest_ubuntu_python3_cpu_serial() {
Expand All @@ -976,7 +974,6 @@ unittest_ubuntu_python3_cpu_serial() {
export MXNET_ENABLE_CYTHON=0
export DMLC_LOG_STACK_TRACE_DEPTH=10
pytest --durations=50 --cov-report xml:tests_unittest.xml --verbose tests/python/unittest
pytest --durations=50 --cov-report xml:tests_quantization.xml --verbose tests/python/quantization
}

unittest_ubuntu_python3_cpu_mkldnn() {
Expand Down Expand Up @@ -1044,38 +1041,6 @@ unittest_ubuntu_python3_gpu_nocudnn() {
pytest -m 'serial' --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu
}

unittest_ubuntu_tensorrt_gpu() {
set -ex
export PYTHONPATH=./python/
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
export LD_LIBRARY_PATH=/work/mxnet/lib:$LD_LIBRARY_PATH
export CUDNN_VERSION=${CUDNN_VERSION:-7.0.3}
export MXNET_ENABLE_CYTHON=0
export DMLC_LOG_STACK_TRACE_DEPTH=10
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
pytest -n 4 --durations=50 --cov-report xml:tests_trt_gpu.xml --verbose --capture=no tests/python/tensorrt/test_ops.py
pytest -k 'not test_ops' --durations=50 --cov-report xml:tests_trt_gpu.xml --cov-append --verbose --capture=no tests/python/tensorrt/
}

# quantization gpu currently only runs on P3 instances
# need to separte it from unittest_ubuntu_python3_gpu()
unittest_ubuntu_python3_quantization_gpu() {
set -ex
if [ -f /etc/redhat-release ]; then
source /opt/rh/rh-python36/enable
fi
export PYTHONPATH=./python/
export MXNET_MKLDNN_DEBUG=0 # Ignored if not present
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
export CUDNN_VERSION=${CUDNN_VERSION:-7.0.3}
export MXNET_ENABLE_CYTHON=0
export DMLC_LOG_STACK_TRACE_DEPTH=10
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
pytest -n 4 --durations=50 --cov-report xml:tests_quantization_gpu.xml --verbose tests/python/quantization_gpu
}

unittest_centos7_cpu_scala() {
set -ex
source /opt/rh/devtoolset-7/enable
Expand Down Expand Up @@ -1104,11 +1069,6 @@ unittest_ubuntu_cpu_clojure_integration() {
}


unittest_ubuntu_cpugpu_perl() {
set -ex
./perl-package/test.sh
}

unittest_cpp() {
set -ex
build/tests/mxnet_unit_tests
Expand Down
77 changes: 0 additions & 77 deletions ci/jenkins/Jenkins_steps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -839,24 +839,6 @@ def test_unix_python3_gpu(lib_name) {
}]
}

def test_unix_python3_quantize_gpu(lib_name) {
return ['Python3: Quantize GPU': {
node(NODE_LINUX_GPU_P3) {
ws('workspace/ut-python3-quantize-gpu') {
timeout(time: max_time, unit: 'MINUTES') {
try {
utils.unpack_and_init(lib_name, mx_lib)
utils.docker_run('ubuntu_gpu_cu101', 'unittest_ubuntu_python3_quantization_gpu', true)
utils.publish_test_coverage()
} finally {
utils.collect_test_results_unix('tests_quantization_gpu.xml', 'tests_python3_quantize_gpu.xml')
}
}
}
}
}]
}

def test_unix_python3_debug_cpu() {
return ['Python3: CPU debug': {
node(NODE_LINUX_CPU) {
Expand Down Expand Up @@ -955,24 +937,6 @@ def test_unix_python3_mkldnn_nocudnn_gpu(lib_name) {
}]
}

def test_unix_python3_tensorrt_gpu(lib_name) {
return ['Python3: TensorRT GPU': {
node(NODE_LINUX_GPU_P3) {
ws('workspace/build-tensorrt') {
timeout(time: max_time, unit: 'MINUTES') {
try {
utils.unpack_and_init(lib_name, mx_tensorrt_lib)
utils.docker_run('ubuntu_gpu_tensorrt', 'unittest_ubuntu_tensorrt_gpu', true)
utils.publish_test_coverage()
} finally {
utils.collect_test_results_unix('tests_tensorrt.xml', 'tests_python3_tensorrt_gpu.xml')
}
}
}
}
}]
}

def test_unix_cpp_package_gpu(lib_name) {
return ['cpp-package GPU Makefile': {
node(NODE_LINUX_GPU_G4) {
Expand Down Expand Up @@ -1084,20 +1048,6 @@ def test_unix_r_mkldnn_cpu(lib_name) {
}]
}

def test_unix_perl_cpu(lib_name) {
return ['Perl: CPU Makefile': {
node(NODE_LINUX_CPU) {
ws('workspace/ut-perl-cpu') {
timeout(time: max_time, unit: 'MINUTES') {
utils.unpack_and_init(lib_name, mx_lib_make)
utils.docker_run('ubuntu_cpu', 'unittest_ubuntu_cpugpu_perl', false)
utils.publish_test_coverage()
}
}
}
}]
}

def test_unix_cpp_gpu(lib_name) {
return ['Cpp: GPU': {
node(NODE_LINUX_GPU_G4) {
Expand Down Expand Up @@ -1126,20 +1076,6 @@ def test_unix_cpp_cpu(lib_name) {
}]
}

def test_unix_perl_gpu(lib_name) {
return ['Perl: GPU Makefile': {
node(NODE_LINUX_GPU_G4) {
ws('workspace/ut-perl-gpu') {
timeout(time: max_time, unit: 'MINUTES') {
utils.unpack_and_init(lib_name, mx_lib_make)
utils.docker_run('ubuntu_gpu_cu101', 'unittest_ubuntu_cpugpu_perl', true)
utils.publish_test_coverage()
}
}
}
}]
}

def test_unix_r_gpu(lib_name) {
return ['R: GPU': {
node(NODE_LINUX_GPU_G4) {
Expand Down Expand Up @@ -1312,19 +1248,6 @@ def test_centos7_python3_cd_gpu(lib_name) {
}]
}

def test_centos7_quantization_cd_gpu(lib_name) {
return ['Quantization Python3: CentOS 7 GPU CD': {
node(NODE_LINUX_GPU_P3) {
ws('workspace/test-cd-static/gpu') {
timeout(time: max_time, unit: 'MINUTES') {
utils.unpack_and_init(lib_name, mx_cd_lib)
utils.docker_run('centos7_gpu_cu102', 'unittest_ubuntu_python3_quantization_gpu', true)
}
}
}
}]
}

def test_centos7_pypi_package_cd_gpu(lib_name) {
return ['PyPI package: CentOS 7 GPU CD': {
node(NODE_LINUX_GPU) {
Expand Down
1 change: 0 additions & 1 deletion ci/jenkins/Jenkinsfile_centos_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ core_logic: {
utils.parallel_stage('Tests', [
custom_steps.test_centos7_python3_gpu('centos7_gpu'),
custom_steps.test_centos7_python3_cd_gpu('centos7_gpu_cd'),
custom_steps.test_centos7_quantization_cd_gpu('centos7_gpu_cd'),
custom_steps.test_centos7_pypi_package_cd_gpu('centos7_gpu_cd')
])
}
Expand Down
1 change: 0 additions & 1 deletion ci/jenkins/Jenkinsfile_unix_cpu
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ core_logic: {
custom_steps.test_unix_scala_mkldnn_cpu('mkldnn_cpu_make'),
custom_steps.test_unix_clojure_cpu('cpu_make'),
custom_steps.test_unix_clojure_integration_cpu('cpu_make'),
custom_steps.test_unix_perl_cpu('cpu_make'),
custom_steps.test_unix_r_cpu('cpu'),
custom_steps.test_unix_r_mkldnn_cpu('mkldnn_cpu'),
custom_steps.test_unix_julia07_cpu('cpu'),
Expand Down
3 changes: 0 additions & 3 deletions ci/jenkins/Jenkinsfile_unix_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ core_logic: {

utils.parallel_stage('Tests', [
custom_steps.test_unix_python3_gpu('gpu'),
custom_steps.test_unix_python3_quantize_gpu('gpu'),
custom_steps.test_unix_python3_mkldnn_gpu('mkldnn_gpu'),
custom_steps.test_unix_python3_mkldnn_nocudnn_gpu('mkldnn_gpu_nocudnn'),
custom_steps.test_unix_python3_tensorrt_gpu('tensorrt'),
custom_steps.test_unix_perl_gpu('gpu_make'),
custom_steps.test_unix_r_gpu('gpu'),
custom_steps.test_unix_cpp_gpu('cmake_gpu'),
custom_steps.test_unix_cpp_package_gpu('gpu_make'),
Expand Down
3 changes: 1 addition & 2 deletions docs/python_docs/python/api/gluon/contrib/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Neural Network
Concurrent
HybridConcurrent
Identity
SparseEmbedding
SyncBatchNorm
PixelShuffle1D
PixelShuffle2D
Expand Down Expand Up @@ -165,4 +164,4 @@ API Reference

.. automodule:: mxnet.gluon.contrib.estimator
:members:
:imported-members:
:imported-members:
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,6 @@ Memory Allocation for Weight Gradient:
0.000 MBs ( 0.050%) for fullyconnected3
```

### Advanced: Sparse `weight`

You can optimize this example further by setting the weight's `stype` to `'row_sparse'`, but whether `'row_sparse'` weights make sense or not will depends on your specific task. See [contrib.SparseEmbedding](https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/gluon/contrib/nn/basic_layers.py#L118) for an example of this.

## Conclusion

As part of this tutorial, we learned how to write sparse data to disk in LibSVM format and load it back in sparse batches with the [LibSVMIter](/api/python/docs/api/mxnet/io/index.html#mxnet.io.LibSVMIter). We learned how to improve the performance of Gluon's [nn.Dense](/api/python/docs/api/gluon/nn/index.html#mxnet.gluon.nn.Dense) on sparse arrays using `mx.nd.sparse`. And lastly, we set `grad_stype` to `'row_sparse'` to reduce the size of the gradient and speed up the parameter update step.
Expand Down
Loading