[GitHub] coolbrain commented on issue #8156: Why mx-rcnn doesn't has proposal_target (cuda or C++) layer?

2017-10-05 Thread git
coolbrain commented on issue #8156: Why mx-rcnn doesn't has proposal_target 
(cuda or C++) layer?
URL: 
https://github.com/apache/incubator-mxnet/issues/8156#issuecomment-334658404
 
 
   Now proposal_target layer was implemented by CPU-based NumPy. When mx-rcnn 
is trained by multi-GPU, proposal_target layer becomes the bottleneck of 
acceleration by my observation. So I think if the proposal_target layer is 
implemented as proposal layer in cuda, the training will  be accelerated a lot 
when trained by  multi-GPU.  @precedenceguo 
 

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


With regards,
Apache Git Services


[GitHub] daranday commented on issue #4543: Can't use multi-core CPU correctly!

2017-10-05 Thread git
daranday commented on issue #4543: Can't use multi-core CPU correctly!
URL: 
https://github.com/apache/incubator-mxnet/issues/4543#issuecomment-334666532
 
 
   This problem was addressed. Adding the export line increased the detection 
speed dramatically!
 

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


With regards,
Apache Git Services


[GitHub] dytmas opened a new issue #4543: Can't use multi-core CPU correctly!

2017-10-05 Thread git
dytmas opened a new issue #4543: Can't use multi-core CPU correctly!
URL: https://github.com/apache/incubator-mxnet/issues/4543
 
 
   Run on CPU with openblas and openmp.
   
   Run the following code:
   ```
   import time, os
   
   def do(x, n):
   return [mx.nd.dot(x,x) for i in range(n)]
   
   def wait(x):
   for y in x:
   y.wait_to_read()
   
   tic = time.time()
   a = mx.nd.ones((1000, 1000))
   b = do(a, 1000)
   print('time for pushed into backend engine:\n %f sec' % (time.time()-tic))
   wait(b)
   print('time for all finished:\n %f sec' % (time.time()-tic))
   ```
   
   
   when OMP_NUM_THREADS = 4, it will take about 8-9s.
   but when OMP_NUM_THREADS = 32, it will take about 28-32s.
   
   I have checked and I am sure that when OMP_NUM_THREADS = 4,  4 cores are 
filled, when OMP_NUM_THREADS = 32, 32 cores are filled .
   
   when I set a = mx.nd.ones((1, 1))
   32 cores will be faster than 4 cores, but only about 2 times faster.
   
   why mxnet or openblas can't use the power of multi-core cpu, in such a 
simple situation?
   
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on issue #8164: a[-1] indexing doesn't work on NDArray

2017-10-05 Thread git
eric-haibin-lin commented on issue #8164: a[-1] indexing doesn't work on NDArray
URL: 
https://github.com/apache/incubator-mxnet/issues/8164#issuecomment-334665419
 
 
   This is because the At interface uses unsigned int
   
   On 2017?10?5? ?? at 22:53 Eric Junyuan Xie  wrote:
   
   > @reminisce 
   >
   > ?
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > 
,
   > or mute the thread
   > 

   > .
   >
   -- 
   Best Regards,
   Haibin Lin
   
   Department of Computer Science
   School of Computer Science
   Carnegie Mellon University
   
 

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


With regards,
Apache Git Services


[GitHub] piiswrong commented on issue #8164: a[-1] indexing doesn't work on NDArray

2017-10-05 Thread git
piiswrong commented on issue #8164: a[-1] indexing doesn't work on NDArray
URL: 
https://github.com/apache/incubator-mxnet/issues/8164#issuecomment-334664940
 
 
   @reminisce 
 

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


With regards,
Apache Git Services


[GitHub] coolbrain commented on issue #8156: Why mx-rcnn doesn't has proposal_target (cuda or C++) layer?

2017-10-05 Thread git
coolbrain commented on issue #8156: Why mx-rcnn doesn't has proposal_target 
(cuda or C++) layer?
URL: 
https://github.com/apache/incubator-mxnet/issues/8156#issuecomment-334658404
 
 
   Now proposal_target layer was implemented by CPU-based NumPy. When mx-rcnn 
is trained by multi-GPU, proposal_target layer becomes the bottleneck of 
acceleration by my observation. So I think if the proposal_target layer is 
implemented as proposal layer in cuda, the training will  be accelerated a lot 
when trained by  multi-GPU.  
 

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


With regards,
Apache Git Services


[GitHub] reminisce commented on issue #8158: Clarify behavior of shared executor memory sharing when using Bind

2017-10-05 Thread git
reminisce commented on issue #8158: Clarify behavior of shared executor memory 
sharing when using Bind
URL: 
https://github.com/apache/incubator-mxnet/issues/8158#issuecomment-334653001
 
 
   Seems like that shared_exec requires having the same param array size as the 
exec being bound if the param has the same name in two executors.
   
https://github.com/apache/incubator-mxnet/blob/master/src/executor/graph_executor.cc#L776
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin opened a new issue #8164: a[-1] indexing doesn't work on NDArray

2017-10-05 Thread git
eric-haibin-lin opened a new issue #8164: a[-1] indexing doesn't work on NDArray
URL: https://github.com/apache/incubator-mxnet/issues/8164
 
 
   This works for numpy:
   ```
   >>> import numpy as np
   >>> np.array([1,2])
   array([1, 2])
   >>> b = np.array([1,2])
   >>> b[-1]
   2
   ```
   But doesn't work for MXNet NDArray
   ```
   >>> a  = mx.nd.array([1,2,3])

  [2/11]
   >>> a[-1]
   [03:54:14] 
/home/ubuntu/incubator-mxnet/dmlc-core/include/dmlc/./logging.h:308: [03:54:14] 
src/ndarray/ndarray.cc:100: Check failed: begin <= end (4294967295 vs. 0) 
Invalid slicing range [4294967295, 0)
   
   Stack trace returned 10 entries:
   [bt] (0) 
/home/ubuntu/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN4dmlc15LogMessageFatalD1Ev+0x3f)
 [0x7fc9cb2a9c6f]
   [bt] (1) 
/home/ubuntu/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZNK5mxnet7NDArray5SliceEjj+0x19f)
 [0x7fc9cc6d0c0f]
   [bt] (2) 
/home/ubuntu/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet7NDArray15SliceWithRecordEjj+0x57)
 [0x7fc9cc6d118f]
   [bt] (3) 
/home/ubuntu/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet7NDArray12AtWithRecordEj+0xfe)
 [0x7fc9cc6d193c]
   [bt] (4) 
/home/ubuntu/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(MXNDArrayAt+0x6c)
 [0x7fc9ccc34721]
   [bt] (5) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c) 
[0x7fc9fba13e40]
   [bt] (6) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x2eb) 
[0x7fc9fba138ab]
   [bt] (7) 
/usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(_ctypes_callproc+0x48f)
 [0x7fc9fbc233df]
   [bt] (8) 
/usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(+0x11d82) 
[0x7fc9fbc27d82]
   [bt] (9) python(PyObject_Call+0x43) [0x4b0cb3]
   
   Traceback (most recent call last):
 File "", line 1, in 
 File "/home/ubuntu/incubator-mxnet/python/mxnet/ndarray/ndarray.py", line 
508, in __getitem__
   return self._at(key)
 File "/home/ubuntu/incubator-mxnet/python/mxnet/ndarray/ndarray.py", line 
685, in _at
   self.handle, idx, ctypes.byref(handle)))
 File "/home/ubuntu/incubator-mxnet/python/mxnet/base.py", line 145, in 
check_call
   raise MXNetError(py_str(_LIB.MXGetLastError()))
   mxnet.base.MXNetError: [03:54:14] src/ndarray/ndarray.cc:100: Check failed: 
begin <= end (4294967295 vs. 0) Invalid slicing range [4294967295, 0)
   
   Stack trace returned 10 entries:
   [bt] (0) 
/home/ubuntu/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN4dmlc15LogMessageFatalD1Ev+0x3f)
 [0x7fc9cb2a9c6f]
   [bt] (1) 
/home/ubuntu/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZNK5mxnet7NDArray5SliceEjj+0x19f)
 [0x7fc9cc6d0c0f]
   [bt] (2) 
/home/ubuntu/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet7NDArray15SliceWithRecordEjj+0x57)
 [0x7fc9cc6d118f]
   [bt] (3) 
/home/ubuntu/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet7NDArray12AtWithRecordEj+0xfe)
 [0x7fc9cc6d193c]
   [bt] (4) 
/home/ubuntu/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(MXNDArrayAt+0x6c)
 [0x7fc9ccc34721]
   [bt] (5) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c) 
[0x7fc9fba13e40]
   [bt] (6) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x2eb) 
[0x7fc9fba138ab]
   [bt] (7) 
/usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(_ctypes_callproc+0x48f)
 [0x7fc9fbc233df]
   [bt] (8) 
/usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(+0x11d82) 
[0x7fc9fbc27d82]
   [bt] (9) python(PyObject_Call+0x43) [0x4b0cb3]
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on issue #8136: stable sum

2017-10-05 Thread git
eric-haibin-lin commented on issue #8136: stable sum
URL: https://github.com/apache/incubator-mxnet/pull/8136#issuecomment-334650526
 
 
   @anirudh2290 make sure you use the stable sum to implement sum(csr) 
 

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


With regards,
Apache Git Services


[GitHub] piiswrong commented on issue #8123: Fix LeakyRELU Bug

2017-10-05 Thread git
piiswrong commented on issue #8123: Fix LeakyRELU Bug
URL: https://github.com/apache/incubator-mxnet/pull/8123#issuecomment-334650082
 
 
   This reliably fails on the same test. So I think there is a bug.
 

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


With regards,
Apache Git Services


[GitHub] piiswrong commented on issue #8123: Fix LeakyRELU Bug

2017-10-05 Thread git
piiswrong commented on issue #8123: Fix LeakyRELU Bug
URL: https://github.com/apache/incubator-mxnet/pull/8123#issuecomment-334650082
 
 
   This reliably fails on the same test. So I think these is a bug.
 

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


With regards,
Apache Git Services


[GitHub] szha commented on issue #8161: Creating sim-link to raw1394 file

2017-10-05 Thread git
szha commented on issue #8161: Creating sim-link to raw1394 file
URL: https://github.com/apache/incubator-mxnet/pull/8161#issuecomment-334649820
 
 
   To really find the error, please print the error instead of `sh "echo caught 
error"`
 

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


With regards,
Apache Git Services


[GitHub] szha commented on issue #8161: Creating sim-link to raw1394 file

2017-10-05 Thread git
szha commented on issue #8161: Creating sim-link to raw1394 file
URL: https://github.com/apache/incubator-mxnet/pull/8161#issuecomment-334649336
 
 
   the 1394 error is not really an error
 

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


With regards,
Apache Git Services


[GitHub] szha commented on issue #8152: gluon cached op call improvement

2017-10-05 Thread git
szha commented on issue #8152: gluon cached op call improvement
URL: https://github.com/apache/incubator-mxnet/pull/8152#issuecomment-334615158
 
 
   Thanks for the comments, I worked on this a bit more and simplified the 
assembly of calling arguments using one loop. I renamed the field for 
readability. And here are the timing results:
   
   workload:
   ```python
   import mxnet as mx
   from mxnet import gluon
   class example(gluon.HybridBlock):
   def __init__(self, num_args, num_params):
   super(example, self).__init__()
   self._num_args = num_args
   self._num_params = num_params
   for i in range(num_params):
   setattr(self, 'param%d'%i, self.params.get('param%d'%i, 
shape=(1,), init='ones'))
   def hybrid_forward(self, F, *args, **kwargs):
   return F.concat(*(a for a in (args+tuple(kwargs.values(, dim=0)
   
   num_args, num_params = 2, 50
   net = example(num_args, num_params)
   net.initialize()
   net.hybridize()
   ```
   
   And run:
   ```python
   %timeit -n 100 net(*(mx.nd.ones((1,)) for _ in 
range(num_args))).wait_to_read()
   ```
   
   Results:
   ```
   num_args, num_params = 100, 200
   100 loops, best of 3: 5.52 ms per loop
   100 loops, best of 3: 5.37 ms per loop
   
   num_args, num_params = 2, 50
   100 loops, best of 3: 333 ?s per loop
   100 loops, best of 3: 312 ?s per loop
   ```
 

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


With regards,
Apache Git Services


[GitHub] szha commented on issue #8156: Why mx-rcnn doesn't has proposal_target (cuda or C++) layer?

2017-10-05 Thread git
szha commented on issue #8156: Why mx-rcnn doesn't has proposal_target (cuda or 
C++) layer?
URL: 
https://github.com/apache/incubator-mxnet/issues/8156#issuecomment-334648848
 
 
   Are you proposing to write one? @zhreshold would that be useful?
 

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


With regards,
Apache Git Services


[GitHub] gautamkmr commented on issue #8161: Creating sim-link to raw1394 file

