MXNet: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
(Marked this version for translation)
m (Updated quick example to use an MXNet numpy matrix.)
Line 32: Line 32:


<!--T:12-->
<!--T:12-->
3. Validate it, by importing or listing its runtime features.
3. Validate it.
{{Command
{{Command
|prompt=(env) [name@server ~]
|prompt=(env) [name@server ~]
|python -c "import mxnet as mx"
|python -c "import mxnet as mx;print((mx.nd.ones((2, 3))*2).asnumpy());"
}}
{{Command
|prompt=(env) [name@server ~]
|python -c "from mxnet import runtime; print(runtime.feature_list())"
|result=
|result=
[✔ CUDA, ✔ CUDNN, ✔ NCCL, ✔ CUDA_RTC, ✖ TENSORRT, ✔ CPU_SSE, ✔ CPU_SSE2, ✔ CPU_SSE3, ✔ CPU_SSE4_1, ✔ CPU_SSE4_2, ✖ CPU_SSE4A, ✔ CPU_AVX, ✖ CPU_AVX2, ✔ OPENMP, ✖ SSE, ✔ F16C, ✖ JEMALLOC, ✖ BLAS_OPEN, ✖ BLAS_ATLAS, ✖ BLAS_MKL, ✖ BLAS_APPLE, ✔ LAPACK, ✔ MKLDNN, ✔ OPENCV, ✖ CAFFE, ✖ PROFILER, ✔ DIST_KVSTORE, ✖ CXX14, ✖ INT64_TENSOR_SIZE, ✔ SIGNAL_HANDLER, ✖ DEBUG, ✖ TVM_OP]
[[2. 2. 2.]
[2. 2. 2.]]
}}
}}


</translate>
</translate>

Revision as of 14:50, 13 July 2022

Other languages:

Apache MXNet is a deep learning framework designed for both efficiency and flexibility. It allows you to mix symbolic and imperative programming to maximize efficiency and productivity. At its core, MXNet contains a dynamic dependency scheduler that automatically parallelizes both symbolic and imperative operations on the fly. A graph optimization layer on top of that makes symbolic execution fast and memory efficient. MXNet is portable and lightweight, scalable to many GPUs and machines.

Available wheels

You can list available wheels using the avail_wheels command.

Question.png
[name@server ~]$ avail_wheels mxnet
name    version    python    arch
------  ---------  --------  ------
mxnet   1.9.1      cp39      avx2
mxnet   1.9.1      cp38      avx2
mxnet   1.9.1      cp310     avx2

Installing in a Python virtual environment

1. Create and activate a Python virtual environment.

[name@server ~]$ module load python/3.10
[name@server ~]$ virtualenv --no-download ~/env
[name@server ~]$ source ~/env/bin/activate


2. Install MXNet and its Python dependencies.

Question.png
(env) [name@server ~] pip install --no-index mxnet

3. Validate it.

Question.png
(env) [name@server ~] python -c "import mxnet as mx;print((mx.nd.ones((2, 3))*2).asnumpy());"
[[2. 2. 2.]
 [2. 2. 2.]]