You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/07/19 18:05:41 UTC

[GitHub] [incubator-mxnet] juselec opened a new issue #15610: Elasticnet Regression slower than pure Numpy

juselec opened a new issue #15610: Elasticnet Regression slower than pure Numpy
URL: https://github.com/apache/incubator-mxnet/issues/15610
 
 
   ## Description
   When I code a simple elasticnet regression in Gluon, it seems to be slower than a pure Numpy implementation. I am using the linux version of the package mxnet-cu101mkl inside a conda environment (installed without deps to use numpy from conda).
   
   ## Environment info (Required)
   
   ```
   ----------Python Info----------
   Version      : 3.7.3
   Compiler     : GCC 7.3.0
   Build        : ('default', 'Mar 27 2019 22:11:17')
   Arch         : ('64bit', 'ELF')
   ------------Pip Info-----------
   Version      : 19.1.1
   Directory    : /home/pr/.miniconda3/lib/python3.7/site-packages/pip
   ----------MXNet Info-----------
   Version      : 1.4.1
   Directory    : /home/pr/.miniconda3/lib/python3.7/site-packages/mxnet
   Commit Hash   : 1a7199691f5cbc6012bb53eecbf884bed5ae6590
   Library      : ['/home/pr/.miniconda3/lib/python3.7/site-packages/mxnet/libmxnet.so']
   Build features:
   No runtime build feature info available
   ----------System Info----------
   Platform     : Linux-5.2.1-arch1-1-ARCH-x86_64-with-arch-Arch-Linux
   system       : Linux
   node         : pr-pc
   release      : 5.2.1-arch1-1-ARCH
   version      : #1 SMP PREEMPT Sun Jul 14 14:52:52 UTC 2019
   ----------Hardware Info----------
   machine      : x86_64
   processor    : 
   Arquitectura:                        x86_64
   modo(s) de operación de las CPUs:    32-bit, 64-bit
   Orden de los bytes:                  Little Endian
   Tamaños de las direcciones:          39 bits physical, 48 bits virtual
   CPU(s):                              12
   Lista de la(s) CPU(s) en línea:      0-11
   Hilo(s) de procesamiento por núcleo: 2
   Núcleo(s) por «socket»:              6
   «Socket(s)»                          1
   Modo(s) NUMA:                        1
   ID de fabricante:                    GenuineIntel
   Familia de CPU:                      6
   Modelo:                              158
   Nombre del modelo:                   Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
   Revisión:                            10
   CPU MHz:                             3934.492
   CPU MHz máx.:                        4100,0000
   CPU MHz mín.:                        800,0000
   BogoMIPS:                            4417.00
   Virtualización:                      VT-x
   Caché L1d:                           192 KiB
   Caché L1i:                           192 KiB
   Caché L2:                            1,5 MiB
   Caché L3:                            9 MiB
   CPU(s) del nodo NUMA 0:              0-11
   Vulnerability L1tf:                  Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
   Vulnerability Mds:                   Mitigation; Clear CPU buffers; SMT vulnerable
   Vulnerability Meltdown:              Mitigation; PTI
   Vulnerability Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl and seccomp
   Vulnerability Spectre v1:            Mitigation; __user pointer sanitization
   Vulnerability Spectre v2:            Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
   Indicadores:                         fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nop
                                        l xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsav
                                        e avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mp
                                        x rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
   ----------Network Test----------
   Setting timeout: 10
   Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0046 sec, LOAD: 0.6770 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.1651 sec, LOAD: 1.1035 sec.
   Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0876 sec, LOAD: 0.7881 sec.
   Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0288 sec, LOAD: 1.2131 sec.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0249 sec, LOAD: 0.5225 sec.
   Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0065 sec, LOAD: 0.1867 sec.
   
   
   ```
   
   Package used:
   I am using the linux version of the python package mxnet-cu101mkl inside a conda environment (installed without deps to use numpy from conda).
   
   ```
   pip install --no-deps mxnet-cu101mkl
   ```
   
   ## Minimum reproducible example
   I have uploaded the two versions to a github repo, one with Gluon's implementation *Prueba_Mxnet_Pub.py* and other with a pure Numpy implementation *Prueba_Numpy_Pub.py*.
   
   The repo link is <https://github.com/juselec/Elasticnet_Adam>.
   
   ## Steps to reproduce
   
   ```
   (base) [pr@pr-pc ~]$ git clone https://github.com/juselec/Elasticnet_Adam
   (base) [pr@pr-pc ~]$ cd Elasticnet_Adam/
   (base) [pr@pr-pc Elasticnet_Adam]$ time python Prueba_Mxnet_Pub.py 
   
   real	0m20,122s
   user	1m13,441s
   sys	0m45,516s
   
   (base) [pr@pr-pc Elasticnet_Adam]$ time python Prueba_Numpy_Pub.py 
   
   real	0m0,157s
   user	0m0,362s
   sys	0m0,020s
   
   ```
   
   ## What have you tried to solve it?
   
   1. Change the implementation of the loss function. Instead of programming the loss function in a **gluon.HybridBlock**, create a **gluon.loss.Loss** class. The results are similar.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services