2017-10-05 Thread git
gautamkmr commented on issue #8161: Creating sim-link to raw1394 file
URL: https://github.com/apache/incubator-mxnet/pull/8161#issuecomment-334648083
 
 
   The failure is not related to this PR. Please put a  rebuild .
 

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


With regards,
Apache Git Services


[GitHub] chinakook commented on issue #8109: MakeLoss with CustomOp is useless.

2017-10-05 Thread git
chinakook commented on issue #8109: MakeLoss with CustomOp is useless.
URL: 
https://github.com/apache/incubator-mxnet/issues/8109#issuecomment-334647979
 
 
   @eric-haibin-lin The expected value should be all zero because the 
grad_scale param of mx.sym.CustomOp is set to 0. I will try later as @zhreshold 
said.
 

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


With regards,
Apache Git Services


[GitHub] gautamkmr commented on issue #8161: Creating sim-link to raw1394 file

2017-10-05 Thread git
gautamkmr commented on issue #8161: Creating sim-link to raw1394 file
URL: https://github.com/apache/incubator-mxnet/pull/8161#issuecomment-334648008
 
 
   LGTM Thanks for doing this.
 

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


With regards,
Apache Git Services


[incubator-mxnet] branch master updated (3a698da -> bbf1c0b)

2017-10-05 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git.


