You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mxnet.apache.org by Pedro Larroy <pe...@gmail.com> on 2018/11/01 14:29:49 UTC

[Discuss] Feature detection at runtime / test skipping depending on features

Hi

There are some tests that fail when some features are not compiled in, such
as Opencv.

In some cases we skip the test according to some precondition such as:

@unittest.skipIf(not graphviz_exists(),....


I would propose that we have a Python module that exports a set of methods
to check what features are compiled in to skip tests which need this
feature.



test_gluon_data.test_recordimage_dataset ... [INFO] Setting test
np/mx/python random seeds, use MXNET_TEST_SEED=1883419283 to reproduce.
ERROR
test_gluon_data.test_recordimage_dataset_with_data_loader_multiworker ...
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in
_bootstrap
    self.run()
  File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File
"/usr/local/lib/python3.5/dist-packages/mxnet/gluon/data/dataloader.py",
line 189, in worker_loop
    batch = batchify_fn([dataset[i] for i in samples])
  File
"/usr/local/lib/python3.5/dist-packages/mxnet/gluon/data/dataloader.py",
line 189, in <listcomp>
    batch = batchify_fn([dataset[i] for i in samples])
  File
"/usr/local/lib/python3.5/dist-packages/mxnet/gluon/data/vision/datasets.py",
line 261, in __getitem__
    return image.imdecode(img, self._flag), header.label
  File "/usr/local/lib/python3.5/dist-packages/mxnet/image/image.py", line
147, in imdecode
    return _internal._cvimdecode(buf, *args, **kwargs)
  File "<string>", line 36, in _cvimdecode
  File "/usr/local/lib/python3.5/dist-packages/mxnet/_ctypes/ndarray.py",
line 92, in _imperative_invoke
    ctypes.byref(out_stypes)))
  File "/usr/local/lib/python3.5/dist-packages/mxnet/base.py", line 252, in
check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [19:21:42] /work/mxnet/src/io/image_io.cc:211: Build
with USE_OPENCV=1 for image io.


Pedro

Re: [Discuss] Feature detection at runtime / test skipping depending on features

Posted by Anton Chernov <me...@gmail.com>.
Great idea. I could see following checks being added:

* Is OpenMP enabled?
* Is CUDA enabled? (though already available as 0 for GPU count)
* Is NCCL enabled?
* CuDNN?
* What BLAS / LAPACK math library is used?
* F16 support enabled?
* KVStore enabled?
* TensorRT?

It would help to structure the tests better.

Best
Anton


чт, 1 нояб. 2018 г. в 15:30, Pedro Larroy <pe...@gmail.com>:

> Hi
>
> There are some tests that fail when some features are not compiled in, such
> as Opencv.
>
> In some cases we skip the test according to some precondition such as:
>
> @unittest.skipIf(not graphviz_exists(),....
>
>
> I would propose that we have a Python module that exports a set of methods
> to check what features are compiled in to skip tests which need this
> feature.
>
>
>
> test_gluon_data.test_recordimage_dataset ... [INFO] Setting test
> np/mx/python random seeds, use MXNET_TEST_SEED=1883419283 to reproduce.
> ERROR
> test_gluon_data.test_recordimage_dataset_with_data_loader_multiworker ...
> Process Process-1:
> Traceback (most recent call last):
>   File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in
> _bootstrap
>     self.run()
>   File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
>     self._target(*self._args, **self._kwargs)
>   File
> "/usr/local/lib/python3.5/dist-packages/mxnet/gluon/data/dataloader.py",
> line 189, in worker_loop
>     batch = batchify_fn([dataset[i] for i in samples])
>   File
> "/usr/local/lib/python3.5/dist-packages/mxnet/gluon/data/dataloader.py",
> line 189, in <listcomp>
>     batch = batchify_fn([dataset[i] for i in samples])
>   File
>
> "/usr/local/lib/python3.5/dist-packages/mxnet/gluon/data/vision/datasets.py",
> line 261, in __getitem__
>     return image.imdecode(img, self._flag), header.label
>   File "/usr/local/lib/python3.5/dist-packages/mxnet/image/image.py", line
> 147, in imdecode
>     return _internal._cvimdecode(buf, *args, **kwargs)
>   File "<string>", line 36, in _cvimdecode
>   File "/usr/local/lib/python3.5/dist-packages/mxnet/_ctypes/ndarray.py",
> line 92, in _imperative_invoke
>     ctypes.byref(out_stypes)))
>   File "/usr/local/lib/python3.5/dist-packages/mxnet/base.py", line 252, in
> check_call
>     raise MXNetError(py_str(_LIB.MXGetLastError()))
> mxnet.base.MXNetError: [19:21:42] /work/mxnet/src/io/image_io.cc:211: Build
> with USE_OPENCV=1 for image io.
>
>
> Pedro
>