from 3a698da  Add gluon losses (#8149)
 add bbf1c0b  stable sum (#8136)

No new revisions were added by this update.

Summary of changes:
 mshadow   |  2 +-
 src/operator/mshadow_op.h | 71 +--
 src/operator/tensor/broadcast_reduce-inl.cuh  | 30 +--
 src/operator/tensor/broadcast_reduce-inl.h| 12 ++---
 src/operator/tensor/square_sum-inl.h  | 21 
 tests/python/unittest/test_sparse_operator.py |  2 +-
 6 files changed, 80 insertions(+), 58 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"comm...@mxnet.apache.org" '].


[GitHub] formath commented on issue #7233: assert size eq between shared_module.execs and context

2017-10-05 Thread git
formath commented on issue #7233: assert size eq between shared_module.execs 
and context
URL: https://github.com/apache/incubator-mxnet/pull/7233#issuecomment-334641590
 
 
   holiday now. I will check it when working
 

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


With regards,
Apache Git Services


[GitHub] piiswrong commented on issue #8149: Add gluon losses

2017-10-05 Thread git
piiswrong commented on issue #8149: Add gluon losses
URL: https://github.com/apache/incubator-mxnet/pull/8149#issuecomment-334640005
 
 
   cc @smolix @szha for reference
 

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


With regards,
Apache Git Services


[incubator-mxnet] branch master updated: Add gluon losses (#8149)

2017-10-05 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new 3a698da  Add gluon losses (#8149)
3a698da is described below

commit 3a698da9717a78786b1cc4f1268584562fafb5d1
Author: Eric Junyuan Xie 
AuthorDate: Thu Oct 5 19:07:15 2017 -0700

Add gluon losses (#8149)

* Revert "Revert "Many loss functions  (#7605)" (#8010)"

This reverts commit 6c3ca32d4e72a60fd43c8cf0190546c76259882d.

* fix

* fix doc

* add tests

* fix
---
 docs/_static/mxnet.css   |   2 +
 docs/api/python/gluon/loss.md|   6 +
 python/mxnet/gluon/loss.py   | 586 +++
 src/operator/tensor/elemwise_unary_op.cc |  55 ++-
 src/operator/tensor/elemwise_unary_op.cu |   3 +
 tests/python/unittest/test_loss.py   |  78 +++-
 6 files changed, 567 insertions(+), 163 deletions(-)

diff --git a/docs/_static/mxnet.css b/docs/_static/mxnet.css
index 7ade268..80b9008 100644
--- a/docs/_static/mxnet.css
+++ b/docs/_static/mxnet.css
@@ -1156,6 +1156,8 @@ dl.last.docutils dt{
 
 dl.docutils dt {
 color: #555;
+background-color: #f0f0f0;
+border-bottom: solid #ccc;
 }
 
 /*Model zoo page style--*/
diff --git a/docs/api/python/gluon/loss.md b/docs/api/python/gluon/loss.md
index 347eb49..3529e8e 100644
--- a/docs/api/python/gluon/loss.md
+++ b/docs/api/python/gluon/loss.md
@@ -16,9 +16,15 @@ This package includes several commonly used loss functions 
in neural networks.
 
 L2Loss
 L1Loss
+SigmoidBinaryCrossEntropyLoss
 SoftmaxCrossEntropyLoss
 SigmoidBinaryCrossEntropyLoss
 KLDivLoss
+HuberLoss
+HingeLoss
+SquaredHingeLoss
+LogisticLoss
+TripletLoss
 CTCLoss
 ```
 
diff --git a/python/mxnet/gluon/loss.py b/python/mxnet/gluon/loss.py
index fb9de63..5d8c8b7 100644
--- a/python/mxnet/gluon/loss.py
+++ b/python/mxnet/gluon/loss.py
@@ -22,7 +22,8 @@ from __future__ import absolute_import
 __all__ = ['Loss', 'L2Loss', 'L1Loss',
'SigmoidBinaryCrossEntropyLoss', 'SigmoidBCELoss',
'SoftmaxCrossEntropyLoss', 'SoftmaxCELoss',
-   'KLDivLoss', 'CTCLoss']
+   'KLDivLoss', 'CTCLoss', 'HuberLoss', 'HingeLoss',
+   'SquaredHingeLoss', 'LogisticLoss', 'TripletLoss']
 
 from .. import ndarray
 from ..base import numeric_types
@@ -58,11 +59,9 @@ def _apply_weighting(F, loss, weight=None, 
sample_weight=None):
 
 return loss
 
-def _reshape_label_as_output(F, output, label):
-# for symbolic output.shape is not available so we reshape
-# to empty shape and let it be inferred from output's shape
-# via the '-' operator later.
-return label.reshape(output.shape) if F is ndarray else label.reshape(())
+def _reshape_like(F, x, y):
+"""Reshapes x to the same shape as y."""
+return x.reshape(y.shape) if F is ndarray else F.reshape_like(x, y)
 
 class Loss(HybridBlock):
 """Base class for loss.
@@ -92,18 +91,18 @@ class Loss(HybridBlock):
 The first input tensor.
 *args : list of Symbol or list of NDArray
 Additional input tensors.
+
 """
 # pylint: disable= invalid-name
 raise NotImplementedError
 
 
 class L2Loss(Loss):
-"""Calculates the mean squared error between output and label.
+r"""Calculates the mean squared error between `pred` and `label`.
 
-.. math::
-L = \\frac{1}{2}\\sum_i \\Vert {output}_i - {label}_i \\Vert^2.
+.. math:: L = \frac{1}{2} \sum_i \vert {pred}_i - {label}_i \vert^2.
 
-Output and label can have arbitrary shape as long as they have the same
+`pred` and `label` can have arbitrary shape as long as they have the same
 number of elements.
 
 Parameters
@@ -114,33 +113,35 @@ class L2Loss(Loss):
 The axis that represents mini-batch.
 
 
-Input shape:
-`output` is the prediction tensor.
-`label` is the truth tensor and should have the same shape as `output`.
-`sample_weight` is a matrix for per-sample weighting. Must be 
broadcastable to
-the same shape as loss. For example, if loss has shape (64, 10) and 
you want
-to weigh each sample in the batch separately, `sample_weight` should 
have shape (64, 1).
+Inputs:
+- **pred**: prediction tensor with arbitrary shape
+- **label**: target tensor with the same size as pred.
+- **sample_weight**: element-wise weighting tensor. Must be 
broadcastable
+  to the same shape as pred. For example, if pred has shape (64, 10)
+  and you want to weigh each sample in the batch separately,
+  sample_weight should have shape (64, 1).
 
-Output shape:
-The loss output has the shape (batch_size,).
+Outputs:
+- **loss**: loss tensor w

[GitHub] piiswrong closed pull request #8149: Add gluon losses

2017-10-05 Thread git
piiswrong closed pull request #8149: Add gluon losses
URL: https://github.com/apache/incubator-mxnet/pull/8149
 
 
   
 

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


With regards,
Apache Git Services


[GitHub] sxjscience commented on issue #7233: assert size eq between shared_module.execs and context

2017-10-05 Thread git
sxjscience commented on issue #7233: assert size eq between shared_module.execs 
and context
URL: https://github.com/apache/incubator-mxnet/pull/7233#issuecomment-334638136
 
 
   @formath Have you checked it?
 

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


With regards,
Apache Git Services


[GitHub] CXMA479 opened a new issue #8163: Create cusolver handle failed

2017-10-05 Thread git
CXMA479 opened a new issue #8163: Create cusolver handle failed
URL: https://github.com/apache/incubator-mxnet/issues/8163
 
 
   For bugs or installation issues, please provide the following information.
   The more information you provide, the more likely people will be able to 
help you.
   
   ## Environment info
   Operating System:
   Ubuntu 14.04
   Compiler:
   g++-4.8
   Package used (Python/R/Scala/Julia):
   Python
   MXNet version:
   0.11.01
   Or if installed from source:
   Yes
   MXNet commit hash (`git rev-parse HEAD`):
   b5648a43955f7d05c0e53c1ab61a58bd402b4416
   If you are using python package, please provide
   numpy-1.13.1
   Python version and distribution:
   2.7.6
   If you are using R package, please provide
   
   R `sessionInfo()`:
   
   ## Error Message:
   Please paste the full error message, including stack trace.
   [09:06:36] 
/home/chen-k/mxnet_3/incubator-mxnet/dmlc-core/include/dmlc/logging.h:308: 
[09:06:36] 
/home/chen-k/mxnet_3/incubator-mxnet/mshadow/mshadow/./stream_gpu-inl.h:139: 
Check failed: err == CUSOLVER_STATUS_SUCCESS (7 vs. 0) Create cusolver handle 
failed
   
   Stack trace returned 8 entries:
   [bt] (0) 
/home/chen-k/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN4dmlc15LogMessageFatalD1Ev+0x3c)
 [0x7f90a6b6f19c]
   [bt] (1) 
/home/chen-k/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN7mshadow9NewStreamINS_3gpuEEEPNS_6StreamIT_EEbbi+0x821)
 [0x7f90a838f471]
   [bt] (2) 
/home/chen-k/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet6engine23ThreadedEnginePerDevice9GPUWorkerILN4dmlc19ConcurrentQueueTypeE0EEEvNS_7ContextEbPNS1_17ThreadWorkerBlockIXT_EEESt10shared_ptrINS0_10ThreadPool11SimpleEventEE+0x14a)
 [0x7f90a83a034a]
   [bt] (3) 
/home/chen-k/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZNSt17_Function_handlerIFvSt10shared_ptrIN5mxnet6engine10ThreadPool11SimpleEventEEEZZNS2_23ThreadedEnginePerDevice13PushToExecuteEPNS2_8OprBlockEbENKUlvE1_clEvEUlS5_E_E9_M_invokeERKSt9_Any_dataS5_+0x56)
 [0x7f90a83a0506]
   [bt] (4) 
/home/chen-k/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZNSt6thread5_ImplISt12_Bind_simpleIFSt8functionIFvSt10shared_ptrIN5mxnet6engine10ThreadPool11SimpleEventS8_EEE6_M_runEv+0x3b)
 [0x7f90a839d76b]
   [bt] (5) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x915b0) [0x7f908e37f5b0]
   [bt] (6) /lib/x86_64-linux-gnu/libpthread.so.0(+0x8184) [0x7f90bc4ad184]
   [bt] (7) /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f90bc1da37d]
   
   terminate called after throwing an instance of 'dmlc::Error'
 what():  [09:06:36] 
/home/chen-k/mxnet_3/incubator-mxnet/mshadow/mshadow/./stream_gpu-inl.h:139: 
Check failed: err == CUSOLVER_STATUS_SUCCESS (7 vs. 0) Create cusolver handle 
failed
   
   Stack trace returned 8 entries:
   [bt] (0) 
/home/chen-k/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN4dmlc15LogMessageFatalD1Ev+0x3c)
 [0x7f90a6b6f19c]
   [bt] (1) 
/home/chen-k/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN7mshadow9NewStreamINS_3gpuEEEPNS_6StreamIT_EEbbi+0x821)
 [0x7f90a838f471]
   [bt] (2) 
/home/chen-k/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet6engine23ThreadedEnginePerDevice9GPUWorkerILN4dmlc19ConcurrentQueueTypeE0EEEvNS_7ContextEbPNS1_17ThreadWorkerBlockIXT_EEESt10shared_ptrINS0_10ThreadPool11SimpleEventEE+0x14a)
 [0x7f90a83a034a]
   [bt] (3) 
/home/chen-k/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZNSt17_Function_handlerIFvSt10shared_ptrIN5mxnet6engine10ThreadPool11SimpleEventEEEZZNS2_23ThreadedEnginePerDevice13PushToExecuteEPNS2_8OprBlockEbENKUlvE1_clEvEUlS5_E_E9_M_invokeERKSt9_Any_dataS5_+0x56)
 [0x7f90a83a0506]
   [bt] (4) 
/home/chen-k/incubator-mxnet/python/mxnet/../../lib/libmxnet.so(_ZNSt6thread5_ImplISt12_Bind_simpleIFSt8functionIFvSt10shared_ptrIN5mxnet6engine10ThreadPool11SimpleEventS8_EEE6_M_runEv+0x3b)
 [0x7f90a839d76b]
   [bt] (5) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x915b0) [0x7f908e37f5b0]
   [bt] (6) /lib/x86_64-linux-gnu/libpthread.so.0(+0x8184) [0x7f90bc4ad184]
   [bt] (7) /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f90bc1da37d]
   
   Aborted (core dumped)
   ## Minimum reproducible example
   if you are using your own code, please provide a short script that 
reproduces the error.
   import mxnet as mx
   import numpy as np
   m=np.random.randint(0,9,(3,4))
   ctx=mx.gpu()
   mx_m1 = mx.nd.array(m,ctx)
   mx_m2 = mx.nd.array(m*-2, ctx)
   mx_m = mx_m1 + mx_m2
   ## Steps to reproduce
   or if you are running standard examples, please provide the commands you 
have run that lead to the error.
   
   1.
   2.
   3.
   
   ## What have you tried to solve it?
   
   1. I've searched on the internet but found nothing
   2. I've re-compiled the source, it reported an error when linking to the 
`GOMP`, after modifying `ADD_LDFLAGS` in `config.mk`, compiling went well. 
However, this script was still been blocked
   3. When I tried to back to `version 0.10.01`, all things went well
   
 
---

[GitHub] ashokei commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
ashokei commented on a change in pull request #7931: MKL-DNN integration: 
request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143088563
 
 

 ##
 File path: src/executor/attach_op_execs_pass.cc
 ##
 @@ -196,7 +201,7 @@ class FComputeExecutor : public StorageFallbackOpExecutor {
 PreFCompute(is_gpu);
 fcompute_(attrs_, op_ctx, in_data_, req, out_data_);
 PostFCompute(is_gpu);
-#if MKL_EXPERIMENTAL == 1
+#if MKL_EXPERIMENTAL == 1 || MXNET_USE_MKLDNN == 1
 mkl_tblobs_prv_to_cpu(in_data_);
 
 Review comment:
   we ensure we can convert back to cpu layout, it does not assume mutability 
or not.
 

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


With regards,
Apache Git Services


[GitHub] szha commented on issue #8159: Fine tune tutorial urllib bug on Python 3

2017-10-05 Thread git
szha commented on issue #8159: Fine tune tutorial urllib bug on Python 3
URL: 
https://github.com/apache/incubator-mxnet/issues/8159#issuecomment-334627685
 
 
   Would you propose a change in the form a pull request?
 

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


With regards,
Apache Git Services


[GitHub] szha closed pull request #8162: update arg params in image_classification.py

2017-10-05 Thread git
szha closed pull request #8162: update arg params in image_classification.py
URL: https://github.com/apache/incubator-mxnet/pull/8162
 
 
   
 

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


With regards,
Apache Git Services


[incubator-mxnet] branch master updated: update arg params in image_classification.py (#8162)

2017-10-05 Thread zhasheng
This is an automated email from the ASF dual-hosted git repository.

zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new 92e5198  update arg params in image_classification.py (#8162)
92e5198 is described below

commit 92e5198d659ab8f69e229c54a36e5a25a2fa
Author: Haibin Lin 
AuthorDate: Thu Oct 5 17:25:04 2017 -0700

update arg params in image_classification.py (#8162)
---
 example/gluon/image_classification.py | 17 +
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/example/gluon/image_classification.py 
b/example/gluon/image_classification.py
index ea3aa8d..8481afb 100644
--- a/example/gluon/image_classification.py
+++ b/example/gluon/image_classification.py
@@ -39,7 +39,7 @@ parser.add_argument('--val-data', type=str, default='',
 help='validation record file to use, required for 
imagenet.')
 parser.add_argument('--batch-size', type=int, default=32,
 help='training batch size per device (CPU/GPU).')
-parser.add_argument('--gpus', type=int, default=0,
+parser.add_argument('--num-gpus', type=int, default=0,
 help='number of gpus to use.')
 parser.add_argument('--epochs', type=int, default=3,
 help='number of training epochs.')
@@ -51,8 +51,6 @@ parser.add_argument('--wd', type=float, default=0.0001,
 help='weight decay rate. default is 0.0001.')
 parser.add_argument('--seed', type=int, default=123,
 help='random seed to use. Default=123.')
-parser.add_argument('--benchmark', action='store_true',
-help='whether to run benchmark.')
 parser.add_argument('--mode', type=str,
 help='mode in which to train the model. options are 
symbolic, imperative, hybrid')
 parser.add_argument('--model', type=str, required=True,
@@ -76,15 +74,10 @@ dataset_classes = {'mnist': 10, 'cifar10': 10, 'imagenet': 
1000, 'dummy': 1000}
 
 batch_size, dataset, classes = opt.batch_size, opt.dataset, 
dataset_classes[opt.dataset]
 
-gpus = opt.gpus
+num_gpus = opt.num_gpus
 
-if opt.benchmark:
-batch_size = 32
-dataset = 'dummy'
-classes = 1000
-
-batch_size *= max(1, gpus)
-context = [mx.gpu(i) for i in range(gpus)] if gpus > 0 else [mx.cpu()]
+batch_size *= max(1, num_gpus)
+context = [mx.gpu(i) for i in range(num_gpus)] if num_gpus > 0 else [mx.cpu()]
 
 model_name = opt.model
 
@@ -178,7 +171,7 @@ if __name__ == '__main__':
 data = mx.sym.var('data')
 out = net(data)
 softmax = mx.sym.SoftmaxOutput(out, name='softmax')
-mod = mx.mod.Module(softmax, context=[mx.gpu(i) for i in range(gpus)] 
if gpus > 0 else [mx.cpu()])
+mod = mx.mod.Module(softmax, context=[mx.gpu(i) for i in 
range(num_gpus)] if num_gpus > 0 else [mx.cpu()])
 mod.fit(train_data,
 eval_data = val_data,
 num_epoch=opt.epochs,

-- 
To stop receiving notification emails like this one, please contact
['"comm...@mxnet.apache.org" '].


[GitHub] ashokei commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
ashokei commented on a change in pull request #7931: MKL-DNN integration: 
request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143085544
 
 

 ##
 File path: include/mxnet/ndarray.h
 ##
 @@ -512,7 +512,7 @@ class NDArray {
 CHECK_GE(shape_.Size() * mshadow::mshadow_sizeof(dtype_),
  shape.Size() * mshadow::mshadow_sizeof(dtype))
 << "NDArray.AsArray: target memory size is bigger";
-#if MKL_EXPERIMENTAL == 1
+#if MKL_EXPERIMENTAL == 1 || MXNET_USE_MKLDNN == 1
 if (Mkl_mem_ != nullptr) {
   // convert prv to cpu
   Mkl_mem_->check_and_prv_to_cpu(ptr_->shandle.dptr);
 
 Review comment:
   we create layout conversion (cpu->prv) in each operator code transparently, 
this allows us to avoid layout conversions if the next (or preceding) operators 
are also mkldnn operators.  we convert back to cpu here:
   
   
https://github.com/apache/incubator-mxnet/pull/7931/files#diff-91ec751a29892f182cd05ff8de7c5755R135
   
   check_and_prv_to_cpu can be used to convert to cpu layout, outside of the 
operator code, on an as needed basis.
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin opened a new pull request #8162: update arg params in image_classification.py

2017-10-05 Thread git
eric-haibin-lin opened a new pull request #8162: update arg params in 
image_classification.py
URL: https://github.com/apache/incubator-mxnet/pull/8162
 
 
   
 

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


With regards,
Apache Git Services


[GitHub] ptrendx commented on issue #8103: rec generated by im2rec.py has same value for different key in idx

2017-10-05 Thread git
ptrendx commented on issue #8103: rec generated by im2rec.py has same value for 
different key in idx
URL: 
https://github.com/apache/incubator-mxnet/issues/8103#issuecomment-334620717
 
 
   Hi @caiqi - could you check that applying this PR dmlc/dmlc-core#318 fixes 
your issue?
 

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


With regards,
Apache Git Services


[GitHub] tqchen commented on issue #621: Support for other Device Types, OpenCL AMD GPU

2017-10-05 Thread git
tqchen commented on issue #621: Support for other Device Types, OpenCL AMD GPU
URL: https://github.com/apache/incubator-mxnet/issues/621#issuecomment-334619787
 
 
   yes, TVM support OpenCL, Metal, CUDA, ARM x86 javascript
 

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


With regards,
Apache Git Services


[GitHub] fye881 commented on issue #621: Support for other Device Types, OpenCL AMD GPU

2017-10-05 Thread git
fye881 commented on issue #621: Support for other Device Types, OpenCL AMD GPU
URL: https://github.com/apache/incubator-mxnet/issues/621#issuecomment-334618358
 
 
   @tqchen do you mean that TVM supports opencl? I would like to use mxnet with 
opencl to use ARM GPU (Mali).
 

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


With regards,
Apache Git Services


[GitHub] szha commented on issue #8152: memory save

2017-10-05 Thread git
szha commented on issue #8152: memory save
URL: https://github.com/apache/incubator-mxnet/pull/8152#issuecomment-334615158
 
 
   Thanks for the comments, I worked on this a bit more and simplified the 
assembly of calling arguments using one loop. I renamed the field for 
readability. And here are the timing results:
   
   workload:
   ```python
   import mxnet as mx
   from mxnet import gluon
   class example(gluon.HybridBlock):
   def __init__(self, num_args, num_params):
   super(example, self).__init__()
   self._num_args = num_args
   self._num_params = num_params
   for i in range(num_params):
   setattr(self, 'param%d'%i, self.params.get('param%d'%i, 
shape=(1,), init='ones'))
   def hybrid_forward(self, F, *args, **kwargs):
   return F.concat(*(a for a in (args+tuple(kwargs.values(, dim=0)
   
   num_args, num_params = 2, 50
   net = example(num_args, num_params)
   net.initialize()
   net.hybridize()
   ```
   
   Results:
   ```
   num_args, num_params = 100, 200
   100 loops, best of 3: 5.52 ms per loop
   100 loops, best of 3: 5.37 ms per loop
   
   num_args, num_params = 2, 50
   100 loops, best of 3: 333 ?s per loop
   100 loops, best of 3: 312 ?s per loop
   ```
 

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


With regards,
Apache Git Services


[GitHub] b0noI opened a new pull request #8161: Creating sim-link to raw1394 file

2017-10-05 Thread git
b0noI opened a new pull request #8161: Creating sim-link to raw1394 file
URL: https://github.com/apache/incubator-mxnet/pull/8161
 
 
   Description of the bug: https://github.com/jsk-ros-pkg/jsk_travis/issues/187
   
   There are a lot of build failures with this problem:
   
https://builds.apache.org/view/Incubator%20Projects/job/incubator-mxnet/job/master/482/
   
https://builds.apache.org/view/Incubator%20Projects/job/incubator-mxnet/job/master/475/
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #8154: Add infer storage type function for sparse slice operator

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #8154: Add infer storage 
type function for sparse slice operator
URL: https://github.com/apache/incubator-mxnet/pull/8154#discussion_r143069419
 
 

 ##
 File path: tests/python/unittest/test_sparse_ndarray.py
 ##
 @@ -113,9 +113,20 @@ def check_sparse_nd_csr_slice(shape):
 assert same(A[start:end].asnumpy(), A2[start:end])
 assert same(A[start:].asnumpy(), A2[start:])
 assert same(A[:end].asnumpy(), A2[:end])
+
+def check_slice_nd_csr_fallback(shape):
+stype = 'csr'
+A, _ = rand_sparse_ndarray(shape, stype)
+A2 = A.asnumpy()
+start = rnd.randint(0, shape[0] - 1)
+end = rnd.randint(start + 1, shape[0])
+result = mx.nd.sparse.slice(A, begin=(start, shape[1] - 1), end=(end + 
1, shape[1]))
 
 Review comment:
   Got it
 

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


With regards,
Apache Git Services


[GitHub] szha commented on issue #8140: use fma in fully connected.

2017-10-05 Thread git
szha commented on issue #8140: use fma in fully connected.
URL: https://github.com/apache/incubator-mxnet/pull/8140#issuecomment-334603530
 
 
   Closing as the memcopy cost outweighs the benefit of doing addition in gemm.
 

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


With regards,
Apache Git Services


[GitHub] szha closed pull request #8140: use fma in fully connected.

2017-10-05 Thread git
szha closed pull request #8140: use fma in fully connected.
URL: https://github.com/apache/incubator-mxnet/pull/8140
 
 
   
 

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


With regards,
Apache Git Services


[GitHub] anirudh2290 commented on a change in pull request #8154: Add infer storage type function for sparse slice operator

2017-10-05 Thread git
anirudh2290 commented on a change in pull request #8154: Add infer storage type 
function for sparse slice operator
URL: https://github.com/apache/incubator-mxnet/pull/8154#discussion_r143061041
 
 

 ##
 File path: tests/python/unittest/test_sparse_ndarray.py
 ##
 @@ -113,9 +113,20 @@ def check_sparse_nd_csr_slice(shape):
 assert same(A[start:end].asnumpy(), A2[start:end])
 assert same(A[start:].asnumpy(), A2[start:])
 assert same(A[:end].asnumpy(), A2[:end])
+
+def check_slice_nd_csr_fallback(shape):
+stype = 'csr'
+A, _ = rand_sparse_ndarray(shape, stype)
+A2 = A.asnumpy()
+start = rnd.randint(0, shape[0] - 1)
+end = rnd.randint(start + 1, shape[0])
+result = mx.nd.sparse.slice(A, begin=(start, shape[1] - 1), end=(end + 
1, shape[1]))
 
 Review comment:
   begin means the starting coordinate on one or more axis. The position of 
values in the tuple indicate which axis to slice along For example for a 3d 
matrix of shape(3,3,3) slicing with begin=(0,0,0) and end=(2,2,2) will return a 
2*2*2 matrix.
   
   
   
 

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


With regards,
Apache Git Services


[GitHub] anirudh2290 commented on a change in pull request #8154: Add infer storage type function for sparse slice operator

2017-10-05 Thread git
anirudh2290 commented on a change in pull request #8154: Add infer storage type 
function for sparse slice operator
URL: https://github.com/apache/incubator-mxnet/pull/8154#discussion_r143061041
 
 

 ##
 File path: tests/python/unittest/test_sparse_ndarray.py
 ##
 @@ -113,9 +113,20 @@ def check_sparse_nd_csr_slice(shape):
 assert same(A[start:end].asnumpy(), A2[start:end])
 assert same(A[start:].asnumpy(), A2[start:])
 assert same(A[:end].asnumpy(), A2[:end])
+
+def check_slice_nd_csr_fallback(shape):
+stype = 'csr'
+A, _ = rand_sparse_ndarray(shape, stype)
+A2 = A.asnumpy()
+start = rnd.randint(0, shape[0] - 1)
+end = rnd.randint(start + 1, shape[0])
+result = mx.nd.sparse.slice(A, begin=(start, shape[1] - 1), end=(end + 
1, shape[1]))
 
 Review comment:
   begin means the starting coordinate on one or more axis. The position of 
values in the tuple indicate which axis to slice along For example for a 3d 
matrix of shape(3,3,3) slicing with begin=(0,0,0) and end=(2,2,2) will return a 
2x2x2 matrix.
   
   
   
 

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


With regards,
Apache Git Services


[GitHub] seveniruby opened a new issue #8160: scala example core dump when model bind

2017-10-05 Thread git
seveniruby opened a new issue #8160: scala example core dump when model bind
URL: https://github.com/apache/incubator-mxnet/issues/8160
 
 
   For bugs or installation issues, please provide the following information.
   The more information you provide, the more likely people will be able to 
help you.
   
   ## Environment info
   Operating System: mac
   Compiler: scala sbt
   MXNet version: 0.11.0
   Or if installed from source: yes
   MXNet commit hash (`git rev-parse HEAD`): 
a5edbf94094581ee27157eae4f2113115a3994e7
   
   ## Minimum reproducible example
   convert from 
http://www.infoq.com/cn/articles/an-introduction-to-the-mxnet-api-part03
   ```scala
 test("data train"){
   val sample_count = 1000
   val train_count = 800
   val valid_count = sample_count - train_count
   val feature_count = 5
   val category_count = 3
   val batch=10
   
   val x=NDArray.uniform(0, 1, Shape(sample_count, feature_count))
   val y=NDArray.uniform(0, 1, Shape(sample_count))
   
   val xTrain=NDArray.crop(Map("begin"->Shape(0,0), 
"end"->Shape(train_count, feature_count-1)))(x)
   val xValid=NDArray.crop(Map("begin"->Shape(train_count, 0), 
"end"->Shape(sample_count, feature_count-1)))(x)
   val yTrain=y.slice(0, train_count)
   val yValid=y.slice(train_count, sample_count)
   
   val data=Symbol.Variable("data")
   val fc1=Symbol.FullyConnected("fc1")()(Map("data"->data, 
"num_hidden"->16))
   val relu1=Symbol.Activation("relu1")()(Map("data"->fc1, "act_type" -> 
"relu"))
   val fc2=Symbol.FullyConnected("fc2")()(Map("data"->relu1, 
"num_hidden"->category_count))
   val out=Symbol.SoftmaxOutput("out")()(Map("data"->fc2))
   val model=new module.Module(out)
   
   val iter=new NDArrayIter(data=IndexedSeq(xTrain), 
label=IndexedSeq(yTrain), dataBatchSize = batch)
   
   
   /*
   model.bind(dataShapes=IndexedSeq(new DataDesc(name = "data", 
shape=xTrain.shape)),
 labelShapes=Option(IndexedSeq(new DataDesc(name = "label", shape 
=yTrain.shape)))
   )
   */
   
   println("bind start")
   model.bind(dataShapes=iter.provideData, labelShapes = 
Option(iter.provideLabel))
   println("init")
   model.initParams(new Xavier(magnitude=2))
   model.initOptimizer(optimizer = new SGD(learningRate = 0.1F))
   model.fit(iter,numEpoch = 50)
   
 }
   ```
   ## Steps to reproduce
   everytime core dump when run at model.bind()
   
   
   ## Error Message:
   Please paste the full error message, including stack trace.
   
   ```
   #
   # A fatal error has been detected by the Java Runtime Environment:
   #
   #  SIGBUS (0xa) at pc=0x7fffbf7c3ec9, pid=6294, tid=7171
   #
   # JRE version: Java(TM) SE Runtime Environment (8.0_51-b16) (build 
1.8.0_51-b16)
   # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode bsd-amd64 
compressed oops)
   # Problematic frame:
   # C  [libsystem_platform.dylib+0x5ec9]  
_platform_memmove$VARIANT$Haswell+0x29
   #
   # Failed to write core dump. Core dumps have been disabled. To enable core 
dumping, try "ulimit -c unlimited" before starting Java again
   #
   # If you would like to submit a bug report, please visit:
   #   http://bugreport.java.com/bugreport/crash.jsp
   #
   
   ---  T H R E A D  ---
   
   Current thread (0x7fc4c5804800):  JavaThread 
"ScalaTest-run-running-MXNetDemo" [_thread_in_vm, id=7171, 
stack(0x77007000,0x77107000)]
   
   siginfo: si_signo: 10 (SIGBUS), si_code: 2 (BUS_ADRERR), si_addr: 
0x00010341d000
   
   Registers:
   RAX=0x0006c010, RBX=0x0b2a6a00, RCX=0x0ab37d70, 
RDX=0x0b2a6a00
   RSP=0x77104060, RBP=0x77104060, RSI=0x00010341d000, 
RDI=0x0006c076eca0
   R8 =0x0007cb68, R9 =0x, R10=0x1012, 
R11=0x0005bd351ca0
   R12=0x, R13=0x7fc4c5804800, R14=0x02ca9a80, 
R15=0x7fc4c4f07178
   RIP=0x7fffbf7c3ec9, EFLAGS=0x00010206, ERR=0x0004
 TRAPNO=0x000e
   
   Top of Stack: (sp=0x77104060)
   0x77104060:   771040d0 000102713e3f
   0x77104070:   000102cae370 7fc4c5804800
   0x77104080:    7fc4c5804800
   0x77104090:    7fc4c5804800
   0x771040a0:   7fc4c5804800 7fc4c4f07178
   0x771040b0:   0001 000108fa8148
   0x771040c0:   7fc4c58049f8 
   0x771040d0:   771041d0 000121274933
   0x771040e0:   77104198 77104190
   0x771040f0:   7710418c 77104180
   0x77104100:   77104178 77104174
   0x77104110:   77104168 77104160
   0x77104120:   7710415c 0003
   0x77104130:   771042c8 0002025eb0c6
   0x70

[GitHub] eric-haibin-lin commented on a change in pull request #8154: Add infer storage type function for sparse slice operator

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #8154: Add infer storage 
type function for sparse slice operator
URL: https://github.com/apache/incubator-mxnet/pull/8154#discussion_r143053464
 
 

 ##
 File path: tests/python/unittest/test_sparse_ndarray.py
 ##
 @@ -113,9 +113,20 @@ def check_sparse_nd_csr_slice(shape):
 assert same(A[start:end].asnumpy(), A2[start:end])
 assert same(A[start:].asnumpy(), A2[start:])
 assert same(A[:end].asnumpy(), A2[:end])
+
+def check_slice_nd_csr_fallback(shape):
+stype = 'csr'
+A, _ = rand_sparse_ndarray(shape, stype)
+A2 = A.asnumpy()
+start = rnd.randint(0, shape[0] - 1)
+end = rnd.randint(start + 1, shape[0])
+result = mx.nd.sparse.slice(A, begin=(start, shape[1] - 1), end=(end + 
1, shape[1]))
 
 Review comment:
   is begin on axis=0 and end on axis=1? 
 

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


With regards,
Apache Git Services


[GitHub] piiswrong opened a new pull request #8149: Add gluon losses

2017-10-05 Thread git
piiswrong opened a new pull request #8149: Add gluon losses
URL: https://github.com/apache/incubator-mxnet/pull/8149
 
 
   Added back some of the losses reverted in #8010
   
   Losses that are not added back include
   ```python
   class MultiClassHingeLoss(Loss):
   """Calculates the MaxMargin loss, aka multiclass soft-margin
  loss. This requires access to a multiclass loss matrix delta
  which measures the cost for misclassifying label y as y'. This
  matrix can be specified at construction time. If it does not
  exist, we will susbstitute it with a 0-1 loss with automagic
  size inference.
   
   .. math::
  L = {max}_{y} [\\delta({label}, y) + {output}[y]] - {output}_{label}
   
   Label's shape should be output's shape without the `axis` dimension. 
i.e. for
   `output.shape` = (1,2,3,4) and axis = 2, `label.shape` should be (1,2,4).
   
   Parameters
   --
   delta : loss matrix, default None. In this case it is presumed to
   be a (0,1) loss, i.e. a constant loss of 1 for all
   misclassifications. Otherwise its dimensionality must match
   that of the number of classes.
   axis : int, default -1
   The axis to sum over when taking the maximum.
   weight : float or None
   Global scalar weight for loss.
   batch_axis : int, default 0
   The axis that represents mini-batch.
   """
   def __init__(self, delta=None, axis=-1, weight=None, batch_axis=0, 
**kwargs):
   super(MaxMargin, self).__init__(weight, batch_axis, **kwargs)
   self._axis = axis
   self._delta = delta
   super(MaxMargin, self).__init__(weight, batch_axis, **kwargs)
   
   def hybrid_forward(self, F, output, label, sample_weight=None):
   # Check if the cost matrix has been defined. If not, use a
   # dumb (0,1) loss. This is only executed once, the first time
   # you invoke the loss.
   if (self._delta is None):
   classes = output.shape[self._axis]
   self._delta = F.ones(shape=(classes, classes))
   for i in range(classes):
   self._delta[i, i] = 0
   loss = -F.pick(output, label, axis=self._axis, keepdims=True)
   loss += F.max(output + F.take(self._delta, label), axis=self._axis, 
keepdims=True)
   loss = _apply_weighting(F, loss, self._weight, sample_weight)
   return F.mean(loss, axis=self._batch_axis, exclude=True)
   ```
   there are multiple versions of mult hinge loss. Also the implementation here 
won't work on GPU. Use of delta matrix is over complicated.
   
   ```python
   class EpsilonInsensitiveLoss(Loss):
   """Calculates a loss that is insensitive to absolute error smaller than
   epsilon.
   
   .. math::
   L = \\mathrm{max}(0, |{output}_i - {label}_i| - \\epsilon)
   
   Output and label must have the same number of elements.
   
   Parameters
   --
   epsilon : float
   Threshold for trimmed epsilon-insensitivity parameter. By default 
set to 0.1
   weight : float or None
   Global scalar weight for loss.
   batch_axis : int, default 0
   The axis that represents mini-batch.
   """
   def __init__(self, epsilon, weight=None, batch_axis=0, **kwargs):
   super(EpsilonInsensitiveLoss, self).__init__(weight, batch_axis, 
**kwargs)
   self._epsilon = epsilon
   
   def hybrid_forward(self, F, output, label, sample_weight=None):
   label = _reshape_label_as_output(F, output, label)
   loss = F.relu(F.abs(output - label) - self._epsilon)
   loss = _apply_weighting(F, loss, self._weight, sample_weight)
   return F.mean(loss, axis=self._batch_axis, exclude=True)
   
   ```
   Don't like the name. Is there a better one?
   
   ```python
   
   class ExponentialLoss(Loss):
   """Calculates the exponential hinge loss (quite obscure):
   
   .. math::
   L = \\exp(- {output}_i {label}_i)
   
   Output and label must have the same shape.
   
   Parameters
   --
   weight : float or None
   Global scalar weight for loss.
   batch_axis : int, default 0
   The axis that represents mini-batch.
   """
   def __init__(self, weight=None, batch_axis=0, **kwargs):
   super(Exponential, self).__init__(weight, batch_axis, **kwargs)
   
   def hybrid_forward(self, F, output, label, sample_weight=None):
   label = _reshape_label_as_output(F, output, label)
   loss = F.exp(-output * label)
   loss = _apply_weighting(F, loss, self._weight, sample_weight)
   return F.mean(loss, axis=self._batch_axis, exclude=True)
   
   ```
   Since its obscure, do we still need to add it?
   
   ```python
   
   class QuantileLoss(Loss):
   """Calculates Koenker's quantile regression loss function yielding 

[GitHub] piiswrong closed pull request #8149: Add gluon losses

2017-10-05 Thread git
piiswrong closed pull request #8149: Add gluon losses
URL: https://github.com/apache/incubator-mxnet/pull/8149
 
 
   
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on issue #8158: Clarify behavior of shared executor memory sharing when using Bind

2017-10-05 Thread git
eric-haibin-lin commented on issue #8158: Clarify behavior of shared executor 
memory sharing when using Bind
URL: 
https://github.com/apache/incubator-mxnet/issues/8158#issuecomment-334583775
 
 
   If `shared_exec` doesn't have enough scratches new ones will be created and 
attach to it.
   @reminisce shall we add more description here? 
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on issue #8158: Clarify behavior of shared executor memory sharing when using Bind

2017-10-05 Thread git
eric-haibin-lin commented on issue #8158: Clarify behavior of shared executor 
memory sharing when using Bind
URL: 
https://github.com/apache/incubator-mxnet/issues/8158#issuecomment-334583775
 
 
   I believe if `shared_exec` doesn't have enough scratches new ones will be 
created and attach to it.
   @reminisce shall we add more description here? 
 

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


With regards,
Apache Git Services


[GitHub] mli commented on issue #8152: memory save

2017-10-05 Thread git
mli commented on issue #8152: memory save
URL: https://github.com/apache/incubator-mxnet/pull/8152#issuecomment-334579301
 
 
   Agree that using tuple and iterator can reduce the memory. But Eric's point 
is valid, this PR puts too many things in a single expression (i.e. `cargs = 
...`), which makes the codes harder to read. 
   
   maybe we can write a generator for cargs, which can further reduce memory, 
and break single line into multiple lines to improve readability. 
   
   also, is there any benchmark showing that this kinds of modification can 
improve things in a notiable way?
 

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


With regards,
Apache Git Services


[GitHub] sebouh commented on a change in pull request #8110: Menu structure changes

2017-10-05 Thread git
sebouh commented on a change in pull request #8110: Menu structure changes
URL: https://github.com/apache/incubator-mxnet/pull/8110#discussion_r143042555
 
 

 ##
 File path: docs/_static/mxnet-theme/navbar.html
 ##
 @@ -10,8 +10,9 @@ 
 
   Community 
   
-Community
-Collaborator
+Mailing List & Resources
 
 Review comment:
   Let's keep it "Community" then. So the title of the menu list will be 
Community, and the three items in the dropdown will be Community, Contribute, 
Powered By. Does that work? 
 

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


With regards,
Apache Git Services


[GitHub] ykim362 commented on issue #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
ykim362 commented on issue #7931: MKL-DNN integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#issuecomment-334575075
 
 
   @eric-haibin-lin We are adding CI test same as MKLML.
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on issue #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on issue #7931: MKL-DNN integration: request for 
reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#issuecomment-334570990
 
 
   How is this PR tested right now?
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143006998
 
 

 ##
 File path: MKL_README.md
 ##
 @@ -40,4 +62,25 @@ This README shows the user how to setup and install MKL2017 
library with mxnet.
   
   4. Run 'sudo python setup.py install'
 
+## Build/Install MXNet with MKL-DNN:
 
 Review comment:
   nit: 
   ```
1.4 MKL version compatibility
1.3.2.1
   ```
   should be 
   ```
1.4 MKL version compatibility
1.4.1
   ```
   
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7935: Zeroes CSR still needs a valid row_pointer array.

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7935: Zeroes CSR still 
needs a valid row_pointer array.
URL: https://github.com/apache/incubator-mxnet/pull/7935#discussion_r143035566
 
 

 ##
 File path: src/operator/tensor/elemwise_binary_op-inl.h
 ##
 @@ -245,16 +245,24 @@ void ElemwiseBinaryOp::CsrCsrOp(mshadow::Stream *s,
   if (!nr_rows) {
 return;
   }
+  CHECK_EQ(lhs.aux_shape(csr::kIndPtr).Size(), nr_rows + 1);
   const size_t nr_cols = lhs.shape().Size() / nr_rows;
 
   CHECK_EQ(lhs.shape().Size(), rhs.shape().Size());
 
+  const bool same_lhs_rhs = IsSameArray(lhs, output);
+
   const size_t lhs_nnz = lhs.storage_shape().Size();
   const size_t rhs_nnz = rhs.storage_shape().Size();
 
+  const size_t max_nnz = same_lhs_rhs ? lhs_nnz : lhs_nnz + rhs_nnz;
+
   output.CheckAndAlloc({mshadow::Shape1(lhs.shape()[0] + 1),
-mshadow::Shape1(std::min(lhs_nnz + rhs_nnz, 
lhs.shape().Size()))});
-  DCHECK_EQ(output.aux_shape(csr::kIndPtr), lhs.aux_shape(csr::kIndPtr));
+mshadow::Shape1(std::min(max_nnz, 
lhs.shape().Size()))});
+
+  // Input and output should have the same number of row pointer items (m + 1)
+  CHECK_EQ(output.aux_shape(csr::kIndPtr), lhs.aux_shape(csr::kIndPtr));
+  CHECK_EQ(output.aux_shape(csr::kIndPtr), rhs.aux_shape(csr::kIndPtr));
 
 Review comment:
   what is?
 

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


With regards,
Apache Git Services


[GitHub] cjolivier01 commented on a change in pull request #7935: Zeroes CSR still needs a valid row_pointer array.

2017-10-05 Thread git
cjolivier01 commented on a change in pull request #7935: Zeroes CSR still needs 
a valid row_pointer array.
URL: https://github.com/apache/incubator-mxnet/pull/7935#discussion_r143035060
 
 

 ##
 File path: src/operator/tensor/elemwise_binary_op-inl.h
 ##
 @@ -245,16 +245,24 @@ void ElemwiseBinaryOp::CsrCsrOp(mshadow::Stream *s,
   if (!nr_rows) {
 return;
   }
+  CHECK_EQ(lhs.aux_shape(csr::kIndPtr).Size(), nr_rows + 1);
   const size_t nr_cols = lhs.shape().Size() / nr_rows;
 
   CHECK_EQ(lhs.shape().Size(), rhs.shape().Size());
 
+  const bool same_lhs_rhs = IsSameArray(lhs, output);
+
   const size_t lhs_nnz = lhs.storage_shape().Size();
   const size_t rhs_nnz = rhs.storage_shape().Size();
 
+  const size_t max_nnz = same_lhs_rhs ? lhs_nnz : lhs_nnz + rhs_nnz;
+
   output.CheckAndAlloc({mshadow::Shape1(lhs.shape()[0] + 1),
-mshadow::Shape1(std::min(lhs_nnz + rhs_nnz, 
lhs.shape().Size()))});
-  DCHECK_EQ(output.aux_shape(csr::kIndPtr), lhs.aux_shape(csr::kIndPtr));
+mshadow::Shape1(std::min(max_nnz, 
lhs.shape().Size()))});
+
+  // Input and output should have the same number of row pointer items (m + 1)
+  CHECK_EQ(output.aux_shape(csr::kIndPtr), lhs.aux_shape(csr::kIndPtr));
+  CHECK_EQ(output.aux_shape(csr::kIndPtr), rhs.aux_shape(csr::kIndPtr));
 
 Review comment:
   This is incredibly messy, IMHO
 

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


With regards,
Apache Git Services


[GitHub] daranday commented on issue #4543: Can't use multi-core CPU correctly!

2017-10-05 Thread git
daranday commented on issue #4543: Can't use multi-core CPU correctly!
URL: 
https://github.com/apache/incubator-mxnet/issues/4543#issuecomment-334560152
 
 
   I'm still experiencing the same issue
   
 

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


With regards,
Apache Git Services


[GitHub] cjolivier01 commented on a change in pull request #7935: Zeroes CSR still needs a valid row_pointer array.

2017-10-05 Thread git
cjolivier01 commented on a change in pull request #7935: Zeroes CSR still needs 
a valid row_pointer array.
URL: https://github.com/apache/incubator-mxnet/pull/7935#discussion_r143027598
 
 

 ##
 File path: src/operator/tensor/elemwise_binary_op-inl.h
 ##
 @@ -245,16 +245,24 @@ void ElemwiseBinaryOp::CsrCsrOp(mshadow::Stream *s,
   if (!nr_rows) {
 return;
   }
+  CHECK_EQ(lhs.aux_shape(csr::kIndPtr).Size(), nr_rows + 1);
   const size_t nr_cols = lhs.shape().Size() / nr_rows;
 
   CHECK_EQ(lhs.shape().Size(), rhs.shape().Size());
 
+  const bool same_lhs_rhs = IsSameArray(lhs, output);
+
   const size_t lhs_nnz = lhs.storage_shape().Size();
   const size_t rhs_nnz = rhs.storage_shape().Size();
 
+  const size_t max_nnz = same_lhs_rhs ? lhs_nnz : lhs_nnz + rhs_nnz;
+
   output.CheckAndAlloc({mshadow::Shape1(lhs.shape()[0] + 1),
-mshadow::Shape1(std::min(lhs_nnz + rhs_nnz, 
lhs.shape().Size()))});
-  DCHECK_EQ(output.aux_shape(csr::kIndPtr), lhs.aux_shape(csr::kIndPtr));
+mshadow::Shape1(std::min(max_nnz, 
lhs.shape().Size()))});
+
+  // Input and output should have the same number of row pointer items (m + 1)
+  CHECK_EQ(output.aux_shape(csr::kIndPtr), lhs.aux_shape(csr::kIndPtr));
+  CHECK_EQ(output.aux_shape(csr::kIndPtr), rhs.aux_shape(csr::kIndPtr));
 
 Review comment:
   ic
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143006998
 
 

 ##
 File path: MKL_README.md
 ##
 @@ -40,4 +62,25 @@ This README shows the user how to setup and install MKL2017 
library with mxnet.
   
   4. Run 'sudo python setup.py install'
 
+## Build/Install MXNet with MKL-DNN:
 
 Review comment:
   nit: 
   ```
1.4 MKL version compatibility
1.3.2.1
   ```
   should be 
   ```
1.4 MKL version compatibility
1.4.1
   ```
   ?
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143022821
 
 

 ##
 File path: src/operator/mkl/mkldnn_concat-inl.h
 ##
 @@ -0,0 +1,326 @@
+/***
+* Copyright 2016-2017 Intel Corporation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* \file mkldnn_concat-inl.h
+* \brief
+* \author young.jin@intel.com
+* ashok.em...@intel.com
+* deepthi.kark...@intel.com
+* louis.f...@intel.com
+* adam.d.st...@intel.com
+*
+***/
+#ifndef MXNET_OPERATOR_MKL_MKLDNN_CONCAT_INL_H_
+#define MXNET_OPERATOR_MKL_MKLDNN_CONCAT_INL_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "../operator_common.h"
+#include "./mkl_util-inl.h"
+
+namespace mxnet {
+namespace op {
+
+template
 
 Review comment:
   This file doesn't have any documentation/comments. Please add them for 
better maintainability
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143020112
 
 

 ##
 File path: src/operator/mkl/mkl_memory.h
 ##
 @@ -46,7 +46,7 @@ struct PrvMemDescr {
   virtual PrvDescrType get_descr_type() = 0;
 };
 
-#if MKL_EXPERIMENTAL == 1
+#if MKL_EXPERIMENTAL == 1 || MXNET_USE_MKLDNN == 1
 
 Review comment:
   what does `Prv` stand for?
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143011980
 
 

 ##
 File path: src/executor/attach_op_execs_pass.cc
 ##
 @@ -196,7 +201,7 @@ class FComputeExecutor : public StorageFallbackOpExecutor {
 PreFCompute(is_gpu);
 fcompute_(attrs_, op_ctx, in_data_, req, out_data_);
 PostFCompute(is_gpu);
-#if MKL_EXPERIMENTAL == 1
+#if MKL_EXPERIMENTAL == 1 || MXNET_USE_MKLDNN == 1
 mkl_tblobs_prv_to_cpu(in_data_);
 
 Review comment:
   Why `in_data_` is updated? Does it assume input is mutable?
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143021450
 
 

 ##
 File path: src/operator/mkl/mkldnn_base-inl.h
 ##
 @@ -0,0 +1,164 @@
+/***
+* Copyright 2016-2017 Intel Corporation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* \file mkldnn_base-inl.h
+* \brief
+* \author young.jin@intel.com
+* ashok.em...@intel.com
+* deepthi.kark...@intel.com
+* louis.f...@intel.com
+* adam.d.st...@intel.com
+*
+***/
+
+#ifndef MXNET_OPERATOR_MKL_MKLDNN_BASE_INL_H_
+#define MXNET_OPERATOR_MKL_MKLDNN_BASE_INL_H_
+
+#if MXNET_USE_MKLDNN == 1
+#include 
+#include 
+#include 
+#include "mkldnn.hpp"
+
+namespace mxnet {
+extern bool enableMKLDNNWarnGenerated();
+// =  CpuEngine ===
+// cpu_engine singleton
+class CpuEngine {
+ public:
+static CpuEngine & Instance() {
+// I's thread-safe in C++11.
 
 Review comment:
   typo?
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143014031
 
 

 ##
 File path: src/operator/batch_norm.cc
 ##
 @@ -334,6 +339,30 @@ Operator *CreateOp(BatchNormParam param, const int 
dtype, const TShape& sha
 }
   }
 #endif
+#if MXNET_USE_MKLDNN == 1
+  if (shape.ndim() == 4
+  && param.axis == mxnet::op::batchnorm::DEFAULT_AXIS
+  && shape[param.axis] % 8 == 0
+  && !mxnet::op::batchnorm::disable_mkl) {
+switch (dtype) {
+  case mshadow::kFloat32:
+op = new MKLDNNBatchNormOp(param);
+break;
+  default:
+// MKL operator doesn't support half_t, so fall through
+break;
+}
+  }
+#define BATCHNORM_LOG_MKL_INFO() \
+  do { \
 
 Review comment:
   why does this need a while loop?
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143014689
 
 

 ##
 File path: src/operator/mkl/mkldnn_base.cc
 ##
 @@ -0,0 +1,74 @@
+/***
+* Copyright 2016-2017 Intel Corporation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* \file mkldnn_base.cc
+* \brief
+* \author young.jin@intel.com
+* ashok.em...@intel.com
+* deepthi.kark...@intel.com
+* louis.f...@intel.com
+* adam.d.st...@intel.com
+*
+***/
+
+#include 
+#ifdef MXNET_USE_MKLDNN
+#include "mkldnn_base-inl.h"
+using namespace mkldnn;
+namespace mxnet {
+
+bool enableMKLDNNWarnGenerated() {
 
 Review comment:
   This doesn't follow the naming convention for functions
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143021884
 
 

 ##
 File path: src/operator/mkl/mkldnn_batch_norm-inl.h
 ##
 @@ -0,0 +1,414 @@
+/***
+* Copyright 2016-2017 Intel Corporation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* \file mkldnn_batch_norm-inl.h
+* \brief
+* \author young.jin@intel.com
+* ashok.em...@intel.com
+* deepthi.kark...@intel.com
+* louis.f...@intel.com
+* adam.d.st...@intel.com
+*
+***/
+#ifndef MXNET_OPERATOR_MKL_MKLDNN_BATCH_NORM_INL_H_
+#define MXNET_OPERATOR_MKL_MKLDNN_BATCH_NORM_INL_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "mkldnn_base-inl.h"
+#include "mkl_util-inl.h"
+
+namespace mxnet {
+namespace op {
+
+
+template
+class MKLDNNBatchNormOp : public Operator, public MKLDNNLayer {
+ public:
+  static int s_id_gen;
 
 Review comment:
   what is `s_id_gen` used for? Add brief comment?
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143020353
 
 

 ##
 File path: src/operator/mkl/mkl_memory.h
 ##
 @@ -64,12 +64,16 @@ struct MKLMemHolder {
 b_eager_mode = eager_mode;
 
 Review comment:
   what is `eager_mode ` used for? Is there any document for this?
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143019906
 
 

 ##
 File path: src/operator/mkl/mkl_memory.h
 ##
 @@ -64,12 +64,16 @@ struct MKLMemHolder {
 b_eager_mode = eager_mode;
   }
   void set_prv_descriptor(std::shared_ptr descriptor, bool 
same_data = false) {
-head_ = HEAD_AT_PRV;
+if (descriptor != nullptr)
 
 Review comment:
   `if (descriptor != nullptr)  head_ = HEAD_AT_PRV;` 
   or 
   ```
   if (descriptor != nullptr) {
 head_ = HEAD_AT_PRV;
   }
   
   ```
   
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143025769
 
 

 ##
 File path: src/operator/mkl/mkldnn_memory.cc
 ##
 @@ -0,0 +1,285 @@
+/***
+* Copyright 2016-2017 Intel Corporation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* \file mkldnn_memory.cc
+* \brief
+* \author young.jin@intel.com
+* ashok.em...@intel.com
+* deepthi.kark...@intel.com
+* louis.f...@intel.com
+* adam.d.st...@intel.com
+*
+***/
+
+
+#include 
+#if MXNET_USE_MKLDNN == 1
+#include 
+#include "mkldnn_memory-inl.h"
+
+namespace mxnet {
+
+template 
+MKLDNNMemoryDescriptorBase::MKLDNNMemoryDescriptorBase(
+std::shared_ptr usr_memory_pd
+, std::shared_ptr prv_memory_pd)
+: name("MKLDNNMemoryDescriptorBase"),
+_prv_memory(NULL), _internal_ptr(NULL), 
_internal_size(0),
+_usr_memory(NULL), _dbg_cpu_ptr(NULL) {
+_usr_memory_pd_not_null = false;
+_prv_memory_pd_not_null = false;
+set_usr_memory_pd(usr_memory_pd);
+set_prv_memory_pd(prv_memory_pd);
+}
+
+template 
+void MKLDNNMemoryDescriptorBase::check_usr_with_prv_descriptors() {
+CHECK(_usr_memory_pd);
+CHECK(_prv_memory_pd);
+int32_t ndims = _usr_memory_pd->desc().data.ndims;
+CHECK_EQ(ndims, _prv_memory_pd->desc().data.ndims)
+<< "MKLDNNMemoryDescriptorBase: Usr and Prv memory must have same 
dimensions number";
+for (int32_t dim = 0; dim < ndims; ++dim) {
+CHECK_EQ(_usr_memory_pd->desc().data.dims[dim]
+, _prv_memory_pd->desc().data.dims[dim])
+<< "MKLDNNMemoryDescriptorBase: Usr and Prv memory must have 
same dimensions";
+}
+}
+
+
+
+
 
 Review comment:
   Does this pass lint?
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143021998
 
 

 ##
 File path: src/operator/mkl/mkldnn_batch_norm-inl.h
 ##
 @@ -0,0 +1,414 @@
+/***
+* Copyright 2016-2017 Intel Corporation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* \file mkldnn_batch_norm-inl.h
+* \brief
+* \author young.jin@intel.com
+* ashok.em...@intel.com
+* deepthi.kark...@intel.com
+* louis.f...@intel.com
+* adam.d.st...@intel.com
+*
+***/
+#ifndef MXNET_OPERATOR_MKL_MKLDNN_BATCH_NORM_INL_H_
+#define MXNET_OPERATOR_MKL_MKLDNN_BATCH_NORM_INL_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "mkldnn_base-inl.h"
+#include "mkl_util-inl.h"
+
+namespace mxnet {
+namespace op {
+
+
+template
+class MKLDNNBatchNormOp : public Operator, public MKLDNNLayer {
+ public:
+  static int s_id_gen;
+  int m_id;
+  explicit MKLDNNBatchNormOp(BatchNormParam param) : MKLDNNLayer()
+, fwd_top_data(NULL), fwd_bottom_data(NULL)
+, fwd_inference_pd(NULL), fwd_training_pd(NULL)
+, bwd_top_diff(NULL), bwd_bottom_diff(NULL), bwd_scaleshift_pd(NULL) {
+this->param_ = param;
+m_id = s_id_gen++;
+  }
+  virtual ~MKLDNNBatchNormOp() {
+  }
+  static std::string getName() {
+std::string name = "MKLDNNBatchNormOp_";
+// name = name + std::to_string(m_id);
+return name;
+  }
+  // static std::string getName() {
 
 Review comment:
   Please move unused code
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143023281
 
 

 ##
 File path: src/operator/mkl/mkldnn_convolution-inl.h
 ##
 @@ -0,0 +1,491 @@
+/***
+* Copyright 2016-2017 Intel Corporation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* \file mkldnn_convolution-inl.h
+* \brief
+* \author young.jin@intel.com
+* ashok.em...@intel.com
+* deepthi.kark...@intel.com
+* louis.f...@intel.com
+* adam.d.st...@intel.com
+*
+***/
+#ifndef MXNET_OPERATOR_MKL_MKLDNN_CONVOLUTION_INL_H_
+#define MXNET_OPERATOR_MKL_MKLDNN_CONVOLUTION_INL_H_
+#include 
+#include 
+#include 
+#include "mkl_conv-common-inl.h"
+#include "mkldnn_base-inl.h"
+
+namespace mxnet {
+namespace op {
+
+template
+class MKLDNNConvolutionOp : public Operator, public MKLDNNLayer,
+  public MKLConvCommon {
+ public:
+  std::string getName() {
+std::string name = "MKLDNNConvolutionOp";
+return name;
+  }
+  explicit MKLDNNConvolutionOp(ConvolutionParam p)
+: MKLDNNLayer()
+, fwd_bottom_data(NULL), fwd_top_data(NULL), fwd_weights_data(NULL), 
fwd_bias_data(NULL)
+, convFwd_pd(NULL)
+, convBwdData_pd(NULL), convBwdWeights_pd(NULL) {
+this->param_ = p;
+param_.workspace = (param_.workspace << 20) / sizeof(DType);
+b_init_conv = false;
+  }
+
+  virtual ~MKLDNNConvolutionOp() {
+  }
+  void init_properties(const mshadow::Tensor &data,
+const mshadow::Tensor &out) {
+this->stride_w_ = param_.stride[1];
+this->stride_h_ = param_.stride[0];
+this->width_ = data.shape_[3];
+this->height_ = data.shape_[2];
+this->pad_w_ = param_.pad[1];
+this->pad_h_ = param_.pad[0];
+this->kernel_w_ = param_.kernel[1];
+this->kernel_h_ = param_.kernel[0];
+this->channels_ = data.shape_[1];
+this->num_ = data.shape_[0];
+this->group_ = param_.num_group;
+this->width_out_ = out.shape_[3];
+this->height_out_ = out.shape_[2];
+this->channel_output_ = out.shape_[1];
+  }
+ private:
+  void InitForward(const OpContext &ctx) {
+  // if (std::is_same::value)   NOT_IMPLEMENTED;
 
 Review comment:
   Is this implemented now?
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143025448
 
 

 ##
 File path: src/operator/mkl/mkldnn_memory-inl.h
 ##
 @@ -0,0 +1,206 @@
+/***
+* Copyright 2016-2017 Intel Corporation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* \file mkldnn_memory-inl.h
+* \brief
+* \author young.jin@intel.com
+* ashok.em...@intel.com
+* deepthi.kark...@intel.com
+* louis.f...@intel.com
+* adam.d.st...@intel.com
+*
+***/
+
+#ifndef MXNET_OPERATOR_MKL_MKLDNN_MEMORY_INL_H_
+#define MXNET_OPERATOR_MKL_MKLDNN_MEMORY_INL_H_
+
+#include 
+#include 
+#include 
+#if MXNET_USE_MKLDNN == 1
+#include "mkldnn.hpp"
+#include "mkldnn_base-inl.h"
+#define CHECK_MKL_BUFFER 0
+#if CHECK_MKL_BUFFER == 1
+#include "../../operator_common.h"
+#include "../../mshadow_op.h"
+#endif
+using namespace mkldnn;
+
+namespace mxnet {
+
+template 
+struct MKLDNNMemoryDescriptorBase : public PrvMemDescr,
+ public std::enable_shared_from_this > {
+MKLDNNMemoryDescriptorBase(std::shared_ptr 
usr_memory_pd
+, std::shared_ptr prv_memory_pd);
+
+~MKLDNNMemoryDescriptorBase() {
+}
+std::shared_ptr > get_shared_ptr() {
+  return this->shared_from_this();
+}
+//  PrvMemDescr virtual functions -
+void allocate() {
+  if (_prv_memory == nullptr) {
+_prv_memory = std::shared_ptr(new memory(*_prv_memory_pd));
+_internal_ptr = reinterpret_cast(_prv_memory->get_data_handle());
+_internal_size = prv_size();
+  }
+}
+std::shared_ptr  get_prv_memory(bool usage_check = false) {
+  if (_prv_memory == nullptr) {
+if (usage_check)
+  CHECK_EQ(usage_check, true) << "get null prv memory from";
+allocate();
+  }
+  return _prv_memory;
+}
+inline bool conversion_needed() const {
+  if (!_prv_memory_pd_not_null)
+return false;
+  if (!_usr_memory_pd_not_null)
+return false;
+  if (*_usr_memory_pd != *_prv_memory_pd)
+return true;
+  else
+return false;
+}
+
+void set_prv_memory_pd(std::shared_ptr memory_pd) {
+  _prv_memory_pd = memory_pd;
+  if (_prv_memory_pd)
+_prv_memory_pd_not_null = true;
+}
+
+void set_usr_memory_pd(std::shared_ptr memory_pd) {
+  _usr_memory_pd = memory_pd;
+  if (_usr_memory_pd)
+_usr_memory_pd_not_null = true;
+}
+
+virtual void* prv_ptr(bool allocate_when_uninit = true) {
+  return _internal_ptr;
+}
+virtual size_t prv_size() { return _prv_memory_pd->get_size(); }
+virtual size_t prv_count() { return prv_size() / sizeof(Dtype); }
+
+virtual bool layout_compare(std::shared_ptr other);
+virtual PrvDescrType get_descr_type() { return PRV_DESCR_MKLDNN; }
+
+std::shared_ptr  prv_memory_pd() const {
+return _prv_memory_pd;
+}
+std::shared_ptr  usr_memory_pd() const {
+return _usr_memory_pd;
+}
+
+std::string name;  // for debugging purposes
+
+void check_usr_with_prv_descriptors();
+void set_prv_memory(std::shared_ptr memory) {
+_prv_memory = memory;
+if (_prv_memory == nullptr) {
+  _internal_ptr = reinterpret_cast(_prv_memory->get_data_handle());
+  _internal_size = prv_size();
+} else {
+  VLOG(1) << "Set NULL Prv Memory";
 
 Review comment:
   When will this log be printed
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7931: MKL-DNN integration: request for reviews

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7931: MKL-DNN 
integration: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7931#discussion_r143009205
 
 

 ##
 File path: include/mxnet/ndarray.h
 ##
 @@ -512,7 +512,7 @@ class NDArray {
 CHECK_GE(shape_.Size() * mshadow::mshadow_sizeof(dtype_),
  shape.Size() * mshadow::mshadow_sizeof(dtype))
 << "NDArray.AsArray: target memory size is bigger";
-#if MKL_EXPERIMENTAL == 1
+#if MKL_EXPERIMENTAL == 1 || MXNET_USE_MKLDNN == 1
 if (Mkl_mem_ != nullptr) {
   // convert prv to cpu
   Mkl_mem_->check_and_prv_to_cpu(ptr_->shandle.dptr);
 
 Review comment:
   I have a general question, when will mkl mem be converted to cpu? 
 

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


With regards,
Apache Git Services


[GitHub] piiswrong commented on issue #8152: memory save

2017-10-05 Thread git
piiswrong commented on issue #8152: memory save
URL: https://github.com/apache/incubator-mxnet/pull/8152#issuecomment-334551519
 
 
   What's the benefit of this change? This part is complicated and hard to 
debug, so unless there is visible performance impact I think there is no reason 
to change it
 

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


With regards,
Apache Git Services


[GitHub] szha commented on a change in pull request #7772: Use memcopy instead of assigning each individual element

2017-10-05 Thread git
szha commented on a change in pull request #7772: Use memcopy instead of 
assigning each individual element
URL: https://github.com/apache/incubator-mxnet/pull/7772#discussion_r143018583
 
 

 ##
 File path: include/mxnet/base.h
 ##
 @@ -50,6 +50,15 @@
 #endif
 
 /*!
+ *\brief whether to use __builtin_memcpy or not
+ */
+#ifdef MXNET_USE_BUILTIN_MEMCPY
+#define MXNET_MEMCPY __builtin_memcpy
+#else
+#define MXNET_MEMCPY memcpy
+#endif
 
 Review comment:
   Yes, otherwise there's no abstraction of the function signature, which can 
potentially vary.
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7772: Use memcopy instead of assigning each individual element

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #7772: Use memcopy 
instead of assigning each individual element
URL: https://github.com/apache/incubator-mxnet/pull/7772#discussion_r143017355
 
 

 ##
 File path: include/mxnet/base.h
 ##
 @@ -50,6 +50,15 @@
 #endif
 
 /*!
+ *\brief whether to use __builtin_memcpy or not
+ */
+#ifdef MXNET_USE_BUILTIN_MEMCPY
+#define MXNET_MEMCPY __builtin_memcpy
+#else
+#define MXNET_MEMCPY memcpy
+#endif
 
 Review comment:
   Is that necessary? 
 

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


With regards,
Apache Git Services


[GitHub] anirudh2290 commented on a change in pull request #8154: Add infer storage type function for sparse slice operator

2017-10-05 Thread git
anirudh2290 commented on a change in pull request #8154: Add infer storage type 
function for sparse slice operator
URL: https://github.com/apache/incubator-mxnet/pull/8154#discussion_r143013774
 
 

 ##
 File path: src/operator/tensor/matrix_op-inl.h
 ##
 @@ -424,6 +424,41 @@ inline bool SliceShape(const nnvm::NodeAttrs& attrs,
   return true;
 }
 
+inline bool SliceForwardInferStorageType(const nnvm::NodeAttrs& attrs,
+   const int dev_mask,
 
 Review comment:
   Done!
 

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


With regards,
Apache Git Services


[GitHub] anirudh2290 commented on a change in pull request #8154: Add infer storage type function for sparse slice operator

2017-10-05 Thread git
anirudh2290 commented on a change in pull request #8154: Add infer storage type 
function for sparse slice operator
URL: https://github.com/apache/incubator-mxnet/pull/8154#discussion_r143013820
 
 

 ##
 File path: tests/python/unittest/test_sparse_ndarray.py
 ##
 @@ -113,9 +113,20 @@ def check_sparse_nd_csr_slice(shape):
 assert same(A[start:end].asnumpy(), A2[start:end])
 assert same(A[start:].asnumpy(), A2[start:])
 assert same(A[:end].asnumpy(), A2[:end])
+
+def check_slice_nd_csr_fallback(shape):
 
 Review comment:
   Added.
 

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


With regards,
Apache Git Services


[GitHub] anirudh2290 commented on a change in pull request #8154: Add infer storage type function for sparse slice operator

2017-10-05 Thread git
anirudh2290 commented on a change in pull request #8154: Add infer storage type 
function for sparse slice operator
URL: https://github.com/apache/incubator-mxnet/pull/8154#discussion_r143013806
 
 

 ##
 File path: src/operator/tensor/matrix_op-inl.h
 ##
 @@ -424,6 +424,41 @@ inline bool SliceShape(const nnvm::NodeAttrs& attrs,
   return true;
 }
 
+inline bool SliceForwardInferStorageType(const nnvm::NodeAttrs& attrs,
+   const int dev_mask,
+   DispatchMode* dispatch_mode,
+   std::vector* in_attrs,
+   std::vector* out_attrs) {
+  CHECK_EQ(in_attrs->size(), 1);
+  CHECK_EQ(out_attrs->size(), 1);
+  const SliceParam& param = nnvm::get(attrs.parsed);
+  auto& in_stype = in_attrs->at(0);
 
 Review comment:
   Done.
 

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


With regards,
Apache Git Services


[GitHub] zhreshold commented on issue #8139: mxnet ssd training speed slow down after some batches

2017-10-05 Thread git
zhreshold commented on issue #8139: mxnet ssd training speed slow down after 
some batches
URL: 
https://github.com/apache/incubator-mxnet/issues/8139#issuecomment-334546105
 
 
   I used to have similar problem on a ubuntu workstation with 4 gpus neck to 
neck. After using ec2 I haven't had any problem then. So I guess it's not 
something related to OS, but I don't have clue yet. 
 

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


With regards,
Apache Git Services


[GitHub] kevinthesun commented on a change in pull request #8063: Add export model

2017-10-05 Thread git
kevinthesun commented on a change in pull request #8063: Add export model
URL: https://github.com/apache/incubator-mxnet/pull/8063#discussion_r143013566
 
 

 ##
 File path: python/mxnet/module/module.py
 ##
 @@ -171,6 +174,77 @@ def save_checkpoint(self, prefix, epoch, 
save_optimizer_states=False):
 self.save_optimizer_states(state_name)
 logging.info('Saved optimizer state to \"%s\"', state_name)
 
+def export_serving(self, prefix, epoch, signature, 
save_optimizer_states=False,
+   use_synset=False):
+"""Export current progress to a zip file used by MXNet model serving.
+
+Parameters
+--
+prefix : str
+The file prefix to export to.
+epoch : int
+The current epoch number.
+signature : dict
+A dictionary containing model input and output information.
+Data names or data shapes of inputs and outputs can be 
automatically
+collected from module. User needs to specify inputs and outputs 
MIME
+type for http request. Currently only 'image/jpeg' and 
'application/json'
+are supported. All inputs should have the same type. This also 
applies for
+outputs.
+An example signature would be:
+signature = { "input_type": "image/jpeg", "output_type": 
"application/json" }
+save_optimizer_states : bool
+Whether to save optimizer states to continue training.
+use_synset : bool
+Whether to include synset file for classification model. The 
synset.txt should be
+in the same directory of training script.
+
+Examples
+
+>>> signature = { "input_type": "image/jpeg", "output_type": 
"application/json" }
+>>> model.export_serving(prefix='resnet-18', epoch=100, 
signature=signature)
+Exported model to "resnet-18.zip"
 
 Review comment:
   How about .export which hints user this is an exported file. .dlmodel is 
kind of general name for deep learning model.
 

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


With regards,
Apache Git Services


[GitHub] kevinthesun commented on a change in pull request #8063: Add export model

2017-10-05 Thread git
kevinthesun commented on a change in pull request #8063: Add export model
URL: https://github.com/apache/incubator-mxnet/pull/8063#discussion_r143013177
 
 

 ##
 File path: python/mxnet/module/module.py
 ##
 @@ -171,6 +174,77 @@ def save_checkpoint(self, prefix, epoch, 
save_optimizer_states=False):
 self.save_optimizer_states(state_name)
 logging.info('Saved optimizer state to \"%s\"', state_name)
 
+def export_serving(self, prefix, epoch, signature, 
save_optimizer_states=False,
+   use_synset=False):
+"""Export current progress to a zip file used by MXNet model serving.
+
+Parameters
+--
+prefix : str
+The file prefix to export to.
+epoch : int
+The current epoch number.
+signature : dict
+A dictionary containing model input and output information.
+Data names or data shapes of inputs and outputs can be 
automatically
+collected from module. User needs to specify inputs and outputs 
MIME
+type for http request. Currently only 'image/jpeg' and 
'application/json'
+are supported. All inputs should have the same type. This also 
applies for
+outputs.
+An example signature would be:
+signature = { "input_type": "image/jpeg", "output_type": 
"application/json" }
+save_optimizer_states : bool
+Whether to save optimizer states to continue training.
+use_synset : bool
 
 Review comment:
   This may be a good chance to refactor this interface. Class label is only 
for classification task, but this API is a general one for all DL models. For 
example, users may want to put vocabulary dictionary file into exported model 
as well. Sometimes they may put multiple files into exported model. My 
suggestion is we can change this argument to 'util_file', which is a list of 
files users want exported model to contain. In this way, users can use these 
files in MMS, though currently only classification label will be automatically 
loaded.
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on issue #5724: Question about sparsity regularization and IdentityAttachKLSparseReg

2017-10-05 Thread git
eric-haibin-lin commented on issue #5724: Question about sparsity 
regularization and IdentityAttachKLSparseReg
URL: 
https://github.com/apache/incubator-mxnet/issues/5724#issuecomment-334543286
 
 
   @GaiYu0  doesn't ReLU already encourages sparsity (as in, negatives are 
replaced by zeros)? 
   The identity_kl_sparse_reg is only for sigmoid activation. 
   
https://github.com/apache/incubator-mxnet/blob/master/src/operator/identity_attach_KL_sparse_reg-inl.h#L62
   
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on issue #5724: Question about sparsity regularization and IdentityAttachKLSparseReg

2017-10-05 Thread git
eric-haibin-lin commented on issue #5724: Question about sparsity 
regularization and IdentityAttachKLSparseReg
URL: 
https://github.com/apache/incubator-mxnet/issues/5724#issuecomment-334543286
 
 
   @GaiYu0  doesn't ReLU already encourages sparsity (as in, negatives are 
replaced by zeros)? 
   The identity_kl_sparse_reg is for sigmoid activation. 
   
https://github.com/apache/incubator-mxnet/blob/master/src/operator/identity_attach_KL_sparse_reg-inl.h#L62
   
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #8154: Add infer storage type function for sparse slice operator

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #8154: Add infer storage 
type function for sparse slice operator
URL: https://github.com/apache/incubator-mxnet/pull/8154#discussion_r142991459
 
 

 ##
 File path: src/operator/tensor/matrix_op-inl.h
 ##
 @@ -424,6 +424,41 @@ inline bool SliceShape(const nnvm::NodeAttrs& attrs,
   return true;
 }
 
+inline bool SliceForwardInferStorageType(const nnvm::NodeAttrs& attrs,
+   const int dev_mask,
+   DispatchMode* dispatch_mode,
+   std::vector* in_attrs,
+   std::vector* out_attrs) {
+  CHECK_EQ(in_attrs->size(), 1);
+  CHECK_EQ(out_attrs->size(), 1);
+  const SliceParam& param = nnvm::get(attrs.parsed);
+  auto& in_stype = in_attrs->at(0);
 
 Review comment:
   nit: const 
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #8154: Add infer storage type function for sparse slice operator

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #8154: Add infer storage 
type function for sparse slice operator
URL: https://github.com/apache/incubator-mxnet/pull/8154#discussion_r143001883
 
 

 ##
 File path: tests/python/unittest/test_sparse_ndarray.py
 ##
 @@ -113,9 +113,20 @@ def check_sparse_nd_csr_slice(shape):
 assert same(A[start:end].asnumpy(), A2[start:end])
 assert same(A[start:].asnumpy(), A2[start:])
 assert same(A[:end].asnumpy(), A2[:end])
+
+def check_slice_nd_csr_fallback(shape):
 
 Review comment:
   Could you also add
   `from test_sparse_ndarray import test_sparse_nd_slice ` to 
`tests/python/gpu/test_operator_gpu.py` to make sure it fallbacks on gpu 
correctly?
 

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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #8154: Add infer storage type function for sparse slice operator

2017-10-05 Thread git
eric-haibin-lin commented on a change in pull request #8154: Add infer storage 
type function for sparse slice operator
URL: https://github.com/apache/incubator-mxnet/pull/8154#discussion_r142991404
 
 

 ##
 File path: src/operator/tensor/matrix_op-inl.h
 ##
 @@ -424,6 +424,41 @@ inline bool SliceShape(const nnvm::NodeAttrs& attrs,
   return true;
 }
 
+inline bool SliceForwardInferStorageType(const nnvm::NodeAttrs& attrs,
+   const int dev_mask,
 
 Review comment:
   Please fix indentation
 

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


With regards,
Apache Git Services


[GitHub] szha commented on issue #7946: Defining Residual Convolution Structures in Block from gluon Module

2017-10-05 Thread git
szha commented on issue #7946: Defining Residual Convolution Structures in 
Block from gluon Module
URL: 
https://github.com/apache/incubator-mxnet/issues/7946#issuecomment-334527304
 
 
   There is an example of rcnn in the repo 
https://github.com/apache/incubator-mxnet/tree/master/example/rcnn
 

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


With regards,
Apache Git Services


[GitHub] szha commented on issue #8132: How to disable MXNET_CUDNN_AUTOTUNE_DEFAULT and bucketing log message without turning off MXNET_CUDNN_AUTOTUNE_DEFAULT?

2017-10-05 Thread git
szha commented on issue #8132: How to disable MXNET_CUDNN_AUTOTUNE_DEFAULT and 
bucketing log message without turning off MXNET_CUDNN_AUTOTUNE_DEFAULT?
URL: 
https://github.com/apache/incubator-mxnet/issues/8132#issuecomment-334523409
 
 
   Sorry for the confusion. What I meant was that once that PR is merged the 
problem should be resolved. Let's wait for that PR to get in first.
 

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


With regards,
Apache Git Services


[GitHub] zzningxp commented on issue #8077: Distributed training on shared distributed storage (Lustre)

2017-10-05 Thread git
zzningxp commented on issue #8077: Distributed training on shared distributed 
storage (Lustre)
URL: 
https://github.com/apache/incubator-mxnet/issues/8077#issuecomment-334515669
 
 
   I found that, in my environment, the submit node cannot run GPU scripts. So 
that the scheduler role from the PSTracker \_\_init__ should not be allocated 
on the same host of the submit node.
   I rewrite the tracker and run the training program now. 
   And I hope this maybe the reason...
   
   \--
   
   oops. 
   The accuracy is still about 0.1 after many batches.
 

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


With regards,
Apache Git Services


[GitHub] JeanKossaifi commented on issue #8084: Support for fancy indexing

2017-10-05 Thread git
JeanKossaifi commented on issue #8084: Support for fancy indexing
URL: 
https://github.com/apache/incubator-mxnet/issues/8084#issuecomment-334520125
 
 
   Given the importance of the feature and the current fix used (a warning 
message) this should maybe be classified as a bug?
 

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


With regards,
Apache Git Services


[GitHub] kevinthesun opened a new pull request #8063: Add export model

2017-10-05 Thread git
kevinthesun opened a new pull request #8063: Add export model
URL: https://github.com/apache/incubator-mxnet/pull/8063
 
 
   export_serving API for model serving.
 

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


With regards,
Apache Git Services


[GitHub] zzningxp commented on issue #8077: Distributed training on shared distributed storage (Lustre)

2017-10-05 Thread git
zzningxp commented on issue #8077: Distributed training on shared distributed 
storage (Lustre)
URL: 
https://github.com/apache/incubator-mxnet/issues/8077#issuecomment-334515669
 
 
   I found that, in my environment, the submit node cannot run GPU scripts. So 
that the scheduler role from the PSTracker \__init__ should not be allocated on 
the same host of the submit node.
   I rewrite the tracker and run the training program now. 
   And I hope this maybe the reason...
 

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


With regards,
Apache Git Services


[GitHub] zzningxp commented on issue #8077: Distributed training on shared distributed storage (Lustre)

2017-10-05 Thread git
zzningxp commented on issue #8077: Distributed training on shared distributed 
storage (Lustre)
URL: 
https://github.com/apache/incubator-mxnet/issues/8077#issuecomment-334515669
 
 
   I found that, in my environment, the submit node cannot run GPU scripts. So 
that the scheduler role from the PSTracker \_\_init__ should not be allocated 
on the same host of the submit node.
   I rewrite the tracker and run the training program now. 
   And I hope this maybe the reason...
 

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


With regards,
Apache Git Services


[GitHub] zzningxp commented on issue #8077: Distributed training on shared distributed storage (Lustre)

2017-10-05 Thread git
zzningxp commented on issue #8077: Distributed training on shared distributed 
storage (Lustre)
URL: 
https://github.com/apache/incubator-mxnet/issues/8077#issuecomment-334515669
 
 
   I found that, in my environment, the submit node cannot run GPU scripts. So 
that the scheduler role from the PSTracker __init__ should not be allocated on 
the same host of the submit node.
   I rewrite the tracker and run the training program now. 
   And I hope this maybe the reason...
 

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


With regards,
Apache Git Services


[GitHub] benqua commented on issue #8129: [scala] Module api: label (1,1,868,868) and prediction (1,868,868)should have the same length

2017-10-05 Thread git
benqua commented on issue #8129: [scala] Module api: label (1,1,868,868) and 
prediction (1,868,868)should have the same length
URL: 
https://github.com/apache/incubator-mxnet/issues/8129#issuecomment-334485858
 
 
   Yhea, you're right. Almost same error message with RMSE, but this time it is 
legit.
 

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


With regards,
Apache Git Services


[GitHub] larroy commented on issue #8151: Amalgamation for android arm64 was built successfully but failed to run in device

2017-10-05 Thread git
larroy commented on issue #8151: Amalgamation for android arm64 was built 
successfully but failed to run in device 
URL: 
https://github.com/apache/incubator-mxnet/issues/8151#issuecomment-334477873
 
 
   @zhenglaizhang can you share the code of the project?
 

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


With regards,
Apache Git Services


[GitHub] zhenglaizhang commented on issue #8151: Amalgamation for android arm64 was built successfully but failed to run in device

2017-10-05 Thread git
zhenglaizhang commented on issue #8151: Amalgamation for android arm64 was 
built successfully but failed to run in device 
URL: 
https://github.com/apache/incubator-mxnet/issues/8151#issuecomment-334476701
 
 
   @larroy thanks for quick response!
   
   just with following code at android side.
   ```
   static {
   System.loadLibrary("mxnet_predict");
   }
   ```
   Now as i checked, it's all because the generated `mxnet_predict-all.cc` 
really misses some method definitions, it compiles but fails at runtime, as I 
added the missed definitions, 3 to 4 missed definitions, I could load the 
mxnet_predict so on android device successfully.
   
   Agree with you, amalgamation might be out of dated, and cross platform 
builds should be better, I will take some time tomorrow to try your dockerfile 
android arm64 build, hope it will works.
   
   thanks for your helpful info -:)
 

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


With regards,
Apache Git Services


[GitHub] zhenglaizhang commented on issue #8151: Amalgamation for android arm64 was built successfully but failed to run in device

2017-10-05 Thread git
zhenglaizhang commented on issue #8151: Amalgamation for android arm64 was 
built successfully but failed to run in device 
URL: 
https://github.com/apache/incubator-mxnet/issues/8151#issuecomment-334476701
 
 
   @larroy thanks for quick response!
   
   just with following code at android side.
   ```
   static {
   System.loadLibrary("mxnet_predict");
   }
   ```
   Now as i checked, it's all because the generated `mxnet_predict-all.cc` 
really misses some method definitions, it compiles but fails at runtime, as I 
added the missed definitions several times, I could load the mxnet_predict so 
successfully.
   
   Agree with you, amalgamation might be out of dated, and cross platform 
builds should be better, I will take some time tomorrow to try your dockerfile 
android arm64 build, hope it will works.
   
   thanks for your helpful info -:)
 

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


With regards,
Apache Git Services


[GitHub] zhenglaizhang commented on issue #8151: Amalgamation for android arm64 was built successfully but failed to run in device

2017-10-05 Thread git
zhenglaizhang commented on issue #8151: Amalgamation for android arm64 was 
built successfully but failed to run in device 
URL: 
https://github.com/apache/incubator-mxnet/issues/8151#issuecomment-334476701
 
 
   just with following code at android side.
   ```
   static {
   System.loadLibrary("mxnet_predict");
   }
   ```
   Now as i checked, it's all because the generated `mxnet_predict-all.cc` 
really misses some method definitions, it compiles but fails at runtime, as I 
added the missed definitions several times, I could load the mxnet_predict so 
successfully.
   
   Agree with you, amalgamation might be out of dated, and cross platform 
builds should be better, I will take some time tomorrow to try your dockerfile 
android arm64 build, hope it will works.
   
   thanks for your helpful info -:)
 

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


With regards,
Apache Git Services


[GitHub] taliesinb opened a new issue #8158: Clarify behavior of shared executor memory sharing when using Bind

2017-10-05 Thread git
taliesinb opened a new issue #8158: Clarify behavior of shared executor memory 
sharing when using Bind
URL: https://github.com/apache/incubator-mxnet/issues/8158
 
 
   In the docs for MXExecutorBindEX in 
https://mxnet.incubator.apache.org/doxygen/c__api_8h.html, the parameter 
`shared_exec` is somewhat cryptically described as "input executor handle for 
memory sharing".
   
   I'm using `shared_exec` to do automated bucketing in Mathematica's deep 
learning framework, but what I'd like to know is what happens when I bind an 
executor that requires *more* memory than the memory used by the `shared_exec` 
that I passed in. 
   
   The reason I need to know that is the following scenario: when more than one 
sequence is involved in a net, it is impossible to predict which bucket will 
need the maximum temporary memory (ahead of time). Therefore it is impossible 
to automatically pick a 'master executor' which will require more scratch mem 
than all other executors.
   
   So here we really need to know what the semantics of `shared_exec` is! Can 
the `shared_exec` have *less* scratch than what is needed by the executor being 
bound? What happens in that case? Or do I need to pick a master executor and 
always pass it as the `shared_exec`? If that is the case, how can I know in 
advance whether my master executor needs to be retired in favor of another 
executor, if the only way to measure the scratch taken by an executor is after 
it is already created (and even then one has to parse a string to find the 
answer in megabytes, IIRC). 
   
   @sbodenstein 
 

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


With regards,
Apache Git Services


[GitHub] danielwaterworth commented on issue #3523: Operator documents issues tracking

2017-10-05 Thread git
danielwaterworth commented on issue #3523: Operator documents issues tracking
URL: 
https://github.com/apache/incubator-mxnet/issues/3523#issuecomment-334472600
 
 
   https://github.com/apache/incubator-mxnet/issues/7811
 

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


With regards,
Apache Git Services


  1   2   >