[GitHub] anirudhacharya commented on issue #9159: Symbol.bind() do not warn or error on dtype mismatch between Symbol and binding Data

2018-04-04 Thread GitBox
anirudhacharya commented on issue #9159: Symbol.bind() do not warn or error on 
dtype mismatch between Symbol and binding Data
URL: 
https://github.com/apache/incubator-mxnet/issues/9159#issuecomment-378822826
 
 
   @sandeep-krishnamurthy  This is a case of type promotion. Why is it an 
issue? In general in python, or in computer science, a warning or error is 
required only when there is a loss of information during a data type 
conversion. 
   
   If a float gets converted to an int then it is a matter of concern, but an 
int getting converted to a float should not be an issue, because there is no 
loss of information.
   
   For example, in the below code there is an implicit type promotion for the 
integer value ``a`` during the addition operation and we don't see any errors 
or warnings -
   ```python
   a = 1  # int value
   b = 1.5  # float value
   c = a + b
   print(type(c_sum))
   
   ```


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 #10416: mx.symbol.LeakyRelu could not be visualized

2018-04-04 Thread GitBox
reminisce commented on issue #10416: mx.symbol.LeakyRelu could not be 
visualized 
URL: 
https://github.com/apache/incubator-mxnet/issues/10416#issuecomment-378821909
 
 
   Probably because you didn't specify the params of LeakyReLU and all the 
params use the default values. In this case, there is no `attrs` json key in 
the symbol output format for this operator. It's a bug of `plot_network` not 
handling this situation well.
   
   We encourage you to try this [MXBoard](https://github.com/awslabs/mxboard) 
which is feature richer and handles this situation correctly.
   ```python
   import mxnet as mx
   from mxboard import SummaryWriter
   
   
   data = mx.sym.Variable('data')
   lr = mx.sym.LeakyReLU(data)
   with SummaryWriter(logdir='./logs') as sw:
   sw.add_graph(lr)
   ```
   
![image](https://user-images.githubusercontent.com/4978794/38348125-dbbba7f4-3854-11e8-9b3b-87728299305c.png)
   
   


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] indhub opened a new pull request #10418: [MXNET-150] Fix the build status icons in the root README

2018-04-04 Thread GitBox
indhub opened a new pull request #10418: [MXNET-150] Fix the build status icons 
in the root README
URL: https://github.com/apache/incubator-mxnet/pull/10418
 
 
   ## Description ##
   Fix the build status icons in the root README. These icons were not changed 
when we moved to the new CI and is now broken.
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [x] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to 
the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) 
created (except PRs with tiny changes)
   - [x] Changes are complete (i.e. I finished coding on this PR)
   


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] anirudhacharya commented on issue #8344: Broken link for "MXNet R Reference Manual"?

2018-04-04 Thread GitBox
anirudhacharya commented on issue #8344: Broken link for "MXNet R Reference 
Manual"?
URL: 
https://github.com/apache/incubator-mxnet/issues/8344#issuecomment-378819543
 
 
   @lanking520 fixed in this PR - 
https://github.com/apache/incubator-mxnet/pull/10408


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 opened a new pull request #10417: Error handling for non-positive reps of tile op

2018-04-04 Thread GitBox
reminisce opened a new pull request #10417: Error handling for non-positive 
reps of tile op
URL: https://github.com/apache/incubator-mxnet/pull/10417
 
 
   ## Description ##
   Address this issue.
   https://github.com/apache/incubator-mxnet/issues/10288
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to 
the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) 
created (except PRs with tiny changes)
   - [x] Changes are complete (i.e. I finished coding on this PR)
   - [x] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding 
a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a 
new build option with NCCL)
   - [x] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - Check the API doc at 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [x] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [ ] Feature1, tests, (and when applicable, API doc)
   - [ ] Feature2, tests, (and when applicable, API doc)
   
   ## Comments ##
   - If this change is a backward incompatible change, why must this change be 
made.
   - Interesting edge cases to note 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] reminisce commented on issue #10410: Fix output names of nn operators.

2018-04-04 Thread GitBox
reminisce commented on issue #10410: Fix output names of nn operators.
URL: https://github.com/apache/incubator-mxnet/pull/10410#issuecomment-378818873
 
 
   LGTM.
   @zheng-da Did these operators all use the legacy interface?


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] haojin2 commented on a change in pull request #10413: [MXNET-160] Fix for issue 9062

2018-04-04 Thread GitBox
haojin2 commented on a change in pull request #10413: [MXNET-160] Fix for issue 
9062
URL: https://github.com/apache/incubator-mxnet/pull/10413#discussion_r179348417
 
 

 ##
 File path: tests/python/unittest/test_random.py
 ##
 @@ -276,29 +276,34 @@ def test_parallel_random_seed_setting():
 
 @with_seed()
 def test_sample_multinomial():
-x = mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0
-dx = mx.nd.ones_like(x)
-mx.contrib.autograd.mark_variables([x], [dx])
-# Adding rtol and increasing samples needed to pass with seed 2951820647
-samples = 5000
-with mx.autograd.record():
-y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
-r = prob * 5
-r.backward()
-
-y = y.asnumpy()
-x = x.asnumpy()
-for i in range(x.shape[0]):
-
-freq = np.bincount(y[i], minlength=5)/np.float32(samples)*x[i].sum()
-mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
-rprob = x[i][y[i]]/x[i].sum()
-mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
-
-real_dx = np.zeros((5,))
-for j in range(samples):
-real_dx[y[i][j]] += 5.0 / rprob[j]
-mx.test_utils.assert_almost_equal(real_dx, dx.asnumpy()[i], rtol=1e-4)
+for x in [mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0, 
mx.nd.array([0,1,2,3,4])/10.0]:
+dx = mx.nd.ones_like(x)
+mx.contrib.autograd.mark_variables([x], [dx])
+# Adding rtol and increasing samples needed to pass with seed 
2951820647
+samples = 5000
+with mx.autograd.record():
+y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
+r = prob * 5
+r.backward()
+
+y = y.asnumpy()
+x = x.asnumpy()
+dx = dx.asnumpy()
+if len(x.shape) is 1:
+x = x.reshape((1, x.shape[0]))
+dx = dx.reshape(1, dx.shape[0])
+y = y.reshape((1, y.shape[0]))
+prob = prob.reshape((1, prob.shape[0]))
+for i in range(x.shape[0]):
+freq = np.bincount(y[i,:], 
minlength=5)/np.float32(samples)*x[i,:].sum()
+mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
+rprob = x[i][y[i]]/x[i].sum()
+mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
 
 Review comment:
   Okay, thanks!


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 a change in pull request #10413: [MXNET-160] Fix for issue 9062

2018-04-04 Thread GitBox
reminisce commented on a change in pull request #10413: [MXNET-160] Fix for 
issue 9062
URL: https://github.com/apache/incubator-mxnet/pull/10413#discussion_r179348312
 
 

 ##
 File path: tests/python/unittest/test_random.py
 ##
 @@ -276,29 +276,34 @@ def test_parallel_random_seed_setting():
 
 @with_seed()
 def test_sample_multinomial():
-x = mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0
-dx = mx.nd.ones_like(x)
-mx.contrib.autograd.mark_variables([x], [dx])
-# Adding rtol and increasing samples needed to pass with seed 2951820647
-samples = 5000
-with mx.autograd.record():
-y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
-r = prob * 5
-r.backward()
-
-y = y.asnumpy()
-x = x.asnumpy()
-for i in range(x.shape[0]):
-
-freq = np.bincount(y[i], minlength=5)/np.float32(samples)*x[i].sum()
-mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
-rprob = x[i][y[i]]/x[i].sum()
-mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
-
-real_dx = np.zeros((5,))
-for j in range(samples):
-real_dx[y[i][j]] += 5.0 / rprob[j]
-mx.test_utils.assert_almost_equal(real_dx, dx.asnumpy()[i], rtol=1e-4)
+for x in [mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0, 
mx.nd.array([0,1,2,3,4])/10.0]:
+dx = mx.nd.ones_like(x)
+mx.contrib.autograd.mark_variables([x], [dx])
+# Adding rtol and increasing samples needed to pass with seed 
2951820647
+samples = 5000
+with mx.autograd.record():
+y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
+r = prob * 5
+r.backward()
+
+y = y.asnumpy()
+x = x.asnumpy()
+dx = dx.asnumpy()
+if len(x.shape) is 1:
+x = x.reshape((1, x.shape[0]))
+dx = dx.reshape(1, dx.shape[0])
+y = y.reshape((1, y.shape[0]))
+prob = prob.reshape((1, prob.shape[0]))
+for i in range(x.shape[0]):
+freq = np.bincount(y[i,:], 
minlength=5)/np.float32(samples)*x[i,:].sum()
+mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
+rprob = x[i][y[i]]/x[i].sum()
+mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
 
 Review comment:
   Should provide `atol` to avoid failure when comparing two numbers that are 
close to zero.


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] haojin2 commented on a change in pull request #10413: [MXNET-160] Fix for issue 9062

2018-04-04 Thread GitBox
haojin2 commented on a change in pull request #10413: [MXNET-160] Fix for issue 
9062
URL: https://github.com/apache/incubator-mxnet/pull/10413#discussion_r179348200
 
 

 ##
 File path: tests/python/unittest/test_random.py
 ##
 @@ -276,29 +276,34 @@ def test_parallel_random_seed_setting():
 
 @with_seed()
 def test_sample_multinomial():
-x = mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0
-dx = mx.nd.ones_like(x)
-mx.contrib.autograd.mark_variables([x], [dx])
-# Adding rtol and increasing samples needed to pass with seed 2951820647
-samples = 5000
-with mx.autograd.record():
-y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
-r = prob * 5
-r.backward()
-
-y = y.asnumpy()
-x = x.asnumpy()
-for i in range(x.shape[0]):
-
-freq = np.bincount(y[i], minlength=5)/np.float32(samples)*x[i].sum()
-mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
-rprob = x[i][y[i]]/x[i].sum()
-mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
-
-real_dx = np.zeros((5,))
-for j in range(samples):
-real_dx[y[i][j]] += 5.0 / rprob[j]
-mx.test_utils.assert_almost_equal(real_dx, dx.asnumpy()[i], rtol=1e-4)
+for x in [mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0, 
mx.nd.array([0,1,2,3,4])/10.0]:
+dx = mx.nd.ones_like(x)
+mx.contrib.autograd.mark_variables([x], [dx])
+# Adding rtol and increasing samples needed to pass with seed 
2951820647
+samples = 5000
+with mx.autograd.record():
+y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
+r = prob * 5
+r.backward()
+
+y = y.asnumpy()
+x = x.asnumpy()
+dx = dx.asnumpy()
+if len(x.shape) is 1:
+x = x.reshape((1, x.shape[0]))
+dx = dx.reshape(1, dx.shape[0])
+y = y.reshape((1, y.shape[0]))
+prob = prob.reshape((1, prob.shape[0]))
+for i in range(x.shape[0]):
+freq = np.bincount(y[i,:], 
minlength=5)/np.float32(samples)*x[i,:].sum()
+mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
+rprob = x[i][y[i]]/x[i].sum()
+mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
 
 Review comment:
   The current test can always pass, I guess the default 1e-20 value should be 
okay?


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] haojin2 commented on a change in pull request #10413: [MXNET-160] Fix for issue 9062

2018-04-04 Thread GitBox
haojin2 commented on a change in pull request #10413: [MXNET-160] Fix for issue 
9062
URL: https://github.com/apache/incubator-mxnet/pull/10413#discussion_r179348107
 
 

 ##
 File path: tests/python/unittest/test_random.py
 ##
 @@ -276,29 +276,34 @@ def test_parallel_random_seed_setting():
 
 @with_seed()
 def test_sample_multinomial():
-x = mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0
-dx = mx.nd.ones_like(x)
-mx.contrib.autograd.mark_variables([x], [dx])
-# Adding rtol and increasing samples needed to pass with seed 2951820647
-samples = 5000
-with mx.autograd.record():
-y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
-r = prob * 5
-r.backward()
-
-y = y.asnumpy()
-x = x.asnumpy()
-for i in range(x.shape[0]):
-
-freq = np.bincount(y[i], minlength=5)/np.float32(samples)*x[i].sum()
-mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
-rprob = x[i][y[i]]/x[i].sum()
-mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
-
-real_dx = np.zeros((5,))
-for j in range(samples):
-real_dx[y[i][j]] += 5.0 / rprob[j]
-mx.test_utils.assert_almost_equal(real_dx, dx.asnumpy()[i], rtol=1e-4)
+for x in [mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0, 
mx.nd.array([0,1,2,3,4])/10.0]:
+dx = mx.nd.ones_like(x)
+mx.contrib.autograd.mark_variables([x], [dx])
+# Adding rtol and increasing samples needed to pass with seed 
2951820647
+samples = 5000
+with mx.autograd.record():
+y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
+r = prob * 5
+r.backward()
+
+y = y.asnumpy()
+x = x.asnumpy()
+dx = dx.asnumpy()
+if len(x.shape) is 1:
+x = x.reshape((1, x.shape[0]))
+dx = dx.reshape(1, dx.shape[0])
+y = y.reshape((1, y.shape[0]))
+prob = prob.reshape((1, prob.shape[0]))
+for i in range(x.shape[0]):
+freq = np.bincount(y[i,:], 
minlength=5)/np.float32(samples)*x[i,:].sum()
+mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
+rprob = x[i][y[i]]/x[i].sum()
+mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
 
 Review comment:
   Is the default not 1e-20?


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 #10413: [MXNET-160] Fix for issue 9062

2018-04-04 Thread GitBox
anirudh2290 commented on a change in pull request #10413: [MXNET-160] Fix for 
issue 9062
URL: https://github.com/apache/incubator-mxnet/pull/10413#discussion_r179347145
 
 

 ##
 File path: tests/python/unittest/test_random.py
 ##
 @@ -276,29 +276,34 @@ def test_parallel_random_seed_setting():
 
 @with_seed()
 def test_sample_multinomial():
-x = mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0
-dx = mx.nd.ones_like(x)
-mx.contrib.autograd.mark_variables([x], [dx])
-# Adding rtol and increasing samples needed to pass with seed 2951820647
-samples = 5000
-with mx.autograd.record():
-y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
-r = prob * 5
-r.backward()
-
-y = y.asnumpy()
-x = x.asnumpy()
-for i in range(x.shape[0]):
-
-freq = np.bincount(y[i], minlength=5)/np.float32(samples)*x[i].sum()
-mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
-rprob = x[i][y[i]]/x[i].sum()
-mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
-
-real_dx = np.zeros((5,))
-for j in range(samples):
-real_dx[y[i][j]] += 5.0 / rprob[j]
-mx.test_utils.assert_almost_equal(real_dx, dx.asnumpy()[i], rtol=1e-4)
+for x in [mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0, 
mx.nd.array([0,1,2,3,4])/10.0]:
+dx = mx.nd.ones_like(x)
+mx.contrib.autograd.mark_variables([x], [dx])
+# Adding rtol and increasing samples needed to pass with seed 
2951820647
+samples = 5000
+with mx.autograd.record():
+y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
+r = prob * 5
+r.backward()
+
+y = y.asnumpy()
+x = x.asnumpy()
+dx = dx.asnumpy()
+if len(x.shape) is 1:
+x = x.reshape((1, x.shape[0]))
+dx = dx.reshape(1, dx.shape[0])
+y = y.reshape((1, y.shape[0]))
+prob = prob.reshape((1, prob.shape[0]))
+for i in range(x.shape[0]):
+freq = np.bincount(y[i,:], 
minlength=5)/np.float32(samples)*x[i,:].sum()
+mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
+rprob = x[i][y[i]]/x[i].sum()
+mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
 
 Review comment:
   should we provide specific atol ?


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 #10413: [MXNET-160] Fix for issue 9062

2018-04-04 Thread GitBox
anirudh2290 commented on a change in pull request #10413: [MXNET-160] Fix for 
issue 9062
URL: https://github.com/apache/incubator-mxnet/pull/10413#discussion_r179347161
 
 

 ##
 File path: tests/python/unittest/test_random.py
 ##
 @@ -276,29 +276,34 @@ def test_parallel_random_seed_setting():
 
 @with_seed()
 def test_sample_multinomial():
-x = mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0
-dx = mx.nd.ones_like(x)
-mx.contrib.autograd.mark_variables([x], [dx])
-# Adding rtol and increasing samples needed to pass with seed 2951820647
-samples = 5000
-with mx.autograd.record():
-y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
-r = prob * 5
-r.backward()
-
-y = y.asnumpy()
-x = x.asnumpy()
-for i in range(x.shape[0]):
-
-freq = np.bincount(y[i], minlength=5)/np.float32(samples)*x[i].sum()
-mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
-rprob = x[i][y[i]]/x[i].sum()
-mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
-
-real_dx = np.zeros((5,))
-for j in range(samples):
-real_dx[y[i][j]] += 5.0 / rprob[j]
-mx.test_utils.assert_almost_equal(real_dx, dx.asnumpy()[i], rtol=1e-4)
+for x in [mx.nd.array([[0,1,2,3,4],[4,3,2,1,0]])/10.0, 
mx.nd.array([0,1,2,3,4])/10.0]:
+dx = mx.nd.ones_like(x)
+mx.contrib.autograd.mark_variables([x], [dx])
+# Adding rtol and increasing samples needed to pass with seed 
2951820647
+samples = 5000
+with mx.autograd.record():
+y, prob = mx.nd.random.multinomial(x, shape=samples, get_prob=True)
+r = prob * 5
+r.backward()
+
+y = y.asnumpy()
+x = x.asnumpy()
+dx = dx.asnumpy()
+if len(x.shape) is 1:
+x = x.reshape((1, x.shape[0]))
+dx = dx.reshape(1, dx.shape[0])
+y = y.reshape((1, y.shape[0]))
+prob = prob.reshape((1, prob.shape[0]))
+for i in range(x.shape[0]):
+freq = np.bincount(y[i,:], 
minlength=5)/np.float32(samples)*x[i,:].sum()
+mx.test_utils.assert_almost_equal(freq, x[i], rtol=0.20)
+rprob = x[i][y[i]]/x[i].sum()
+mx.test_utils.assert_almost_equal(np.log(rprob), prob.asnumpy()[i])
+
+real_dx = np.zeros((5,))
+for j in range(samples):
+real_dx[y[i][j]] += 5.0 / rprob[j]
+mx.test_utils.assert_almost_equal(real_dx, dx[i, :], rtol=1e-4)
 
 Review comment:
   same question as above.


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 #10391: [MXNET-139] Tutorial for mixed precision training with float16

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10391: [MXNET-139] 
Tutorial for mixed precision training with float16
URL: https://github.com/apache/incubator-mxnet/pull/10391#discussion_r179344795
 
 

 ##
 File path: docs/tutorials/python/float16.md
 ##
 @@ -0,0 +1,280 @@
+# Mixed precision training using float16
+
+The computational resources required for training deep neural networks has 
been increasing of late because of complexity of the architectures and size of 
models. Mixed precision training allows us to reduces the resources required by 
using lower precision arithmetic. In this approach we train using 16 bit 
floating points (half precision) while using 32 bit floating points (single 
precision) for output buffers of float16 computation. This combination of 
single and half precision gives rise to the name Mixed precision. It allows us 
to achieve the same accuracy as training with single precision, while 
decreasing the required memory and training or inference time.
 
 Review comment:
   gives rise to the name Mixed precision: why capital M? 


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 #10391: [MXNET-139] Tutorial for mixed precision training with float16

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10391: [MXNET-139] 
Tutorial for mixed precision training with float16
URL: https://github.com/apache/incubator-mxnet/pull/10391#discussion_r179344737
 
 

 ##
 File path: docs/tutorials/python/float16.md
 ##
 @@ -0,0 +1,280 @@
+# Mixed precision training using float16
+
+The computational resources required for training deep neural networks has 
been increasing of late because of complexity of the architectures and size of 
models. Mixed precision training allows us to reduces the resources required by 
using lower precision arithmetic. In this approach we train using 16 bit 
floating points (half precision) while using 32 bit floating points (single 
precision) for output buffers of float16 computation. This combination of 
single and half precision gives rise to the name Mixed precision. It allows us 
to achieve the same accuracy as training with single precision, while 
decreasing the required memory and training or inference time.
 
 Review comment:
   resources required for training deep neural networks has  -> 
   resources required for training deep neural networks have 


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 #10391: [MXNET-139] Tutorial for mixed precision training with float16

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10391: [MXNET-139] 
Tutorial for mixed precision training with float16
URL: https://github.com/apache/incubator-mxnet/pull/10391#discussion_r179343748
 
 

 ##
 File path: docs/tutorials/python/float16.md
 ##
 @@ -0,0 +1,280 @@
+# Mixed precision training using float16
+
+The computational resources required for training deep neural networks has 
been increasing of late because of complexity of the architectures and size of 
models. Mixed precision training allows us to reduces the resources required by 
using lower precision arithmetic. In this approach we train using 16 bit 
floating points (half precision) while using 32 bit floating points (single 
precision) for output buffers of float16 computation. This combination of 
single and half precision gives rise to the name Mixed precision. It allows us 
to achieve the same accuracy as training with single precision, while 
decreasing the required memory and training or inference time.
+
+The float16 data type, is a 16 bit floating point representation according to 
the IEEE 754 standard. It has a dynamic range where the precision can go from 
0.000596046 (highest, for values closest to 0) to 32 (lowest, for values in 
the range 32768-65536). Despite the decreased precision when compared to single 
precision (float32), float16 computation can be much faster on supported 
hardware. The motivation for using float16 for deep learning comes from the 
idea that deep neural network architectures have natural resilience to errors 
due to backpropagation. Half precision is typically sufficient for training 
neural networks. This means that on hardware with specialized support for 
float16 computation we can greatly improve the speed of training and inference. 
This speedup results from faster matrix multiplication, saving on memory 
bandwidth and reduced communication costs. It also reduces the size of the 
model, allowing us to train larger models and use larger batch sizes. 
+
+The Volta range of Graphics Processing Units (GPUs) from Nvidia have Tensor 
Cores which perform efficient float16 computation. A tensor core allows 
accumulation of half precision products into single or half precision outputs. 
For the rest of this tutorial we assume that we are working with Nvidia's 
Tensor Cores on a Volta GPU.
+
+In this tutorial we will walk through how one can train deep learning neural 
networks with mixed precision on supported hardware. We will first see how to 
use float16 and then some techniques on achieving good performance and accuracy.
+
+## Prerequisites
+
+- Volta range of Nvidia GPUs
+- Cuda 9 or higher
+- CUDNN v7 or higher
+
+## Using the Gluon API
+
+With Gluon, we need to take care of two things to convert a model to support 
float16.
+1. Cast the Gluon Block, so as to cast the parameters of layers and change the 
type of input expected, to float16.
+2. Cast the data to float16 to match the input type expected by the blocks if 
necessary.
+
+### Training
+Let us look at an example of training a Resnet50 model with the Caltech101 
dataset with float16. 
+First, let us get some import stuff out of the way.
+
+
+```python
+import os
+import tarfile
+import multiprocessing
+import time
+import numpy as np
+import mxnet as mx
+from mxnet import nd, autograd, gluon
+from mxnet.gluon.model_zoo import vision as models
+from mxnet.metric import Accuracy
+from mxnet.gluon.data.vision.datasets import ImageFolderDataset
+```
+
+Let us start by fetching the Caltech101 dataset and extracting it. 
+
+
+```python
+url = 
"https://s3.us-east-2.amazonaws.com/mxnet-public/101_ObjectCategories.tar.gz;
+dataset_name = "101_ObjectCategories"
+data_folder = "data"
+if not os.path.isdir(data_folder):
+os.makedirs(data_folder)
+tar_path = mx.gluon.utils.download(url, path='data')
+if (not os.path.isdir(os.path.join(data_folder, "101_ObjectCategories")) or 
+not os.path.isdir(os.path.join(data_folder, "101_ObjectCategories_test"))):
+tar = tarfile.open(tar_path, "r:gz")
+tar.extractall(data_folder)
+tar.close()
+print('Data extracted')
+training_path = os.path.join(data_folder, dataset_name)
+testing_path = os.path.join(data_folder, "{}_test".format(dataset_name))
+```
+
+Now we have the images in two folders, one for training and the other for 
test. Let us next create Gluon Dataset from these folders, and then create 
Gluon DataLoader from those datasets. Let us also define a transform function 
so that each image loaded is resized, cropped and transposed. 
+
+
+```python
+EDGE = 224
+SIZE = (EDGE, EDGE)
+NUM_WORKERS = multiprocessing.cpu_count()
+# Lower batch size if you run out of memory on your GPU
+BATCH_SIZE = 64
+
+def transform(image, label):
+resized = mx.image.resize_short(image, EDGE)
+cropped, crop_info = mx.image.center_crop(resized, SIZE)
+transposed = nd.transpose(cropped, (2,0,1))
+return transposed, label
+
+dataset_train = 

[GitHub] eric-haibin-lin commented on a change in pull request #10391: [MXNET-139] Tutorial for mixed precision training with float16

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10391: [MXNET-139] 
Tutorial for mixed precision training with float16
URL: https://github.com/apache/incubator-mxnet/pull/10391#discussion_r179345236
 
 

 ##
 File path: docs/tutorials/python/float16.md
 ##
 @@ -0,0 +1,280 @@
+# Mixed precision training using float16
+
+The computational resources required for training deep neural networks has 
been increasing of late because of complexity of the architectures and size of 
models. Mixed precision training allows us to reduces the resources required by 
using lower precision arithmetic. In this approach we train using 16 bit 
floating points (half precision) while using 32 bit floating points (single 
precision) for output buffers of float16 computation. This combination of 
single and half precision gives rise to the name Mixed precision. It allows us 
to achieve the same accuracy as training with single precision, while 
decreasing the required memory and training or inference time.
+
+The float16 data type, is a 16 bit floating point representation according to 
the IEEE 754 standard. It has a dynamic range where the precision can go from 
0.000596046 (highest, for values closest to 0) to 32 (lowest, for values in 
the range 32768-65536). Despite the decreased precision when compared to single 
precision (float32), float16 computation can be much faster on supported 
hardware. The motivation for using float16 for deep learning comes from the 
idea that deep neural network architectures have natural resilience to errors 
due to backpropagation. Half precision is typically sufficient for training 
neural networks. This means that on hardware with specialized support for 
float16 computation we can greatly improve the speed of training and inference. 
This speedup results from faster matrix multiplication, saving on memory 
bandwidth and reduced communication costs. It also reduces the size of the 
model, allowing us to train larger models and use larger batch sizes. 
+
+The Volta range of Graphics Processing Units (GPUs) from Nvidia have Tensor 
Cores which perform efficient float16 computation. A tensor core allows 
accumulation of half precision products into single or half precision outputs. 
For the rest of this tutorial we assume that we are working with Nvidia's 
Tensor Cores on a Volta GPU.
+
+In this tutorial we will walk through how one can train deep learning neural 
networks with mixed precision on supported hardware. We will first see how to 
use float16 and then some techniques on achieving good performance and accuracy.
+
+## Prerequisites
+
+- Volta range of Nvidia GPUs
+- Cuda 9 or higher
+- CUDNN v7 or higher
+
 
 Review comment:
   Could you start with an overview that the tutorial covers both Gluon and 
Symbolic APIs?


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 #10391: [MXNET-139] Tutorial for mixed precision training with float16

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10391: [MXNET-139] 
Tutorial for mixed precision training with float16
URL: https://github.com/apache/incubator-mxnet/pull/10391#discussion_r179345318
 
 

 ##
 File path: docs/tutorials/python/float16.md
 ##
 @@ -0,0 +1,280 @@
+# Mixed precision training using float16
+
+The computational resources required for training deep neural networks has 
been increasing of late because of complexity of the architectures and size of 
models. Mixed precision training allows us to reduces the resources required by 
using lower precision arithmetic. In this approach we train using 16 bit 
floating points (half precision) while using 32 bit floating points (single 
precision) for output buffers of float16 computation. This combination of 
single and half precision gives rise to the name Mixed precision. It allows us 
to achieve the same accuracy as training with single precision, while 
decreasing the required memory and training or inference time.
+
+The float16 data type, is a 16 bit floating point representation according to 
the IEEE 754 standard. It has a dynamic range where the precision can go from 
0.000596046 (highest, for values closest to 0) to 32 (lowest, for values in 
the range 32768-65536). Despite the decreased precision when compared to single 
precision (float32), float16 computation can be much faster on supported 
hardware. The motivation for using float16 for deep learning comes from the 
idea that deep neural network architectures have natural resilience to errors 
due to backpropagation. Half precision is typically sufficient for training 
neural networks. This means that on hardware with specialized support for 
float16 computation we can greatly improve the speed of training and inference. 
This speedup results from faster matrix multiplication, saving on memory 
bandwidth and reduced communication costs. It also reduces the size of the 
model, allowing us to train larger models and use larger batch sizes. 
+
+The Volta range of Graphics Processing Units (GPUs) from Nvidia have Tensor 
Cores which perform efficient float16 computation. A tensor core allows 
accumulation of half precision products into single or half precision outputs. 
For the rest of this tutorial we assume that we are working with Nvidia's 
Tensor Cores on a Volta GPU.
+
+In this tutorial we will walk through how one can train deep learning neural 
networks with mixed precision on supported hardware. We will first see how to 
use float16 and then some techniques on achieving good performance and accuracy.
+
+## Prerequisites
+
+- Volta range of Nvidia GPUs
+- Cuda 9 or higher
+- CUDNN v7 or higher
+
+## Using the Gluon API
+
+With Gluon, we need to take care of two things to convert a model to support 
float16.
+1. Cast the Gluon Block, so as to cast the parameters of layers and change the 
type of input expected, to float16.
+2. Cast the data to float16 to match the input type expected by the blocks if 
necessary.
+
+### Training
+Let us look at an example of training a Resnet50 model with the Caltech101 
dataset with float16. 
+First, let us get some import stuff out of the way.
+
+
+```python
+import os
+import tarfile
+import multiprocessing
+import time
+import numpy as np
+import mxnet as mx
+from mxnet import nd, autograd, gluon
+from mxnet.gluon.model_zoo import vision as models
+from mxnet.metric import Accuracy
+from mxnet.gluon.data.vision.datasets import ImageFolderDataset
+```
+
+Let us start by fetching the Caltech101 dataset and extracting it. 
+
+
+```python
+url = 
"https://s3.us-east-2.amazonaws.com/mxnet-public/101_ObjectCategories.tar.gz;
+dataset_name = "101_ObjectCategories"
+data_folder = "data"
+if not os.path.isdir(data_folder):
+os.makedirs(data_folder)
+tar_path = mx.gluon.utils.download(url, path='data')
+if (not os.path.isdir(os.path.join(data_folder, "101_ObjectCategories")) or 
+not os.path.isdir(os.path.join(data_folder, "101_ObjectCategories_test"))):
+tar = tarfile.open(tar_path, "r:gz")
+tar.extractall(data_folder)
+tar.close()
+print('Data extracted')
+training_path = os.path.join(data_folder, dataset_name)
+testing_path = os.path.join(data_folder, "{}_test".format(dataset_name))
+```
+
+Now we have the images in two folders, one for training and the other for 
test. Let us next create Gluon Dataset from these folders, and then create 
Gluon DataLoader from those datasets. Let us also define a transform function 
so that each image loaded is resized, cropped and transposed. 
+
+
+```python
+EDGE = 224
+SIZE = (EDGE, EDGE)
+NUM_WORKERS = multiprocessing.cpu_count()
+# Lower batch size if you run out of memory on your GPU
+BATCH_SIZE = 64
+
+def transform(image, label):
+resized = mx.image.resize_short(image, EDGE)
+cropped, crop_info = mx.image.center_crop(resized, SIZE)
+transposed = nd.transpose(cropped, (2,0,1))
+return transposed, label
+
+dataset_train = 

[GitHub] eric-haibin-lin commented on a change in pull request #10391: [MXNET-139] Tutorial for mixed precision training with float16

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10391: [MXNET-139] 
Tutorial for mixed precision training with float16
URL: https://github.com/apache/incubator-mxnet/pull/10391#discussion_r179345014
 
 

 ##
 File path: docs/tutorials/python/float16.md
 ##
 @@ -0,0 +1,280 @@
+# Mixed precision training using float16
+
+The computational resources required for training deep neural networks has 
been increasing of late because of complexity of the architectures and size of 
models. Mixed precision training allows us to reduces the resources required by 
using lower precision arithmetic. In this approach we train using 16 bit 
floating points (half precision) while using 32 bit floating points (single 
precision) for output buffers of float16 computation. This combination of 
single and half precision gives rise to the name Mixed precision. It allows us 
to achieve the same accuracy as training with single precision, while 
decreasing the required memory and training or inference time.
+
+The float16 data type, is a 16 bit floating point representation according to 
the IEEE 754 standard. It has a dynamic range where the precision can go from 
0.000596046 (highest, for values closest to 0) to 32 (lowest, for values in 
the range 32768-65536). Despite the decreased precision when compared to single 
precision (float32), float16 computation can be much faster on supported 
hardware. The motivation for using float16 for deep learning comes from the 
idea that deep neural network architectures have natural resilience to errors 
due to backpropagation. Half precision is typically sufficient for training 
neural networks. This means that on hardware with specialized support for 
float16 computation we can greatly improve the speed of training and inference. 
This speedup results from faster matrix multiplication, saving on memory 
bandwidth and reduced communication costs. It also reduces the size of the 
model, allowing us to train larger models and use larger batch sizes. 
+
+The Volta range of Graphics Processing Units (GPUs) from Nvidia have Tensor 
Cores which perform efficient float16 computation. A tensor core allows 
accumulation of half precision products into single or half precision outputs. 
For the rest of this tutorial we assume that we are working with Nvidia's 
Tensor Cores on a Volta GPU.
+
+In this tutorial we will walk through how one can train deep learning neural 
networks with mixed precision on supported hardware. We will first see how to 
use float16 and then some techniques on achieving good performance and accuracy.
+
+## Prerequisites
+
+- Volta range of Nvidia GPUs
+- Cuda 9 or higher
+- CUDNN v7 or higher
+
+## Using the Gluon API
+
+With Gluon, we need to take care of two things to convert a model to support 
float16.
+1. Cast the Gluon Block, so as to cast the parameters of layers and change the 
type of input expected, to float16.
+2. Cast the data to float16 to match the input type expected by the blocks if 
necessary.
+
+### Training
+Let us look at an example of training a Resnet50 model with the Caltech101 
dataset with float16. 
 
 Review comment:
   Add a reference link to the dataset description?


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 #10391: [MXNET-139] Tutorial for mixed precision training with float16

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10391: [MXNET-139] 
Tutorial for mixed precision training with float16
URL: https://github.com/apache/incubator-mxnet/pull/10391#discussion_r179345103
 
 

 ##
 File path: docs/tutorials/python/float16.md
 ##
 @@ -0,0 +1,280 @@
+# Mixed precision training using float16
+
+The computational resources required for training deep neural networks has 
been increasing of late because of complexity of the architectures and size of 
models. Mixed precision training allows us to reduces the resources required by 
using lower precision arithmetic. In this approach we train using 16 bit 
floating points (half precision) while using 32 bit floating points (single 
precision) for output buffers of float16 computation. This combination of 
single and half precision gives rise to the name Mixed precision. It allows us 
to achieve the same accuracy as training with single precision, while 
decreasing the required memory and training or inference time.
+
+The float16 data type, is a 16 bit floating point representation according to 
the IEEE 754 standard. It has a dynamic range where the precision can go from 
0.000596046 (highest, for values closest to 0) to 32 (lowest, for values in 
the range 32768-65536). Despite the decreased precision when compared to single 
precision (float32), float16 computation can be much faster on supported 
hardware. The motivation for using float16 for deep learning comes from the 
idea that deep neural network architectures have natural resilience to errors 
due to backpropagation. Half precision is typically sufficient for training 
neural networks. This means that on hardware with specialized support for 
float16 computation we can greatly improve the speed of training and inference. 
This speedup results from faster matrix multiplication, saving on memory 
bandwidth and reduced communication costs. It also reduces the size of the 
model, allowing us to train larger models and use larger batch sizes. 
+
+The Volta range of Graphics Processing Units (GPUs) from Nvidia have Tensor 
Cores which perform efficient float16 computation. A tensor core allows 
accumulation of half precision products into single or half precision outputs. 
For the rest of this tutorial we assume that we are working with Nvidia's 
Tensor Cores on a Volta GPU.
+
+In this tutorial we will walk through how one can train deep learning neural 
networks with mixed precision on supported hardware. We will first see how to 
use float16 and then some techniques on achieving good performance and accuracy.
+
+## Prerequisites
+
+- Volta range of Nvidia GPUs
+- Cuda 9 or higher
+- CUDNN v7 or higher
+
+## Using the Gluon API
+
+With Gluon, we need to take care of two things to convert a model to support 
float16.
+1. Cast the Gluon Block, so as to cast the parameters of layers and change the 
type of input expected, to float16.
+2. Cast the data to float16 to match the input type expected by the blocks if 
necessary.
+
+### Training
+Let us look at an example of training a Resnet50 model with the Caltech101 
dataset with float16. 
+First, let us get some import stuff out of the way.
+
+
+```python
+import os
+import tarfile
+import multiprocessing
+import time
+import numpy as np
+import mxnet as mx
+from mxnet import nd, autograd, gluon
+from mxnet.gluon.model_zoo import vision as models
+from mxnet.metric import Accuracy
+from mxnet.gluon.data.vision.datasets import ImageFolderDataset
+```
+
+Let us start by fetching the Caltech101 dataset and extracting it. 
 
 Review comment:
   Could you add a reminder of how big the dataset is (num images, number of 
GBs)


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 #10391: [MXNET-139] Tutorial for mixed precision training with float16

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10391: [MXNET-139] 
Tutorial for mixed precision training with float16
URL: https://github.com/apache/incubator-mxnet/pull/10391#discussion_r179344912
 
 

 ##
 File path: docs/tutorials/python/float16.md
 ##
 @@ -0,0 +1,280 @@
+# Mixed precision training using float16
+
+The computational resources required for training deep neural networks has 
been increasing of late because of complexity of the architectures and size of 
models. Mixed precision training allows us to reduces the resources required by 
using lower precision arithmetic. In this approach we train using 16 bit 
floating points (half precision) while using 32 bit floating points (single 
precision) for output buffers of float16 computation. This combination of 
single and half precision gives rise to the name Mixed precision. It allows us 
to achieve the same accuracy as training with single precision, while 
decreasing the required memory and training or inference time.
+
+The float16 data type, is a 16 bit floating point representation according to 
the IEEE 754 standard. It has a dynamic range where the precision can go from 
0.000596046 (highest, for values closest to 0) to 32 (lowest, for values in 
the range 32768-65536). Despite the decreased precision when compared to single 
precision (float32), float16 computation can be much faster on supported 
hardware. The motivation for using float16 for deep learning comes from the 
idea that deep neural network architectures have natural resilience to errors 
due to backpropagation. Half precision is typically sufficient for training 
neural networks. This means that on hardware with specialized support for 
float16 computation we can greatly improve the speed of training and inference. 
This speedup results from faster matrix multiplication, saving on memory 
bandwidth and reduced communication costs. It also reduces the size of the 
model, allowing us to train larger models and use larger batch sizes. 
+
+The Volta range of Graphics Processing Units (GPUs) from Nvidia have Tensor 
Cores which perform efficient float16 computation. A tensor core allows 
accumulation of half precision products into single or half precision outputs. 
For the rest of this tutorial we assume that we are working with Nvidia's 
Tensor Cores on a Volta GPU.
 
 Review comment:
   Put a reference link to Tensor Cores?


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 #9949: Mac build from source script validation fails

2018-04-04 Thread GitBox
gautamkmr commented on issue #9949: Mac build from source script validation 
fails
URL: 
https://github.com/apache/incubator-mxnet/issues/9949#issuecomment-378813533
 
 
   Looks like 1.0.0. was fine 
   
   PR which tried to add the numpy version but looks like python-2.7.10 is too 
old for numpy version 1.8.2. 
   
   
https://github.com/apache/incubator-mxnet/commit/17427d1dc949cb921a190151bc8de74ed50504ef#diff-8cf6167d58ce775a08acafcfe6f40966R31


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 issue #10374: Sparse support for Custom Op

2018-04-04 Thread GitBox
anirudh2290 commented on issue #10374: Sparse support for Custom Op
URL: https://github.com/apache/incubator-mxnet/pull/10374#issuecomment-378812007
 
 
   @piiswrong WDYT ?


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 closed issue #8524: Cast storage to same stype gives an error for csr

2018-04-04 Thread GitBox
eric-haibin-lin closed issue #8524: Cast storage to same stype gives an error 
for csr
URL: https://github.com/apache/incubator-mxnet/issues/8524
 
 
   


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 support for cast storage on same stypes (#10400)

2018-04-04 Thread haibin
This is an automated email from the ASF dual-hosted git repository.

haibin 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 2cd09a0  Add support for cast storage on same stypes (#10400)
2cd09a0 is described below

commit 2cd09a0c27b6dc73fd50c1ac4eb51df6e493eb9a
Author: Anirudh Subramanian 
AuthorDate: Wed Apr 4 20:37:40 2018 -0700

Add support for cast storage on same stypes (#10400)

* Add cast storage support for same stypes

* Add imports

* Fix cast

* Fix doc for cast_storage

* Fix
---
 src/operator/tensor/cast_storage-inl.h| 51 +++
 src/operator/tensor/cast_storage.cc   |  2 ++
 tests/python/unittest/test_sparse_operator.py |  3 ++
 3 files changed, 56 insertions(+)

diff --git a/src/operator/tensor/cast_storage-inl.h 
b/src/operator/tensor/cast_storage-inl.h
index 46de10a..f905bf8 100644
--- a/src/operator/tensor/cast_storage-inl.h
+++ b/src/operator/tensor/cast_storage-inl.h
@@ -30,6 +30,7 @@
 #include 
 #include "../mxnet_op.h"
 #include "../operator_common.h"
+#include "../../src/operator/tensor/init_op.h"
 #ifdef __CUDACC__
 #include "./cast_storage-inl.cuh"
 #endif  // __CUDACC__
@@ -328,6 +329,50 @@ void CastStorageCsrDnsImpl(const OpContext& ctx,
   });
 }
 
+/*!
+ * \brief Casts a csr matrix to another csr.
+ */
+template 
+void CastStorageCsrCsrImpl(const OpContext& ctx, const NDArray& csr,
+   NDArray* output) {
+  mshadow::Stream* s = ctx.get_stream();
+  if (!csr.storage_initialized()) {
+FillZerosCsrImpl(s, *output);
+return;
+  }
+  std::vector aux_shapes({csr.aux_shape(csr::kIndPtr), 
csr.aux_shape(csr::kIdx)});
+  output->CheckAndAlloc(aux_shapes);
+  const TBlob& val = output->data();
+  const TBlob& indptr = output->aux_data(csr::kIndPtr);
+  const TBlob& idx = output->aux_data(csr::kIdx);
+  mxnet_op::copy(s, val, csr.data());
+  mxnet_op::copy(s, indptr, csr.aux_data(csr::kIndPtr));
+  mxnet_op::copy(s, idx, csr.aux_data(csr::kIdx));
+}
+
+/*!
+ * \brief Casts a rsp matrix to another rsp.
+ */
+template 
+void CastStorageRspRspImpl(const OpContext& ctx, const NDArray& rsp,
+   NDArray* output) {
+  CHECK_EQ(rsp.storage_type(), output->storage_type())
+  << "Copying with different storage type";
+  mshadow::Stream* s = ctx.get_stream();
+  if (!rsp.storage_initialized()) {
+FillZerosRspImpl(s, *output);
+return;
+  }
+  auto aux_shape = rsp.aux_shape(rowsparse::kIdx);
+  output->CheckAndAlloc({aux_shape});
+  const TBlob& val = output->data();
+  const TBlob& idx = output->aux_data(rowsparse::kIdx);
+  const TBlob& from_val = rsp.data();
+  const TBlob& from_idx = rsp.aux_data(rowsparse::kIdx);
+  mxnet_op::copy(s, val, from_val);
+  mxnet_op::copy(s, idx, from_idx);
+}
+
 template
 void CastStorageComputeImpl(const OpContext& ctx,
 const NDArray& input,
@@ -346,6 +391,12 @@ void CastStorageComputeImpl(const OpContext& ctx,
   } else if (src_stype == kCSRStorage && dst_stype == kDefaultStorage) {
 TBlob ret = output.data();
 CastStorageCsrDnsImpl(ctx, input, );
+  } else if (src_stype == kCSRStorage && dst_stype == kCSRStorage) {
+NDArray ret = output;
+CastStorageCsrCsrImpl(ctx, input, );
+  } else if (src_stype == kRowSparseStorage && dst_stype == kRowSparseStorage) 
{
+NDArray ret = output;
+CastStorageRspRspImpl(ctx, input, );
 #if MXNET_USE_MKLDNN == 1
   } else if (src_stype == kDefaultStorage && dst_stype == kDefaultStorage) {
 CHECK_EQ(output.ctx().dev_type, input.ctx().dev_type);
diff --git a/src/operator/tensor/cast_storage.cc 
b/src/operator/tensor/cast_storage.cc
index 9f257b1..f77a50a 100644
--- a/src/operator/tensor/cast_storage.cc
+++ b/src/operator/tensor/cast_storage.cc
@@ -46,6 +46,8 @@ The storage type of ``cast_storage`` output depends on stype 
parameter:
 - cast_storage(row_sparse, 'default') = default
 - cast_storage(default, 'csr') = csr
 - cast_storage(default, 'row_sparse') = row_sparse
+- cast_storage(csr, 'csr') = csr
+- cast_storage(row_sparse, 'row_sparse') = row_sparse
 
 Example::
 
diff --git a/tests/python/unittest/test_sparse_operator.py 
b/tests/python/unittest/test_sparse_operator.py
index 9417df3..5ad5215 100644
--- a/tests/python/unittest/test_sparse_operator.py
+++ b/tests/python/unittest/test_sparse_operator.py
@@ -1177,10 +1177,13 @@ def test_cast_storage_ex():
 shape_3d = rand_shape_3d()
 check_cast_storage(shape_2d, d, 'csr', 'default')
 check_cast_storage(shape_2d, d, 'default', 'csr')
+check_cast_storage(shape_2d, d, 'csr', 'csr')
 check_cast_storage(shape_2d, d, 'row_sparse', 'default')
 check_cast_storage(shape_2d, d, 'default', 'row_sparse')
+check_cast_storage(shape_2d, d, 'row_sparse', 'row_sparse')
 

[GitHub] haojin2 commented on issue #10413: [MXNET-160] Fix for issue 9062

2018-04-04 Thread GitBox
haojin2 commented on issue #10413: [MXNET-160] Fix for issue 9062
URL: https://github.com/apache/incubator-mxnet/pull/10413#issuecomment-378810768
 
 
   @eric-haibin-lin @rahul003 @reminisce @anirudh2290 This is bug fix for 
#9062, please give a review if you have a minute. Thanks!


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 mkldnn (#10412)

2018-04-04 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 6d28d0a  Add mkldnn (#10412)
6d28d0a is described below

commit 6d28d0afb0bcc4412b9130ea0dd144cdf9367fd3
Author: Anirudh Subramanian 
AuthorDate: Wed Apr 4 20:22:44 2018 -0700

Add mkldnn (#10412)
---
 LICENSE | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/LICENSE b/LICENSE
index ae18eff..95d4526 100644
--- a/LICENSE
+++ b/LICENSE
@@ -227,7 +227,8 @@
 10. 3rdparty/nnvm/plugin/nnvm-fusion - For details, see, 
3rdparty/nnvm/plugin/nnvm-fusion/LICENSE
 11. 3rdparty/ps-lite - For details, see, 3rdparty/ps-lite/LICENSE
 12. 3rdparty/nnvm/tvm - For details, see, 3rdparty/nnvm/tvm/LICENSE
-13. googlemock scripts/generator - For details, see, 
3rdparty/googletest/googlemock/scripts/generator/LICENSE
+13. 3rdparty/mkldnn - For details, see, 3rdparty/mkldnn/LICENSE
+14. googlemock scripts/generator - For details, see, 
3rdparty/googletest/googlemock/scripts/generator/LICENSE
 
 
 
===

-- 
To stop receiving notification emails like this one, please contact
j...@apache.org.


[GitHub] piiswrong closed pull request #10412: Add mkldnn license

2018-04-04 Thread GitBox
piiswrong closed pull request #10412: Add mkldnn license
URL: https://github.com/apache/incubator-mxnet/pull/10412
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/LICENSE b/LICENSE
index ae18eff703c..95d45265cfd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -227,7 +227,8 @@
 10. 3rdparty/nnvm/plugin/nnvm-fusion - For details, see, 
3rdparty/nnvm/plugin/nnvm-fusion/LICENSE
 11. 3rdparty/ps-lite - For details, see, 3rdparty/ps-lite/LICENSE
 12. 3rdparty/nnvm/tvm - For details, see, 3rdparty/nnvm/tvm/LICENSE
-13. googlemock scripts/generator - For details, see, 
3rdparty/googletest/googlemock/scripts/generator/LICENSE
+13. 3rdparty/mkldnn - For details, see, 3rdparty/mkldnn/LICENSE
+14. googlemock scripts/generator - For details, see, 
3rdparty/googletest/googlemock/scripts/generator/LICENSE
 
 
 
===


 


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] haojin2 commented on issue #10400: Add support for cast storage on same stypes

2018-04-04 Thread GitBox
haojin2 commented on issue #10400: Add support for cast storage on same stypes
URL: https://github.com/apache/incubator-mxnet/pull/10400#issuecomment-378808383
 
 
   LGTM!


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] haojin2 commented on a change in pull request #10388: [MXNET-265] Update optimizer doc to clarify wd behaviors

2018-04-04 Thread GitBox
haojin2 commented on a change in pull request #10388: [MXNET-265] Update 
optimizer doc to clarify wd behaviors
URL: https://github.com/apache/incubator-mxnet/pull/10388#discussion_r179339042
 
 

 ##
 File path: python/mxnet/optimizer.py
 ##
 @@ -538,7 +538,7 @@ def update_multi_precision(self, index, weight, grad, 
state):
 class Signum(Optimizer):
 """The Signum optimizer that takes the sign of gradient or momentum.
 
-The optimizer updates the weight by:
+The optimizer updates the weight by::
 
 Review comment:
   an extra ":" ?


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] haojin2 commented on a change in pull request #10388: [MXNET-265] Update optimizer doc to clarify wd behaviors

2018-04-04 Thread GitBox
haojin2 commented on a change in pull request #10388: [MXNET-265] Update 
optimizer doc to clarify wd behaviors
URL: https://github.com/apache/incubator-mxnet/pull/10388#discussion_r179339042
 
 

 ##
 File path: python/mxnet/optimizer.py
 ##
 @@ -538,7 +538,7 @@ def update_multi_precision(self, index, weight, grad, 
state):
 class Signum(Optimizer):
 """The Signum optimizer that takes the sign of gradient or momentum.
 
-The optimizer updates the weight by:
+The optimizer updates the weight by::
 
 Review comment:
   an extra ":" ?


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 #9949: Mac build from source script validation fails

2018-04-04 Thread GitBox
gautamkmr commented on issue #9949: Mac build from source script validation 
fails
URL: 
https://github.com/apache/incubator-mxnet/issues/9949#issuecomment-378749085
 
 
   So I am able to reproduce this issue mentioned  by Aaron
   
   
   However removing the dependency on numpy from setup.py and installing numpy 
worked fine
   
   
   Best match: certifi 2018.1.18
   Adding certifi 2018.1.18 to easy-install.pth file
   
   Using /Users/gauta/Library/Python/2.7/lib/python/site-packages
   Finished processing dependencies for mxnet==1.1.0
   f45c89a20de7:python gauta$ python 
   Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
   [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import mxnet
   
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/oldnumeric/__init__.py:11:
 ModuleDeprecationWarning: The oldnumeric module will be dropped in Numpy 1.9
 warnings.warn(_msg, ModuleDeprecationWarning)
   >>> mxnet.__version__
   '1.1.0'
   >>> 


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] pengzhao-intel commented on issue #10317: [MXNET-264] Improve performance of MKLDNN in small batch sizes.

2018-04-04 Thread GitBox
pengzhao-intel commented on issue #10317: [MXNET-264] Improve performance of 
MKLDNN in small batch sizes.
URL: https://github.com/apache/incubator-mxnet/pull/10317#issuecomment-378796017
 
 
   LGTM, thanks @zheng-da


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] NKUCodingCat opened a new issue #10416: mx.symbol.LeakyRelu could not be visualized

2018-04-04 Thread GitBox
NKUCodingCat opened a new issue #10416: mx.symbol.LeakyRelu could not be 
visualized 
URL: https://github.com/apache/incubator-mxnet/issues/10416
 
 
   Note: Providing complete information in the most concise form is the best 
way to get help. This issue template serves as the checklist for essential 
information to most of the technical issues and bug reports. For non-technical 
issues and feature requests, feel free to present the information in what you 
believe is the best form.
   
   For Q & A and discussion, please start a discussion thread at 
https://discuss.mxnet.io 
   
   ## Description

   AS TITLE
   ```
   net = mx.symbol.LeakyReLU(net)
   mx.viz.plot_network(net).view()
   
   ```
   ## Environment info (Required)
   ```
   --Python Info--
   ('Version  :', '2.7.14')
   ('Compiler :', 'MSC v.1500 32 bit (Intel)')
   ('Build:', ('v2.7.14:84471935ed', 'Sep 16 2017 20:19:30'))
   ('Arch :', ('32bit', 'WindowsPE'))
   Pip Info---
   ('Version  :', '9.0.1')
   ('Directory:', 'C:\\Python27\\lib\\site-packages\\pip'Traceback (most 
recent call last):
 File "diag.py", line 168, in 
   check_pip()
 File "diag.py", line 96, in check_pip
   print('Directory:', os.path.dirname(pip.__file__))
   IOError: [Errno 2] No such file or directory
   
   C:\Users\jingtao\Desktop\Chem-CNN\CNN_MXNET>py -2 diag.py
   --Python Info--
   ('Version  :', '2.7.14')
   ('Compiler :', 'MSC v.1500 32 bit (Intel)')
   ('Build:', ('v2.7.14:84471935ed', 'Sep 16 2017 20:19:30'))
   ('Arch :', ('32bit', 'WindowsPE'))
   Pip Info---
   ('Version  :', '9.0.1')
   ('Directory:', 'C:\\Python27\\lib\\site-packages\\pip')
   --MXNet Info---
   ('Version  :', '1.0.0')
   ('Directory:', 'C:\\Python27\\lib\\site-packages\\mxnet')
   ('Commit Hash   :', '9ef196909ec7bf9cdda66d5b97c92793109798e1')
   --System Info--
   ('Platform :', 'Windows-10-10.0.16299')
   ('system   :', 'Windows')
   ('node :', 'DESKTOP-H37P4P8')
   ('release  :', '10')
   ('version  :', '10.0.16299')
   --Hardware Info--
   ('machine  :', 'AMD64')
   ('processor:', 'AMD64 Family 23 Model 1 Stepping 1, AuthenticAMD')
   Name
   AMD Ryzen 5 1600X Six-Core Processor
   
   --Network Test--
   Setting timeout: 10
   Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0660 
sec, LOAD: 1.9590 sec.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0220 sec, LOAD: 
0.4010 sec.
   Timing for FashionMNIST: 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz,
 DNS: 0.0010 sec, LOAD: 1.1470 sec.
   Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0. sec, 
LOAD: 0.2360 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0240 sec, LOAD: 
0.1400 sec.
   Error open Gluon Tutorial(cn): https://zh.gluon.ai, , DNS finished in 0.00027520752 sec.
   ```
   ```
   What to do:
   1. Download the diagnosis script from 
https://raw.githubusercontent.com/apache/incubator-mxnet/master/tools/diagnose.py
   2. Run the script using `python diagnose.py` and paste its output here.
   
   ```
   
   Compiler (gcc/clang/mingw/visual studio):
   
   MXNet commit hash:
   Using mxnet in pip 
   
   Build config:
   Using mxnet in pip 
   
   ## Error Message:
   ```
   Traceback (most recent call last):
 File "O_m3.py", line 46, in 
   mx.viz.plot_network(x).view()
 File "C:\Python27\lib\site-packages\mxnet\visualization.py", line 305, in 
plot_network
   label = r"%s\n%s" % (op, node["attrs"]["act_type"])
   KeyError: 'attrs'
   ```
   
   ## Minimum reproducible example
   (If you are using your own code, please provide a short script that 
reproduces the error. Otherwise, please provide link to the existing example.)
   
   ## Steps to reproduce
   (Paste the commands you ran that produced the error.)
   
   1.
   2.
   
   ## What have you tried to solve it?
   
   1.
   2.
   


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] hahnyuan commented on issue #628: Any tools to convert pretrained mxnet model to model for caffe?

2018-04-04 Thread GitBox
hahnyuan commented on issue #628: Any tools to convert pretrained mxnet model 
to model for caffe?
URL: https://github.com/apache/incubator-mxnet/issues/628#issuecomment-378795032
 
 
   I have write a tool for visulize 
https://github.com/hahnyuan/darknet-visualizer


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 #10317: [MXNET-264] Improve performance of MKLDNN in small batch sizes.

2018-04-04 Thread GitBox
cjolivier01 commented on a change in pull request #10317: [MXNET-264] Improve 
performance of MKLDNN in small batch sizes.
URL: https://github.com/apache/incubator-mxnet/pull/10317#discussion_r179326522
 
 

 ##
 File path: src/operator/nn/mkldnn/mkldnn_base-inl.h
 ##
 @@ -334,11 +334,104 @@ const mkldnn::memory *GetWeights(const NDArray ,
  const mkldnn::memory::primitive_desc 
_pd,
  int num_groups);
 
-mkldnn_memory_format_t GetDefaultFormat(mkldnn::memory::desc desc);
+mkldnn_memory_format_t GetDefaultFormat(const mkldnn::memory::desc );
 mkldnn_memory_format_t GetDefaultFormat(int num_dims);
 mkldnn::memory::primitive_desc GetPrimitiveDesc(mkldnn::memory::primitive_desc 
pd,
 mkldnn_memory_format_t format);
 
+static inline bool same_shape(const TShape , const mkldnn_dims_t dims, 
int ndims) {
+  if (shape.ndim() != (size_t)ndims)
+return false;
+  for (int i = 0; i < ndims; i++)
+if (shape[i] != dims[i])
+  return false;
+  return true;
+}
+
+static inline bool same_shape(const TShape , int dtype,
 
 Review comment:
   same 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] cjolivier01 commented on a change in pull request #10317: [MXNET-264] Improve performance of MKLDNN in small batch sizes.

2018-04-04 Thread GitBox
cjolivier01 commented on a change in pull request #10317: [MXNET-264] Improve 
performance of MKLDNN in small batch sizes.
URL: https://github.com/apache/incubator-mxnet/pull/10317#discussion_r179326420
 
 

 ##
 File path: src/operator/nn/lrn-inl.h
 ##
 @@ -58,8 +58,35 @@ struct LRNParam : public dmlc::Parameter {
 DMLC_DECLARE_FIELD(nsize)
 .describe("normalization window width in elements.");
   }
+
+  bool operator==(const LRNParam& other) const {
+return (fabs(this->alpha - other.alpha) < 1e-6 &&
 
 Review comment:
   it’s better to check the nsize first because it’s a far less expensive check 
than fabs()


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 #10317: [MXNET-264] Improve performance of MKLDNN in small batch sizes.

2018-04-04 Thread GitBox
cjolivier01 commented on a change in pull request #10317: [MXNET-264] Improve 
performance of MKLDNN in small batch sizes.
URL: https://github.com/apache/incubator-mxnet/pull/10317#discussion_r179326176
 
 

 ##
 File path: src/operator/nn/mkldnn/mkldnn_base-inl.h
 ##
 @@ -334,11 +334,104 @@ const mkldnn::memory *GetWeights(const NDArray ,
  const mkldnn::memory::primitive_desc 
_pd,
  int num_groups);
 
-mkldnn_memory_format_t GetDefaultFormat(mkldnn::memory::desc desc);
+mkldnn_memory_format_t GetDefaultFormat(const mkldnn::memory::desc );
 mkldnn_memory_format_t GetDefaultFormat(int num_dims);
 mkldnn::memory::primitive_desc GetPrimitiveDesc(mkldnn::memory::primitive_desc 
pd,
 mkldnn_memory_format_t format);
 
+static inline bool same_shape(const TShape , const mkldnn_dims_t dims, 
int ndims) {
 
 Review comment:
   don’t use static in a header. in-line is fine by itself.


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 #10317: [MXNET-264] Improve performance of MKLDNN in small batch sizes.

2018-04-04 Thread GitBox
cjolivier01 commented on a change in pull request #10317: [MXNET-264] Improve 
performance of MKLDNN in small batch sizes.
URL: https://github.com/apache/incubator-mxnet/pull/10317#discussion_r179326773
 
 

 ##
 File path: src/operator/nn/mkldnn/mkldnn_base-inl.h
 ##
 @@ -334,11 +334,104 @@ const mkldnn::memory *GetWeights(const NDArray ,
  const mkldnn::memory::primitive_desc 
_pd,
  int num_groups);
 
-mkldnn_memory_format_t GetDefaultFormat(mkldnn::memory::desc desc);
+mkldnn_memory_format_t GetDefaultFormat(const mkldnn::memory::desc );
 mkldnn_memory_format_t GetDefaultFormat(int num_dims);
 mkldnn::memory::primitive_desc GetPrimitiveDesc(mkldnn::memory::primitive_desc 
pd,
 mkldnn_memory_format_t format);
 
+static inline bool same_shape(const TShape , const mkldnn_dims_t dims, 
int ndims) {
+  if (shape.ndim() != (size_t)ndims)
+return false;
+  for (int i = 0; i < ndims; i++)
+if (shape[i] != dims[i])
+  return false;
+  return true;
+}
+
+static inline bool same_shape(const TShape , int dtype,
+  const mkldnn::memory::desc ) {
+  return same_shape(shape, desc.data.dims, desc.data.ndims)
+  && get_mkldnn_type(dtype) == desc.data.data_type;
+}
+
+/*
+ * There is a large overhead of getting mkldnn::memory::primitive_desc from
+ * mkldnn::memory. This class is created to cache the metadata of mkldnn memory
+ * to provide a much more lightweight method to access them.
+ */
+class MKLDNNMemory {
+  std::shared_ptr mem;
+  mkldnn::memory::desc desc;
+  size_t size;  // The number of bytes.
+
+ public:
+  MKLDNNMemory(mkldnn::memory::primitive_desc pd, void *addr): desc(pd.desc()) 
{
+mem.reset(new mkldnn::memory(pd, addr));
+size = pd.get_size();
+  }
+
+  explicit MKLDNNMemory(std::shared_ptr mem): desc(
+  mem->get_primitive_desc().desc()) {
+this->mem = mem;
+auto pd = mem->get_primitive_desc();
 
 Review comment:
   nit: it isn’t clear what auto is 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] cjolivier01 commented on a change in pull request #10317: [MXNET-264] Improve performance of MKLDNN in small batch sizes.

2018-04-04 Thread GitBox
cjolivier01 commented on a change in pull request #10317: [MXNET-264] Improve 
performance of MKLDNN in small batch sizes.
URL: https://github.com/apache/incubator-mxnet/pull/10317#discussion_r179326679
 
 

 ##
 File path: src/operator/nn/mkldnn/mkldnn_base-inl.h
 ##
 @@ -334,11 +334,104 @@ const mkldnn::memory *GetWeights(const NDArray ,
  const mkldnn::memory::primitive_desc 
_pd,
  int num_groups);
 
-mkldnn_memory_format_t GetDefaultFormat(mkldnn::memory::desc desc);
+mkldnn_memory_format_t GetDefaultFormat(const mkldnn::memory::desc );
 mkldnn_memory_format_t GetDefaultFormat(int num_dims);
 mkldnn::memory::primitive_desc GetPrimitiveDesc(mkldnn::memory::primitive_desc 
pd,
 mkldnn_memory_format_t format);
 
+static inline bool same_shape(const TShape , const mkldnn_dims_t dims, 
int ndims) {
+  if (shape.ndim() != (size_t)ndims)
+return false;
+  for (int i = 0; i < ndims; i++)
+if (shape[i] != dims[i])
+  return false;
+  return true;
+}
+
+static inline bool same_shape(const TShape , int dtype,
+  const mkldnn::memory::desc ) {
+  return same_shape(shape, desc.data.dims, desc.data.ndims)
+  && get_mkldnn_type(dtype) == desc.data.data_type;
+}
+
+/*
+ * There is a large overhead of getting mkldnn::memory::primitive_desc from
+ * mkldnn::memory. This class is created to cache the metadata of mkldnn memory
+ * to provide a much more lightweight method to access them.
+ */
+class MKLDNNMemory {
+  std::shared_ptr mem;
+  mkldnn::memory::desc desc;
+  size_t size;  // The number of bytes.
+
+ public:
+  MKLDNNMemory(mkldnn::memory::primitive_desc pd, void *addr): desc(pd.desc()) 
{
+mem.reset(new mkldnn::memory(pd, addr));
+size = pd.get_size();
+  }
+
+  explicit MKLDNNMemory(std::shared_ptr mem): desc(
 
 Review comment:
   can this pointer be passed by reference to reduce the interlocked operation?


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 closed pull request #10363: Fix windows setup doc using VS 2017

2018-04-04 Thread GitBox
sxjscience closed pull request #10363: Fix windows setup doc using VS 2017
URL: https://github.com/apache/incubator-mxnet/pull/10363
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/install/index.md b/docs/install/index.md
index d9d78dd3693..da687451837 100644
--- a/docs/install/index.md
+++ b/docs/install/index.md
@@ -992,7 +992,67 @@ Refer to 
[#8671](https://github.com/apache/incubator-mxnet/issues/8671) for stat
 
 
 
-To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+We provide both options to build and install MXNet yourself using [Microsoft 
Visual Studio 2017](https://www.visualstudio.com/downloads/), and [Microsoft 
Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/).
+
+**Option 1** 
+
+To build and install MXNet yourself using [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/), you need the following 
dependencies. Install the required dependencies:
+
+1. If [Microsoft Visual Studio 2017](https://www.visualstudio.com/downloads/) 
is not already installed, download and install it. You can download and install 
the free community edition.
+2. Download and install 
[CMake](https://cmake.org/files/v3.11/cmake-3.11.0-rc4-win64-x64.msi) if it is 
not already installed.
+3. Download and install 
[OpenCV](https://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.4.1/opencv-3.4.1-vc14_vc15.exe/download).
+4. Unzip the OpenCV package.
+5. Set the environment variable ```OpenCV_DIR``` to point to the ```OpenCV 
build directory``` (e.g., ```OpenCV_DIR = C:\utils\opencv\build```).
+6. If you don’t have the Intel Math Kernel Library (MKL) installed, download 
and install 
[OpenBlas](https://sourceforge.net/projects/openblas/files/v0.2.20/OpenBLAS%200.2.20%20version.zip/download).
+7. Set the environment variable ```OpenBLAS_HOME``` to point to the 
```OpenBLAS``` directory that contains the ```include``` and ```lib``` 
directories (e.g., ```OpenBLAS_HOME = C:\utils\OpenBLAS```).
+8. Download and install CUDA: Install 
[CUDA](https://developer.nvidia.com/cuda-downloads?target_os=Windows_arch=x86_64_version=10_type=exelocal),
 and Download the base installer (e.g., ```cuda_9.1.85_win10.exe```).
+9. Download and install cuDNN. To get access to the download link, register as 
an NVIDIA community user. Then Follow the 
[link](http://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#install-windows)
 to install the cuDNN.
+10. Download and install [git](https://git-for-windows.github.io/).
+
+After you have installed all of the required dependencies, build the MXNet 
source code:
+
+1. Start ```cmd``` in windows.
+
+2. Download the MXNet source code from GitHub by using following command:
+
+```r
+cd C:\
+git clone https://github.com/apache/incubator-mxnet.git --recursive
+```
+
+3. Follow [this 
link](https://docs.microsoft.com/en-us/visualstudio/install/modify-visual-studio)
 to modify ```Individual components```, and check ```VC++ 2017 version 15.4 
v14.11 toolset```, and click ```Modify```.
+
+4. Change the version of the Visual studio 2017 to v14.11 using the following 
command (by default the VS2017 is installed in the following path):
+
+```r
+"C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.11
+```
+
+5. Create a build dir using the following command and go to the directory, for 
example: 
+
+```r
+mkdir C:\build
+cd C:\build
+```
+
+6. CMake the MXNet source code by using following command:
+
+```r
+cmake -G "Visual Studio 15 2017 Win64" -T cuda=9.1,host=x64 -DUSE_CUDA=1 
-DUSE_CUDNN=1 -DUSE_NVRTC=1 -DUSE_OPENCV=1 -DUSE_OPENMP=1 -DUSE_BLAS=open 
-DUSE_LAPACK=1 -DUSE_DIST_KVSTORE=0 -DCUDA_ARCH_LIST=Common -DCUDA_TOOLSET=9.1 
-DCUDNN_INCLUDE=C:\cuda\include -DCUDNN_LIBRARY=C:\cuda\lib\x64\cudnn.lib 
"C:\incubator-mxnet"
+```
+
+NOTE: make sure the DCUDNN_INCLUDE and DCUDNN_LIBRARY pointing to the 
“include” and “cudnn.lib” of your CUDA installed location, and the 
```C:\incubator-mxnet``` is the location of the source code you just git in the 
previous step
+
+7. After the CMake successfully completed, compile the the MXNet source code 
by using following command:
+
+```r
+msbuild mxnet.sln /p:Configuration=Release;Platform=x64 /maxcpucount
+```
+
+**Option 2** 
+
+To build and install MXNet yourself using [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/), you need the following 
dependencies. Install the required dependencies:
 
 1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
 2. Download and install 

[incubator-mxnet] branch master updated: Fix windows setup doc using VS 2017 (#10363)

2018-04-04 Thread sxjscience
This is an automated email from the ASF dual-hosted git repository.

sxjscience 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 28cb133  Fix windows setup doc using VS 2017 (#10363)
28cb133 is described below

commit 28cb133ef0db27b9e8c809c6d10aab90ecb9e465
Author: cgwang 
AuthorDate: Wed Apr 4 18:15:05 2018 -0700

Fix windows setup doc using VS 2017 (#10363)

update windows gpu setup
---
 docs/install/index.md | 64 ---
 1 file changed, 61 insertions(+), 3 deletions(-)

diff --git a/docs/install/index.md b/docs/install/index.md
index d9d78dd..da68745 100644
--- a/docs/install/index.md
+++ b/docs/install/index.md
@@ -992,7 +992,67 @@ Refer to 
[#8671](https://github.com/apache/incubator-mxnet/issues/8671) for stat
 
 
 
-To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+We provide both options to build and install MXNet yourself using [Microsoft 
Visual Studio 2017](https://www.visualstudio.com/downloads/), and [Microsoft 
Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/).
+
+**Option 1** 
+
+To build and install MXNet yourself using [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/), you need the following 
dependencies. Install the required dependencies:
+
+1. If [Microsoft Visual Studio 2017](https://www.visualstudio.com/downloads/) 
is not already installed, download and install it. You can download and install 
the free community edition.
+2. Download and install 
[CMake](https://cmake.org/files/v3.11/cmake-3.11.0-rc4-win64-x64.msi) if it is 
not already installed.
+3. Download and install 
[OpenCV](https://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.4.1/opencv-3.4.1-vc14_vc15.exe/download).
+4. Unzip the OpenCV package.
+5. Set the environment variable ```OpenCV_DIR``` to point to the ```OpenCV 
build directory``` (e.g., ```OpenCV_DIR = C:\utils\opencv\build```).
+6. If you don’t have the Intel Math Kernel Library (MKL) installed, download 
and install 
[OpenBlas](https://sourceforge.net/projects/openblas/files/v0.2.20/OpenBLAS%200.2.20%20version.zip/download).
+7. Set the environment variable ```OpenBLAS_HOME``` to point to the 
```OpenBLAS``` directory that contains the ```include``` and ```lib``` 
directories (e.g., ```OpenBLAS_HOME = C:\utils\OpenBLAS```).
+8. Download and install CUDA: Install 
[CUDA](https://developer.nvidia.com/cuda-downloads?target_os=Windows_arch=x86_64_version=10_type=exelocal),
 and Download the base installer (e.g., ```cuda_9.1.85_win10.exe```).
+9. Download and install cuDNN. To get access to the download link, register as 
an NVIDIA community user. Then Follow the 
[link](http://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#install-windows)
 to install the cuDNN.
+10. Download and install [git](https://git-for-windows.github.io/).
+
+After you have installed all of the required dependencies, build the MXNet 
source code:
+
+1. Start ```cmd``` in windows.
+
+2. Download the MXNet source code from GitHub by using following command:
+
+```r
+cd C:\
+git clone https://github.com/apache/incubator-mxnet.git --recursive
+```
+
+3. Follow [this 
link](https://docs.microsoft.com/en-us/visualstudio/install/modify-visual-studio)
 to modify ```Individual components```, and check ```VC++ 2017 version 15.4 
v14.11 toolset```, and click ```Modify```.
+
+4. Change the version of the Visual studio 2017 to v14.11 using the following 
command (by default the VS2017 is installed in the following path):
+
+```r
+"C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.11
+```
+
+5. Create a build dir using the following command and go to the directory, for 
example: 
+
+```r
+mkdir C:\build
+cd C:\build
+```
+
+6. CMake the MXNet source code by using following command:
+
+```r
+cmake -G "Visual Studio 15 2017 Win64" -T cuda=9.1,host=x64 -DUSE_CUDA=1 
-DUSE_CUDNN=1 -DUSE_NVRTC=1 -DUSE_OPENCV=1 -DUSE_OPENMP=1 -DUSE_BLAS=open 
-DUSE_LAPACK=1 -DUSE_DIST_KVSTORE=0 -DCUDA_ARCH_LIST=Common -DCUDA_TOOLSET=9.1 
-DCUDNN_INCLUDE=C:\cuda\include -DCUDNN_LIBRARY=C:\cuda\lib\x64\cudnn.lib 
"C:\incubator-mxnet"
+```
+
+NOTE: make sure the DCUDNN_INCLUDE and DCUDNN_LIBRARY pointing to the 
“include” and “cudnn.lib” of your CUDA installed location, and the 
```C:\incubator-mxnet``` is the location of the source code you just git in the 
previous step
+
+7. After the CMake successfully completed, compile the the MXNet source code 
by using following command:
+
+```r
+msbuild mxnet.sln /p:Configuration=Release;Platform=x64 /maxcpucount
+```
+
+**Option 2** 
+
+To build and install MXNet yourself using [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/), you need the following 

[GitHub] cjolivier01 commented on a change in pull request #10317: [MXNET-264] Improve performance of MKLDNN in small batch sizes.

2018-04-04 Thread GitBox
cjolivier01 commented on a change in pull request #10317: [MXNET-264] Improve 
performance of MKLDNN in small batch sizes.
URL: https://github.com/apache/incubator-mxnet/pull/10317#discussion_r179325697
 
 

 ##
 File path: include/mxnet/ndarray.h
 ##
 @@ -74,6 +74,7 @@ enum NDArrayFormatErr {
   kRSPIdxErr, // indices error for row sparse
 };
 
+class MKLDNNMemory;
 
 Review comment:
   one reason is that they cause annoying compile errors when used in pointer 
classes when code the compiler decides it needs the type in order to generate 
the destructor code, for instance or during template instantiation of something 
that uses it directly or indirectly. i’m not going to block the PR over it and 
if you feel
   strongly that you want to use it then fine, but it’s not done much in the 
code base and that’s probably not an accident.


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 closed issue #10399: Memory leak while using adam optimizer

2018-04-04 Thread GitBox
cjolivier01 closed issue #10399: Memory leak while using adam optimizer
URL: https://github.com/apache/incubator-mxnet/issues/10399
 
 
   


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] mbaijal commented on issue #10330: [Post 1.1][WIP] Couple of License Issues from 1.1 Release

2018-04-04 Thread GitBox
mbaijal commented on issue #10330: [Post 1.1][WIP] Couple of License Issues 
from 1.1 Release
URL: 
https://github.com/apache/incubator-mxnet/issues/10330#issuecomment-378059812
 
 
   a. Part a has been Fixed in PR #10373
   
   b. Needs some investigation on best fix since we cant modify 3rdparty 
submodule


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] kpmurali opened a new pull request #10415: [MXNET-284] (WIP) Update release version text to 1.2.0

2018-04-04 Thread GitBox
kpmurali opened a new pull request #10415: [MXNET-284] (WIP) Update release 
version text to 1.2.0
URL: https://github.com/apache/incubator-mxnet/pull/10415
 
 
   ## Description ##
   In the home page for the site, the static text needs to be updated to the 
1.2.0 version.
   
   ### Changes ###
   - [x] Modified the corresponding text in the 
docs/_static/mxnet-theme/index.html file
   


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] anirudhacharya opened a new issue #10414: There is no API Reference for R in MXNet Documentation

2018-04-04 Thread GitBox
anirudhacharya opened a new issue #10414: There is no API Reference for R in 
MXNet Documentation
URL: https://github.com/apache/incubator-mxnet/issues/10414
 
 
   We need an API reference doc for MXNet R bindings - 
http://mxnet.incubator.apache.org/api/r/index.html
   
   Currently it is not there. Creating this issue to track it.
   
   @aaronmarkham 


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] sandeep-krishnamurthy closed issue #6161: Invalid R reference manual

2018-04-04 Thread GitBox
sandeep-krishnamurthy closed issue #6161: Invalid R reference manual
URL: https://github.com/apache/incubator-mxnet/issues/6161
 
 
   


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] sandeep-krishnamurthy closed issue #7483: MXNet - R API broken link

2018-04-04 Thread GitBox
sandeep-krishnamurthy closed issue #7483: MXNet - R API broken link
URL: https://github.com/apache/incubator-mxnet/issues/7483
 
 
   


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] haojin2 opened a new pull request #10413: Fix for issue 9062

2018-04-04 Thread GitBox
haojin2 opened a new pull request #10413: Fix for issue 9062
URL: https://github.com/apache/incubator-mxnet/pull/10413
 
 
   ## Description ##
   Bug fix for issue #9062 
   
   ## Checklist ##
   ### Essentials ###
   - [ ] The PR title starts with [MXNET-$JIRA_ID]
   - [x] Changes are complete (i.e. I finished coding on this PR)
   - [x] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding 
a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a 
new build option with NCCL)
   - [x] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - Check the API doc at 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [x] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [x] Fix the typo in Shape function of sample_multinomial_op.h
   - [x] Add test coverage to verify the fix
   


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] sandeep-krishnamurthy closed pull request #10408: [MXNET-282] Fix R documentation

2018-04-04 Thread GitBox
sandeep-krishnamurthy closed pull request #10408: [MXNET-282] Fix R 
documentation
URL: https://github.com/apache/incubator-mxnet/pull/10408
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/api/julia/index.md b/docs/api/julia/index.md
index edcc145ce2f..f4dc0e5b749 100644
--- a/docs/api/julia/index.md
+++ b/docs/api/julia/index.md
@@ -1,5 +1,7 @@
 # MXNet - Julia API
 
+See the [MXNet Julia Reference 
Manual](https://media.readthedocs.org/pdf/mxnet-test/latest/mxnet-test.pdf).
+
 MXNet supports the Julia programming language. The MXNet Julia package brings 
flexible and efficient GPU
 computing and the state-of-art deep learning to Julia.
 
diff --git a/docs/api/r/index.md b/docs/api/r/index.md
index 8dcb746279d..15596e6dfc4 100644
--- a/docs/api/r/index.md
+++ b/docs/api/r/index.md
@@ -1,7 +1,5 @@
 # MXNet - R API
 
-See the [MXNet R Reference 
Manual](https://media.readthedocs.org/pdf/mxnet-test/latest/mxnet-test.pdf).
-
 MXNet supports the R programming language. The MXNet R package brings flexible 
and efficient GPU
 computing and state-of-art deep learning to R. It enables you to write 
seamless tensor/matrix computation with multiple GPUs in R. It also lets you 
construct and customize the state-of-art deep learning models in R,
   and apply them to tasks, such as image classification and data science 
challenges.
@@ -23,6 +21,5 @@ You can perform tensor or matrix computation in R:
 ```
 ## Resources
 
-* [MXNet R Reference 
Manual](https://media.readthedocs.org/pdf/mxnet-test/latest/mxnet-test.pdf)
 * [MXNet for R Tutorials](../../tutorials/r/index.html)
 


 


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: R documentation (#10408)

2018-04-04 Thread skm
This is an automated email from the ASF dual-hosted git repository.

skm 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 0243dbf  R documentation (#10408)
0243dbf is described below

commit 0243dbf04ecf9f0a3308920494ce3e3a44c51adb
Author: Anirudh <2778341+anirudhacha...@users.noreply.github.com>
AuthorDate: Wed Apr 4 17:22:42 2018 -0700

R documentation (#10408)
---
 docs/api/julia/index.md | 2 ++
 docs/api/r/index.md | 3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/docs/api/julia/index.md b/docs/api/julia/index.md
index edcc145..f4dc0e5 100644
--- a/docs/api/julia/index.md
+++ b/docs/api/julia/index.md
@@ -1,5 +1,7 @@
 # MXNet - Julia API
 
+See the [MXNet Julia Reference 
Manual](https://media.readthedocs.org/pdf/mxnet-test/latest/mxnet-test.pdf).
+
 MXNet supports the Julia programming language. The MXNet Julia package brings 
flexible and efficient GPU
 computing and the state-of-art deep learning to Julia.
 
diff --git a/docs/api/r/index.md b/docs/api/r/index.md
index 8dcb746..15596e6 100644
--- a/docs/api/r/index.md
+++ b/docs/api/r/index.md
@@ -1,7 +1,5 @@
 # MXNet - R API
 
-See the [MXNet R Reference 
Manual](https://media.readthedocs.org/pdf/mxnet-test/latest/mxnet-test.pdf).
-
 MXNet supports the R programming language. The MXNet R package brings flexible 
and efficient GPU
 computing and state-of-art deep learning to R. It enables you to write 
seamless tensor/matrix computation with multiple GPUs in R. It also lets you 
construct and customize the state-of-art deep learning models in R,
   and apply them to tasks, such as image classification and data science 
challenges.
@@ -23,6 +21,5 @@ You can perform tensor or matrix computation in R:
 ```
 ## Resources
 
-* [MXNet R Reference 
Manual](https://media.readthedocs.org/pdf/mxnet-test/latest/mxnet-test.pdf)
 * [MXNet for R Tutorials](../../tutorials/r/index.html)
 

-- 
To stop receiving notification emails like this one, please contact
s...@apache.org.


[GitHub] anirudhacharya commented on issue #10408: [MXNET-282] Fix R documentation

2018-04-04 Thread GitBox
anirudhacharya commented on issue #10408: [MXNET-282] Fix R documentation
URL: https://github.com/apache/incubator-mxnet/pull/10408#issuecomment-378783813
 
 
   @sandeep-krishnamurthy 


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] sandeep-krishnamurthy closed issue #8306: [R] Bug in mx.nd.one.hot or gan code in example

2018-04-04 Thread GitBox
sandeep-krishnamurthy closed issue #8306: [R] Bug in mx.nd.one.hot or gan code 
in example
URL: https://github.com/apache/incubator-mxnet/issues/8306
 
 
   


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] sandeep-krishnamurthy closed issue #9377: Error: Can't find 'R-package' during the installation

2018-04-04 Thread GitBox
sandeep-krishnamurthy closed issue #9377: Error: Can't find 'R-package' during 
the installation
URL: https://github.com/apache/incubator-mxnet/issues/9377
 
 
   


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] sandeep-krishnamurthy closed issue #9565: Are saved mxnet models GPU or system specific?

2018-04-04 Thread GitBox
sandeep-krishnamurthy closed issue #9565: Are saved mxnet models GPU or system 
specific? 
URL: https://github.com/apache/incubator-mxnet/issues/9565
 
 
   


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 #10208: [MXNET-117] Sparse operator broadcast_mul/div(csr, dense) = csr

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10208: [MXNET-117] 
Sparse operator broadcast_mul/div(csr, dense) = csr
URL: https://github.com/apache/incubator-mxnet/pull/10208#discussion_r179316685
 
 

 ##
 File path: src/operator/tensor/elemwise_binary_broadcast_op.h
 ##
 @@ -185,6 +230,94 @@ void BinaryBroadcastCompute(const nnvm::NodeAttrs& attrs,
   }
 }
 
+template
+void BinaryBroadcastCsrDnsCsrImpl(const OpContext& ctx,
+  const NDArray& csr,
+  const NDArray& dns,
+  const OpReqType req,
+  const NDArray& output) {
+  using namespace mshadow;
+  using namespace mxnet_op;
+  using namespace csr;
+  CHECK(req != kAddTo && req != kWriteInplace);
+  mshadow::Stream *s = ctx.get_stream();
+  bool col_vec;
+  if (dns.shape().ndim() == 1) {
+col_vec = false;
+  } else {
+col_vec = (dns.shape()[0] == csr.shape()[0])? true : false;
+  }
+
+  if (csr.storage_initialized()) {
+const nnvm::dim_t nnz = csr.storage_shape()[0];
+const nnvm::dim_t num_rows = output.shape()[0];
+output.CheckAndAlloc({Shape1(num_rows + 1), Shape1(nnz)});
+
+MSHADOW_TYPE_SWITCH(output.dtype(), DType, {
+  MSHADOW_IDX_TYPE_SWITCH(output.aux_type(kIdx), CType, {
+MSHADOW_IDX_TYPE_SWITCH(output.aux_type(kIndPtr), RType, {
+  MXNET_ASSIGN_REQ_SWITCH(req, req_type, {
+if ((dns.shape().ndim() == 2 && dns.shape()[0] == 1 && 
dns.shape()[1] == 1) ||
+(dns.shape().ndim() == 1 && dns.shape()[0] == 1)) {
+  Kernel, xpu>::Launch(
+s, nnz, output.data().dptr(), csr.data().dptr(),
+dns.data().dptr()[0]);
+} else {
+  Kernel, xpu>::Launch(
+s, num_rows, csr.data().dptr(), 
csr.aux_data(kIdx).dptr(),
+csr.aux_data(kIndPtr).dptr(), dns.data().dptr(),
+output.data().dptr(), csr.shape()[1], col_vec);
+}
+Copy(output.aux_data(kIdx).FlatTo1D(),
+ csr.aux_data(kIdx).FlatTo1D());
+Copy(output.aux_data(kIndPtr).FlatTo1D(),
+ csr.aux_data(kIndPtr).FlatTo1D());
+  });
+});
+  });
+});
+  // If input csr is an empty matrix, fill zeros and return
+  } else {
+FillZerosCsrImpl(s, output);
+return;
+  }
+}
+
+template
+void BinaryBroadcastComputeCsrEx(const nnvm::NodeAttrs& attrs,
 
 Review comment:
   rename to `BinaryBroadcastComputeEx`


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] xup6fup commented on issue #8344: Broken link for "MXNet R Reference Manual"?

2018-04-04 Thread GitBox
xup6fup commented on issue #8344: Broken link for "MXNet R Reference Manual"?
URL: 
https://github.com/apache/incubator-mxnet/issues/8344#issuecomment-378780402
 
 
   Do you want this file?
   
   Lanking  於 2018年4月5日 週四 02:05 寫道:
   
   > @chetkhatri  @piiswrong
   > 
   > Hi Eric and Chetan,
   > do we have any way to recover the old R manual?
   > Reference: #6283 
   > Duplicated Open Issue:
   > #7483 
   > #6161 
   >
   > —
   > You are receiving this because you commented.
   > Reply to this email directly, view it on GitHub
   > 
,
   > or mute the thread
   > 

   > .
   >
   


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 #10208: [MXNET-117] Sparse operator broadcast_mul/div(csr, dense) = csr

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10208: [MXNET-117] 
Sparse operator broadcast_mul/div(csr, dense) = csr
URL: https://github.com/apache/incubator-mxnet/pull/10208#discussion_r179316807
 
 

 ##
 File path: src/operator/tensor/elemwise_binary_broadcast_op.h
 ##
 @@ -185,6 +230,94 @@ void BinaryBroadcastCompute(const nnvm::NodeAttrs& attrs,
   }
 }
 
+template
+void BinaryBroadcastCsrDnsCsrImpl(const OpContext& ctx,
+  const NDArray& csr,
+  const NDArray& dns,
+  const OpReqType req,
+  const NDArray& output) {
+  using namespace mshadow;
+  using namespace mxnet_op;
+  using namespace csr;
+  CHECK(req != kAddTo && req != kWriteInplace);
+  mshadow::Stream *s = ctx.get_stream();
+  bool col_vec;
+  if (dns.shape().ndim() == 1) {
+col_vec = false;
+  } else {
+col_vec = (dns.shape()[0] == csr.shape()[0])? true : false;
+  }
+
+  if (csr.storage_initialized()) {
+const nnvm::dim_t nnz = csr.storage_shape()[0];
+const nnvm::dim_t num_rows = output.shape()[0];
+output.CheckAndAlloc({Shape1(num_rows + 1), Shape1(nnz)});
+
+MSHADOW_TYPE_SWITCH(output.dtype(), DType, {
+  MSHADOW_IDX_TYPE_SWITCH(output.aux_type(kIdx), CType, {
+MSHADOW_IDX_TYPE_SWITCH(output.aux_type(kIndPtr), RType, {
+  MXNET_ASSIGN_REQ_SWITCH(req, req_type, {
+if ((dns.shape().ndim() == 2 && dns.shape()[0] == 1 && 
dns.shape()[1] == 1) ||
+(dns.shape().ndim() == 1 && dns.shape()[0] == 1)) {
+  Kernel, xpu>::Launch(
+s, nnz, output.data().dptr(), csr.data().dptr(),
+dns.data().dptr()[0]);
+} else {
+  Kernel, xpu>::Launch(
+s, num_rows, csr.data().dptr(), 
csr.aux_data(kIdx).dptr(),
+csr.aux_data(kIndPtr).dptr(), dns.data().dptr(),
+output.data().dptr(), csr.shape()[1], col_vec);
+}
+Copy(output.aux_data(kIdx).FlatTo1D(),
+ csr.aux_data(kIdx).FlatTo1D());
+Copy(output.aux_data(kIndPtr).FlatTo1D(),
+ csr.aux_data(kIndPtr).FlatTo1D());
+  });
+});
+  });
+});
+  // If input csr is an empty matrix, fill zeros and return
+  } else {
+FillZerosCsrImpl(s, output);
+return;
+  }
+}
+
+template
+void BinaryBroadcastComputeCsrEx(const nnvm::NodeAttrs& attrs,
+ const OpContext& ctx,
+ const std::vector& inputs,
+ const std::vector& req,
+ const std::vector& outputs) {
+  CHECK_EQ(inputs.size(), 2U);
+  CHECK_EQ(outputs.size(), 1U);
+  CHECK_EQ(req.size(), 1U);
+  CHECK_LE(inputs[1].shape().ndim(), 2U)
+<< "input dense matrix should have less than or equal to 2 dimensions";
+  const NDArray& lhs = inputs[0];
+  const NDArray& rhs = inputs[1];
+  const NDArray& out = outputs[0];
+  const auto lhs_stype = lhs.storage_type();
+  const auto rhs_stype = rhs.storage_type();
+  const auto out_stype = out.storage_type();
+  // If the input is not a vector
+  if ((rhs.shape().ndim() != 1U) && (rhs.shape()[0] != 1) && (rhs.shape()[1] 
!= 1)) {
+// Currently do not support elementwise_mul/div(csr, dense) = csr, log and 
exit
+using common::operator_string;
+LOG(FATAL) << operator_string(attrs, ctx, inputs, req, outputs)
+   << "\nIf shape of lhs and rhs match, please explicitly use 
elemwise_mul/div\n";
+  } else {
+if (req[0] != kNullOp) {
+  // broadcast(CSR, Dense(1D)) = CSR
+  if (lhs_stype == kCSRStorage && rhs_stype == kDefaultStorage && 
out_stype == kCSRStorage) {
+BinaryBroadcastCsrDnsCsrImpl(ctx, lhs, rhs, req[0], out);
+  } else {
+LogUnimplementedOp(attrs, ctx, inputs, req, outputs);
 
 Review comment:
   Suggest to move LogUnimplementedOp to line 317. Otherwise it may not be 
called for some unimplemented case


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] rahul003 commented on issue #10183: [MXNET-120] Float16 support for distributed training

2018-04-04 Thread GitBox
rahul003 commented on issue #10183: [MXNET-120] Float16 support for distributed 
training
URL: https://github.com/apache/incubator-mxnet/pull/10183#issuecomment-378779102
 
 
   An update, so the USE_DIST_KVSTORE flag has been added to the build, and 
this PR passes those builds on CPU and 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] cgraywang commented on issue #10363: Fix windows setup doc using VS 2017

2018-04-04 Thread GitBox
cgraywang commented on issue #10363: Fix windows setup doc using VS 2017
URL: https://github.com/apache/incubator-mxnet/pull/10363#issuecomment-378779053
 
 
   Done @sxjscience 


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 opened a new pull request #10412: Add mkldnn license

2018-04-04 Thread GitBox
anirudh2290 opened a new pull request #10412: Add mkldnn license
URL: https://github.com/apache/incubator-mxnet/pull/10412
 
 
   ## Description ##
   (Brief description on what this PR is about)
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to 
the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) 
created (except PRs with tiny changes)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding 
a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a 
new build option with NCCL)
   - [ ] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - Check the API doc at 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [ ] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [ ] Feature1, tests, (and when applicable, API doc)
   - [ ] Feature2, tests, (and when applicable, API doc)
   
   ## Comments ##
   - If this change is a backward incompatible change, why must this change be 
made.
   - Interesting edge cases to note here
   
   @mbaijal @zheng-da 


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] sandeep-krishnamurthy closed issue #9526: The method reset() of DataIter does not work

2018-04-04 Thread GitBox
sandeep-krishnamurthy closed issue #9526: The method reset() of DataIter does 
not work
URL: https://github.com/apache/incubator-mxnet/issues/9526
 
 
   


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] sandeep-krishnamurthy commented on issue #8862: loading resnext-101-64x4d models failed!

2018-04-04 Thread GitBox
sandeep-krishnamurthy commented on issue #8862: loading resnext-101-64x4d 
models failed!
URL: 
https://github.com/apache/incubator-mxnet/issues/8862#issuecomment-37825
 
 
   @shipeng-uestc - Please reopen if your still face the issue.
   Note: You can install latest mxnet with below command:
   ```
   pip install mxnet --pre
   ```


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] cgraywang opened a new pull request #10411: Fix interval sampler

2018-04-04 Thread GitBox
cgraywang opened a new pull request #10411: Fix interval sampler
URL: https://github.com/apache/incubator-mxnet/pull/10411
 
 
   ## Description ##
   Fix interval sampler by enabling the case where length equals to interval.
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to 
the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) 
created (except PRs with tiny changes)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding 
a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a 
new build option with NCCL)
   - [ ] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - Check the API doc at 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [ ] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [ ] Feature1, tests, (and when applicable, API doc)
   - [ ] Feature2, tests, (and when applicable, API doc)
   
   ## Comments ##
   - If this change is a backward incompatible change, why must this change be 
made.
   - Interesting edge cases to note 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] zheng-da commented on issue #10410: Fix output names of nn operators.

2018-04-04 Thread GitBox
zheng-da commented on issue #10410: Fix output names of nn operators.
URL: https://github.com/apache/incubator-mxnet/pull/10410#issuecomment-378770870
 
 
   @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] zheng-da opened a new pull request #10410: Fix output names of nn operators.

2018-04-04 Thread GitBox
zheng-da opened a new pull request #10410: Fix output names of nn operators.
URL: https://github.com/apache/incubator-mxnet/pull/10410
 
 
   ## Description ##
   For the backward compatibility, the output names are added for the operators 
refactored from the old operator interface.
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to 
the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) 
created (except PRs with tiny changes)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding 
a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a 
new build option with NCCL)
   - [ ] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - Check the API doc at 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [ ] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change


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] anirudhacharya commented on issue #9377: Error: Can't find 'R-package' during the installation

2018-04-04 Thread GitBox
anirudhacharya commented on issue #9377: Error: Can't find 'R-package' during 
the installation
URL: 
https://github.com/apache/incubator-mxnet/issues/9377#issuecomment-378770483
 
 
   Issue not reproducible. I am able to install R on ubuntu.
   
   @sandeep-krishnamurthy @cjolivier01 please close the 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] ashokei commented on issue #10317: [MXNET-264] Improve performance of MKLDNN in small batch sizes.

2018-04-04 Thread GitBox
ashokei commented on issue #10317: [MXNET-264] Improve performance of MKLDNN in 
small batch sizes.
URL: https://github.com/apache/incubator-mxnet/pull/10317#issuecomment-378770257
 
 
   @cjolivier01 @piiswrong this PR resolves performance issues with small batch 
size inference, can we get this PR into 1.2.0 release please., thanks.


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] ashokei commented on a change in pull request #10317: [MXNET-264] Improve performance of MKLDNN in small batch sizes.

2018-04-04 Thread GitBox
ashokei commented on a change in pull request #10317: [MXNET-264] Improve 
performance of MKLDNN in small batch sizes.
URL: https://github.com/apache/incubator-mxnet/pull/10317#discussion_r179306524
 
 

 ##
 File path: src/operator/nn/mkldnn/mkldnn_batch_norm-inl.h
 ##
 @@ -234,20 +234,15 @@ void MKLDNNBatchNormForward(const OpContext , const 
BatchNormParam ,
 DType* weight_ptr = gamma.data().dptr();
 DType* bias_ptr = beta.data().dptr();
 if (!param.fix_gamma) {
-#pragma omp parallel for
-  for (int i = 0; i < channels_; i++) {
-weight_buf[i] = weight_ptr[i];
-weight_buf[channels_ + i] = bias_ptr[i];  // bias
-  }
+  memcpy(weight_buf, weight_ptr, sizeof(weight_buf[0]) * channels_);
+  memcpy(_buf[channels_], bias_ptr, sizeof(weight_buf[0]) * 
channels_);
 
 Review comment:
   got it, thanks! we noticed the same performance issue for smaller networks 
too (eg: mnist) . Lower OMP_NUM_THREADS (eg: 4 -vs- 36) was giving better 
performance.
   


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 #10208: [MXNET-117] Sparse operator broadcast_mul/div(csr, dense) = csr

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10208: [MXNET-117] 
Sparse operator broadcast_mul/div(csr, dense) = csr
URL: https://github.com/apache/incubator-mxnet/pull/10208#discussion_r179306215
 
 

 ##
 File path: src/operator/tensor/elemwise_binary_broadcast_op.h
 ##
 @@ -185,6 +230,93 @@ void BinaryBroadcastCompute(const nnvm::NodeAttrs& attrs,
   }
 }
 
+template
+void BinaryBroadcastCsrDnsCsrImpl(const OpContext& ctx,
+  const NDArray& csr,
+  const NDArray& dns,
+  const OpReqType req,
+  const NDArray& output) {
+  using namespace mshadow;
+  using namespace mxnet_op;
+  using namespace csr;
+  CHECK(req != kAddTo && req != kWriteInplace);
+  mshadow::Stream *s = ctx.get_stream();
+  bool col_vec;
+  if (dns.shape().ndim() == 1) {
+col_vec = false;
+  } else {
+col_vec = (dns.shape()[0] == csr.shape()[0])? true : false;
+  }
+
+  if (csr.storage_initialized()) {
+const nnvm::dim_t nnz = csr.storage_shape()[0];
+const nnvm::dim_t num_rows = output.shape()[0];
+output.CheckAndAlloc({Shape1(num_rows + 1), Shape1(nnz)});
+
+MSHADOW_TYPE_SWITCH(output.dtype(), DType, {
+  MSHADOW_IDX_TYPE_SWITCH(output.aux_type(kIdx), CType, {
+MSHADOW_IDX_TYPE_SWITCH(output.aux_type(kIndPtr), RType, {
+  MXNET_ASSIGN_REQ_SWITCH(req, req_type, {
+if (dns.shape().ndim() > 1 && dns.shape()[0] == 1 && 
dns.shape()[1] == 1) {
 
 Review comment:
   would `rhs = mx.nd.array([5])` 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] zheng-da commented on a change in pull request #10317: [MXNET-264] Improve performance of MKLDNN in small batch sizes.

2018-04-04 Thread GitBox
zheng-da commented on a change in pull request #10317: [MXNET-264] Improve 
performance of MKLDNN in small batch sizes.
URL: https://github.com/apache/incubator-mxnet/pull/10317#discussion_r179305690
 
 

 ##
 File path: src/operator/nn/mkldnn/mkldnn_batch_norm-inl.h
 ##
 @@ -234,20 +234,15 @@ void MKLDNNBatchNormForward(const OpContext , const 
BatchNormParam ,
 DType* weight_ptr = gamma.data().dptr();
 DType* bias_ptr = beta.data().dptr();
 if (!param.fix_gamma) {
-#pragma omp parallel for
-  for (int i = 0; i < channels_; i++) {
-weight_buf[i] = weight_ptr[i];
-weight_buf[channels_ + i] = bias_ptr[i];  // bias
-  }
+  memcpy(weight_buf, weight_ptr, sizeof(weight_buf[0]) * channels_);
+  memcpy(_buf[channels_], bias_ptr, sizeof(weight_buf[0]) * 
channels_);
 
 Review comment:
   are you referring to all of the OMP directives? The number of channels is in 
the order of 100. Parallelization overhead is usually larger than the actual 
computation.


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] anirudhacharya commented on issue #8306: [R] Bug in mx.nd.one.hot or gan code in example

2018-04-04 Thread GitBox
anirudhacharya commented on issue #8306: [R] Bug in mx.nd.one.hot or gan code 
in example
URL: 
https://github.com/apache/incubator-mxnet/issues/8306#issuecomment-378766111
 
 
   Error not reproducible. The above code works on the latest master.
   
   @sandeep-krishnamurthy @cjolivier01 @thirdwing  please close this 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] anirudhacharya commented on issue #8306: [R] Bug in mx.nd.one.hot or gan code in example

2018-04-04 Thread GitBox
anirudhacharya commented on issue #8306: [R] Bug in mx.nd.one.hot or gan code 
in example
URL: 
https://github.com/apache/incubator-mxnet/issues/8306#issuecomment-378766111
 
 
   Error not reproducible. The above code works on the latest master.
   
   @sandeep-krishnamurthy please close this 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] aaronmarkham commented on issue #10409: https://newdocs.readthedocs.io is outdated

2018-04-04 Thread GitBox
aaronmarkham commented on issue #10409: https://newdocs.readthedocs.io is 
outdated
URL: 
https://github.com/apache/incubator-mxnet/issues/10409#issuecomment-378764388
 
 
   Plan A, get access to the readthedocs account, and deploy the redirect 
package like this:
   https://github.com/dmlc/docs-redirect-for-mxnet
   
   Plan B, follow this support request to delete the project: 
https://github.com/rtfd/readthedocs.org/issues/3854


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] ashokei commented on a change in pull request #10317: [MXNET-264] Improve performance of MKLDNN in small batch sizes.

2018-04-04 Thread GitBox
ashokei commented on a change in pull request #10317: [MXNET-264] Improve 
performance of MKLDNN in small batch sizes.
URL: https://github.com/apache/incubator-mxnet/pull/10317#discussion_r179302307
 
 

 ##
 File path: src/operator/nn/mkldnn/mkldnn_batch_norm-inl.h
 ##
 @@ -234,20 +234,15 @@ void MKLDNNBatchNormForward(const OpContext , const 
BatchNormParam ,
 DType* weight_ptr = gamma.data().dptr();
 DType* bias_ptr = beta.data().dptr();
 if (!param.fix_gamma) {
-#pragma omp parallel for
-  for (int i = 0; i < channels_; i++) {
-weight_buf[i] = weight_ptr[i];
-weight_buf[channels_ + i] = bias_ptr[i];  // bias
-  }
+  memcpy(weight_buf, weight_ptr, sizeof(weight_buf[0]) * channels_);
+  memcpy(_buf[channels_], bias_ptr, sizeof(weight_buf[0]) * 
channels_);
 
 Review comment:
nice optimization above; why is the below OMP calls causing overhead.


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] aaronmarkham commented on issue #10409: https://newdocs.readthedocs.io is outdated

2018-04-04 Thread GitBox
aaronmarkham commented on issue #10409: https://newdocs.readthedocs.io is 
outdated
URL: 
https://github.com/apache/incubator-mxnet/issues/10409#issuecomment-378764388
 
 
   Plan B, follow this support request: 
https://github.com/rtfd/readthedocs.org/issues/3854


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 opened a new issue #10409: https://newdocs.readthedocs.io is updated

2018-04-04 Thread GitBox
mli opened a new issue #10409: https://newdocs.readthedocs.io is updated
URL: https://github.com/apache/incubator-mxnet/issues/10409
 
 
   @Awyan can you please remove this site? we found a lot of users are 
following the instructions there, but some of them are outdated. 


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] anirudhacharya commented on issue #9565: Are saved mxnet models GPU or system specific?

2018-04-04 Thread GitBox
anirudhacharya commented on issue #9565: Are saved mxnet models GPU or system 
specific? 
URL: 
https://github.com/apache/incubator-mxnet/issues/9565#issuecomment-378762897
 
 
   @sandeep-krishnamurthy please close this bug, as the question has been 
answered


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] anirudhacharya opened a new pull request #10408: [MXNET-282] Fix R documentation

2018-04-04 Thread GitBox
anirudhacharya opened a new pull request #10408: [MXNET-282] Fix R documentation
URL: https://github.com/apache/incubator-mxnet/pull/10408
 
 
   ## Description ##
   R documentation reference manual now points to Julia reference manual.
   
   Fixes these isues - https://github.com/apache/incubator-mxnet/issues/6161 
https://github.com/apache/incubator-mxnet/issues/7483
   
   ### Changes ###
   - [ ] Feature1, tests, (and when applicable, API doc)
   - [ ] Feature2, tests, (and when applicable, API doc)
   
   ## Comments ##
   - @hetong007 


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] sandeep-krishnamurthy closed pull request #10404: fix nproc arg

2018-04-04 Thread GitBox
sandeep-krishnamurthy closed pull request #10404: fix nproc arg
URL: https://github.com/apache/incubator-mxnet/pull/10404
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/prepare_mkldnn.sh b/prepare_mkldnn.sh
index df5e9b99656..828cfe107ed 100755
--- a/prepare_mkldnn.sh
+++ b/prepare_mkldnn.sh
@@ -89,7 +89,7 @@ if [ ! -f $MKLDNN_LIBFILE ]; then
 if [ -z $MKLROOT ] && [ ! -f $MKLDNN_INSTALLDIR/include/mkl_cblas.h ]; then
 rm -rf external && cd scripts && ./prepare_mkl.sh >&2 && cd ..
 cp -a external/*/* $MKLDNN_INSTALLDIR/.
-fi 
+fi
 echo "Building MKLDNN ..." >&2
 cd $MXNET_ROOTDIR
g++ --version >&2
@@ -102,7 +102,7 @@ if [ ! -f $MKLDNN_LIBFILE ]; then
 else
   >&2 echo "Can't discover number of cores."
 fi
-make -C $MKLDNN_BUILDDIR -j$(NUM_PROC) VERBOSE=1 >&2
+make -C $MKLDNN_BUILDDIR -j${NUM_PROC} VERBOSE=1 >&2
 
 make -C $MKLDNN_BUILDDIR install >&2
 rm -rf $MKLDNN_BUILDDIR
@@ -114,7 +114,7 @@ fi
 MKLDNNROOT=$MKLDNN_INSTALLDIR
 fi
 
-if [ -z $MKLROOT ] && [ -f $MKLDNNROOT/include/mkl_cblas.h ]; then 
+if [ -z $MKLROOT ] && [ -f $MKLDNNROOT/include/mkl_cblas.h ]; then
   MKLROOT=$MKLDNNROOT;
 fi
 


 


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: fix nproc arg (#10404)

2018-04-04 Thread skm
This is an automated email from the ASF dual-hosted git repository.

skm 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 44f4ebd  fix nproc arg (#10404)
44f4ebd is described below

commit 44f4ebd5f49ad19f82f698a7e3411998ba6947ff
Author: jesterhazy 
AuthorDate: Wed Apr 4 15:00:12 2018 -0700

fix nproc arg (#10404)
---
 prepare_mkldnn.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/prepare_mkldnn.sh b/prepare_mkldnn.sh
index df5e9b9..828cfe1 100755
--- a/prepare_mkldnn.sh
+++ b/prepare_mkldnn.sh
@@ -89,7 +89,7 @@ if [ ! -f $MKLDNN_LIBFILE ]; then
 if [ -z $MKLROOT ] && [ ! -f $MKLDNN_INSTALLDIR/include/mkl_cblas.h ]; then
 rm -rf external && cd scripts && ./prepare_mkl.sh >&2 && cd ..
 cp -a external/*/* $MKLDNN_INSTALLDIR/.
-fi 
+fi
 echo "Building MKLDNN ..." >&2
 cd $MXNET_ROOTDIR
g++ --version >&2
@@ -102,7 +102,7 @@ if [ ! -f $MKLDNN_LIBFILE ]; then
 else
   >&2 echo "Can't discover number of cores."
 fi
-make -C $MKLDNN_BUILDDIR -j$(NUM_PROC) VERBOSE=1 >&2
+make -C $MKLDNN_BUILDDIR -j${NUM_PROC} VERBOSE=1 >&2
 
 make -C $MKLDNN_BUILDDIR install >&2
 rm -rf $MKLDNN_BUILDDIR
@@ -114,7 +114,7 @@ fi
 MKLDNNROOT=$MKLDNN_INSTALLDIR
 fi
 
-if [ -z $MKLROOT ] && [ -f $MKLDNNROOT/include/mkl_cblas.h ]; then 
+if [ -z $MKLROOT ] && [ -f $MKLDNNROOT/include/mkl_cblas.h ]; then
   MKLROOT=$MKLDNNROOT;
 fi
 

-- 
To stop receiving notification emails like this one, please contact
s...@apache.org.


[GitHub] cjolivier01 closed pull request #10232: [MXNET-136] Enabling USE_DIST_KVSTORE flag for CI

2018-04-04 Thread GitBox
cjolivier01 closed pull request #10232: [MXNET-136] Enabling USE_DIST_KVSTORE 
flag for CI
URL: https://github.com/apache/incubator-mxnet/pull/10232
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/3rdparty/ps-lite b/3rdparty/ps-lite
index aee325276bc..a6dda54604a 16
--- a/3rdparty/ps-lite
+++ b/3rdparty/ps-lite
@@ -1 +1 @@
-Subproject commit aee325276bccb092f516df0bce30d3a8333f4038
+Subproject commit a6dda54604a07d1fb21b016ed1e3f4246b08222a
diff --git a/Jenkinsfile b/Jenkinsfile
index 45b86fbdafe..3892906b45a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -22,6 +22,8 @@
 
 // mxnet libraries
 mx_lib = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 
3rdparty/nnvm/lib/libnnvm.a'
+// for scala build, need to pass extra libs when run with dist_kvstore
+mx_dist_lib = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 
3rdparty/nnvm/lib/libnnvm.a, 3rdparty/ps-lite/build/libps.a, 
deps/lib/libprotobuf-lite.a, deps/lib/libzmq.a'
 // mxnet cmake libraries, in cmake builds we do not produce a libnvvm static 
library by default.
 mx_cmake_lib = 'build/libmxnet.so, build/libmxnet.a, 
build/3rdparty/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, 
build/3rdparty/openmp/runtime/src/libomp.so'
 mx_cmake_mkldnn_lib = 'build/libmxnet.so, build/libmxnet.a, 
build/3rdparty/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, 
build/3rdparty/openmp/runtime/src/libomp.so, 
build/3rdparty/mkldnn/src/libmkldnn.so, 
build/3rdparty/mkldnn/src/libmkldnn.so.0'
@@ -164,7 +166,7 @@ try {
 ws('workspace/build-cpu-openblas') {
   init_git()
   sh "ci/build.py --platform ubuntu_cpu /work/runtime_functions.sh 
build_ubuntu_cpu_openblas"
-  pack_lib('cpu')
+  pack_lib('cpu', mx_dist_lib)
 }
   }
 },
@@ -224,8 +226,8 @@ try {
   node('mxnetlinux-cpu') {
 ws('workspace/build-gpu') {
   init_git()
-  sh "ci/build.py --platform ubuntu_build_cuda 
/work/runtime_functions.sh build_ubuntu_gpu_cuda91_cudnn7" 
-  pack_lib('gpu')
+  sh "ci/build.py --platform ubuntu_build_cuda 
/work/runtime_functions.sh build_ubuntu_gpu_cuda91_cudnn7"
+  pack_lib('gpu', mx_dist_lib)
   stash includes: 'build/cpp-package/example/test_score', name: 
'cpp_test_score'
   stash includes: 'build/cpp-package/example/test_optimizer', name: 
'cpp_test_optimizer'
 }
@@ -475,7 +477,7 @@ try {
   node('mxnetlinux-cpu') {
 ws('workspace/ut-scala-cpu') {
   init_git()
-  unpack_lib('cpu')
+  unpack_lib('cpu', mx_dist_lib)
   timeout(time: max_time, unit: 'MINUTES') {
 sh "ci/build.py --platform ubuntu_cpu /work/runtime_functions.sh 
unittest_ubuntu_cpu_scala"
   }
@@ -486,7 +488,7 @@ try {
   node('mxnetlinux-gpu') {
 ws('workspace/ut-scala-gpu') {
   init_git()
-  unpack_lib('gpu')
+  unpack_lib('gpu', mx_dist_lib)
   timeout(time: max_time, unit: 'MINUTES') {
 sh "ci/build.py --nvidiadocker --platform ubuntu_gpu 
/work/runtime_functions.sh unittest_ubuntu_gpu_scala"
   }
diff --git a/ci/docker/install/ubuntu_core.sh b/ci/docker/install/ubuntu_core.sh
index dc9b091f205..f588d06ab57 100755
--- a/ci/docker/install/ubuntu_core.sh
+++ b/ci/docker/install/ubuntu_core.sh
@@ -33,6 +33,7 @@ apt-get install -y \
 wget \
 unzip \
 sudo \
+libzmq3-dev \
 software-properties-common \
 ninja-build
 
diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index 3d58f344a33..a97f6b92af0 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -131,6 +131,7 @@ build_amzn_linux_cpu() {
 -DCMAKE_BUILD_TYPE=RelWithDebInfo\
 -DUSE_MKL_IF_AVAILABLE=OFF\
 -DUSE_LAPACK=OFF\
+-DUSE_DIST_KVSTORE=ON\
 -G Ninja /work/mxnet
 ninja
 export MXNET_LIBRARY_PATH=`pwd`/libmxnet.so
@@ -180,6 +181,7 @@ build_centos7_cpu() {
 USE_LAPACK=1 \
 USE_LAPACK_PATH=/usr/lib64/liblapack.so \
 USE_BLAS=openblas \
+USE_DIST_KVSTORE=1 \
 -j$(nproc)
 }
 
@@ -206,6 +208,7 @@ build_centos7_gpu() {
 USE_CUDA=1 \
 USE_CUDA_PATH=/usr/local/cuda \
 USE_CUDNN=1 \
+USE_DIST_KVSTORE=1 \
 -j$(nproc)
 }
 
@@ -215,6 +218,7 @@ build_ubuntu_cpu_openblas() {
 DEV=1 \
 USE_CPP_PACKAGE=1 \
 USE_BLAS=openblas \
+USE_DIST_KVSTORE=1\
 -j$(nproc)
 }
 
@@ -224,6 +228,7 @@ build_ubuntu_cpu_clang39() {
 USE_CPP_PACKAGE=1 \
 USE_BLAS=openblas \
 USE_OPENMP=0  \
+  

[incubator-mxnet] branch master updated: [MXNET-136] Enabling USE_DIST_KVSTORE flag for CI (#10232)

2018-04-04 Thread cjolivier01
This is an automated email from the ASF dual-hosted git repository.

cjolivier01 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 f950702  [MXNET-136] Enabling USE_DIST_KVSTORE flag for CI (#10232)
f950702 is described below

commit f95070239e3b2b1722cfc29f6a1807965b861cdf
Author: Rahul Huilgol 
AuthorDate: Wed Apr 4 14:55:39 2018 -0700

[MXNET-136] Enabling USE_DIST_KVSTORE flag for CI (#10232)

* test dist_kvstore compilation for make

* add cmake functions

* install zmq

* update ps-lite

* fix scala build failure

* updating ps-lite

* stash more libs for scala link

* update ps-lite executable path
---
 3rdparty/ps-lite |  2 +-
 Jenkinsfile  | 12 +++-
 ci/docker/install/ubuntu_core.sh |  1 +
 ci/docker/runtime_functions.sh   | 16 
 4 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/3rdparty/ps-lite b/3rdparty/ps-lite
index aee3252..a6dda54 16
--- a/3rdparty/ps-lite
+++ b/3rdparty/ps-lite
@@ -1 +1 @@
-Subproject commit aee325276bccb092f516df0bce30d3a8333f4038
+Subproject commit a6dda54604a07d1fb21b016ed1e3f4246b08222a
diff --git a/Jenkinsfile b/Jenkinsfile
index 45b86fb..3892906 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -22,6 +22,8 @@
 
 // mxnet libraries
 mx_lib = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 
3rdparty/nnvm/lib/libnnvm.a'
+// for scala build, need to pass extra libs when run with dist_kvstore
+mx_dist_lib = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 
3rdparty/nnvm/lib/libnnvm.a, 3rdparty/ps-lite/build/libps.a, 
deps/lib/libprotobuf-lite.a, deps/lib/libzmq.a'
 // mxnet cmake libraries, in cmake builds we do not produce a libnvvm static 
library by default.
 mx_cmake_lib = 'build/libmxnet.so, build/libmxnet.a, 
build/3rdparty/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, 
build/3rdparty/openmp/runtime/src/libomp.so'
 mx_cmake_mkldnn_lib = 'build/libmxnet.so, build/libmxnet.a, 
build/3rdparty/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, 
build/3rdparty/openmp/runtime/src/libomp.so, 
build/3rdparty/mkldnn/src/libmkldnn.so, 
build/3rdparty/mkldnn/src/libmkldnn.so.0'
@@ -164,7 +166,7 @@ try {
 ws('workspace/build-cpu-openblas') {
   init_git()
   sh "ci/build.py --platform ubuntu_cpu /work/runtime_functions.sh 
build_ubuntu_cpu_openblas"
-  pack_lib('cpu')
+  pack_lib('cpu', mx_dist_lib)
 }
   }
 },
@@ -224,8 +226,8 @@ try {
   node('mxnetlinux-cpu') {
 ws('workspace/build-gpu') {
   init_git()
-  sh "ci/build.py --platform ubuntu_build_cuda 
/work/runtime_functions.sh build_ubuntu_gpu_cuda91_cudnn7" 
-  pack_lib('gpu')
+  sh "ci/build.py --platform ubuntu_build_cuda 
/work/runtime_functions.sh build_ubuntu_gpu_cuda91_cudnn7"
+  pack_lib('gpu', mx_dist_lib)
   stash includes: 'build/cpp-package/example/test_score', name: 
'cpp_test_score'
   stash includes: 'build/cpp-package/example/test_optimizer', name: 
'cpp_test_optimizer'
 }
@@ -475,7 +477,7 @@ try {
   node('mxnetlinux-cpu') {
 ws('workspace/ut-scala-cpu') {
   init_git()
-  unpack_lib('cpu')
+  unpack_lib('cpu', mx_dist_lib)
   timeout(time: max_time, unit: 'MINUTES') {
 sh "ci/build.py --platform ubuntu_cpu /work/runtime_functions.sh 
unittest_ubuntu_cpu_scala"
   }
@@ -486,7 +488,7 @@ try {
   node('mxnetlinux-gpu') {
 ws('workspace/ut-scala-gpu') {
   init_git()
-  unpack_lib('gpu')
+  unpack_lib('gpu', mx_dist_lib)
   timeout(time: max_time, unit: 'MINUTES') {
 sh "ci/build.py --nvidiadocker --platform ubuntu_gpu 
/work/runtime_functions.sh unittest_ubuntu_gpu_scala"
   }
diff --git a/ci/docker/install/ubuntu_core.sh b/ci/docker/install/ubuntu_core.sh
index dc9b091..f588d06 100755
--- a/ci/docker/install/ubuntu_core.sh
+++ b/ci/docker/install/ubuntu_core.sh
@@ -33,6 +33,7 @@ apt-get install -y \
 wget \
 unzip \
 sudo \
+libzmq3-dev \
 software-properties-common \
 ninja-build
 
diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index 3d58f34..a97f6b9 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -131,6 +131,7 @@ build_amzn_linux_cpu() {
 -DCMAKE_BUILD_TYPE=RelWithDebInfo\
 -DUSE_MKL_IF_AVAILABLE=OFF\
 -DUSE_LAPACK=OFF\
+-DUSE_DIST_KVSTORE=ON\
 -G Ninja /work/mxnet
 ninja
 export MXNET_LIBRARY_PATH=`pwd`/libmxnet.so
@@ -180,6 +181,7 @@ build_centos7_cpu() {
 USE_LAPACK=1 \
 USE_LAPACK_PATH=/usr/lib64/liblapack.so \
 USE_BLAS=openblas \
+

[GitHub] thomelane commented on issue #9909: mx.random.seed(seed) does not work for mx.io.ImageRecordIter() ?

2018-04-04 Thread GitBox
thomelane commented on issue #9909: mx.random.seed(seed) does not work for 
mx.io.ImageRecordIter() ?
URL: 
https://github.com/apache/incubator-mxnet/issues/9909#issuecomment-378755033
 
 
   @CoinCheung would you be able to show me where in the documentation you saw 
this? I'd like to change it so it doesn't catch out other users, but I couldn't 
see 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] staticfloat opened a new pull request #10407: Install jemalloc for armv7, don't use jemalloc on armv6

2018-04-04 Thread GitBox
staticfloat opened a new pull request #10407: Install jemalloc for armv7, don't 
use jemalloc on armv6
URL: https://github.com/apache/incubator-mxnet/pull/10407
 
 
   ## Description ##
   Docker CI builds fail due to lack of `libjemalloc.so` within the docker 
build environment.
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [X] Changes are complete (i.e. I finished coding on this PR)
   - [X] Code is well-documented: 
   - [X] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   
   ## Comments ##
   Note that this disables jemalloc on armv6 because I spent 5 minutes trying 
to build it for armv6, didn't like the look of the errors I was getting, then 
tried to install it via:
   
   ```
   dpkg --add-architecture armel
   apt update && apt install -y libjemalloc-dev:armel
   ```
   
   But that wanted to install the whole `gcc` base set of packages within the 
`armv6` cross-compiler docker image, and I didn't want to then have to fix the 
fact that the wrong compilers were getting installed within the docker image.  
If you want `libjemalloc` on armv6, you should probably do something like the 
above.


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 #10405: [MXNET-176] Support axis=None for sum operator

2018-04-04 Thread GitBox
eric-haibin-lin commented on issue #10405: [MXNET-176] Support axis=None for 
sum operator
URL: https://github.com/apache/incubator-mxnet/pull/10405#issuecomment-378751140
 
 
   I didn't look into the performance issue. We can track that as a separate 
issue since that touches the kernel implementation requires some performance 
testing.


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 #9949: Mac build from source script validation fails

2018-04-04 Thread GitBox
gautamkmr commented on issue #9949: Mac build from source script validation 
fails
URL: 
https://github.com/apache/incubator-mxnet/issues/9949#issuecomment-378749085
 
 
   So I am able to reproduce this issue mentioned  by Aaron
   
   
   However removing the dependency on numpy from setup.py and installing numpy 
version 1.9.2 worked fine
   
   
   Best match: certifi 2018.1.18
   Adding certifi 2018.1.18 to easy-install.pth file
   
   Using /Users/gauta/Library/Python/2.7/lib/python/site-packages
   Finished processing dependencies for mxnet==1.1.0
   f45c89a20de7:python gauta$ python 
   Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
   [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import mxnet
   
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/oldnumeric/__init__.py:11:
 ModuleDeprecationWarning: The oldnumeric module will be dropped in Numpy 1.9
 warnings.warn(_msg, ModuleDeprecationWarning)
   >>> mxnet.__version__
   '1.1.0'
   >>> 


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: [MXNET-266] Fix cudnn_conv and cudnn_deconv deadlock (#10392)

2018-04-04 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 f0f8af1  [MXNET-266] Fix cudnn_conv and cudnn_deconv deadlock (#10392)
f0f8af1 is described below

commit f0f8af1e193894ab21774f1ad8e06498c4c25ff8
Author: reminisce 
AuthorDate: Wed Apr 4 14:19:24 2018 -0700

[MXNET-266] Fix cudnn_conv and cudnn_deconv deadlock (#10392)

* Fix deadlock of cudnn_conv wrapper

* Fix deconv deadlock

* Fix lint

* Revert "Fix lint"

This reverts commit 66f0936de9822cd9ccd00038cb0c563cfaafcd64.

* Fix lint

* Fix indentation
---
 src/operator/nn/convolution.cu  |  36 +-
 src/operator/nn/cudnn/cudnn_convolution-inl.h   | 420 +++
 src/operator/nn/cudnn/cudnn_deconvolution-inl.h | 434 
 src/operator/nn/deconvolution.cc|   4 +
 src/operator/nn/deconvolution.cu|  14 +-
 tests/python/unittest/test_operator.py  |   9 +-
 6 files changed, 455 insertions(+), 462 deletions(-)

diff --git a/src/operator/nn/convolution.cu b/src/operator/nn/convolution.cu
index f6d14e3..045e570 100644
--- a/src/operator/nn/convolution.cu
+++ b/src/operator/nn/convolution.cu
@@ -36,10 +36,12 @@ namespace op {
 
 #if MXNET_USE_CUDNN == 1
 template
-static CuDNNConvolutionOp (const ConvolutionParam& param,
-int forward_compute_type, int backward_compute_type,
-const std::vector& in_shape, const std::vector& out_shape,
-const Context& ctx) {
+static CuDNNConvolutionOp& GetCuDNNConvOp(const ConvolutionParam& param,
+ int forward_compute_type,
+ int backward_compute_type,
+ const std::vector& 
in_shape,
+ const std::vector& 
out_shape,
+ const RunContext& rctx) {
 #if DMLC_CXX11_THREAD_LOCAL
   static thread_local std::unordered_map,
@@ -62,7 +64,7 @@ static CuDNNConvolutionOp (const 
ConvolutionParam& param,
   key.AddSign(backward_compute_type);
   key.AddSign(in_shape);
   key.AddSign(out_shape);
-  key.AddSign(ctx.dev_id);
+  key.AddSign(rctx.ctx.dev_id);
 
   auto it = ops.find(key);
   if (it == ops.end()) {
@@ -72,7 +74,7 @@ static CuDNNConvolutionOp (const 
ConvolutionParam& param,
 CHECK(ins_ret.second);
 it = ins_ret.first;
 it->second->Init(param, forward_compute_type, backward_compute_type, 
in_shape,
- out_shape, ctx);
+ out_shape, rctx);
   }
   return *it->second;
 }
@@ -80,9 +82,10 @@ static CuDNNConvolutionOp (const 
ConvolutionParam& param,
 
 template<>
 void ConvolutionCompute(const nnvm::NodeAttrs& attrs,
-const OpContext& ctx, const std::vector& inputs,
-const std::vector& req,
-const std::vector& outputs) {
+ const OpContext& ctx,
+ const std::vector& inputs,
+ const std::vector& req,
+ const std::vector& outputs) {
   const ConvolutionParam& param = nnvm::get(attrs.parsed);
   int dtype = inputs[conv::kData].type_flag_;
 
@@ -120,7 +123,7 @@ void ConvolutionCompute(const nnvm::NodeAttrs& attrs,
   op.Init(param);
   op.Forward(ctx, inputs, req, outputs);
 } else if (!CuDNNConvolutionOp::Supports(param,
-  compute_type, compute_type, ctx.run_ctx.ctx)) {
+  compute_type, compute_type, ctx.run_ctx.ctx.dev_id)) {
   LOG(WARNING) << "This convolution is not supported by cudnn, MXNET 
convolution is applied.";
   ConvolutionOp op;
   op.Init(param);
@@ -131,7 +134,7 @@ void ConvolutionCompute(const nnvm::NodeAttrs& attrs,
   for (size_t i = 0; i < in_shape.size(); i++)
 in_shape[i] = inputs[i].shape_;
   CuDNNConvolutionOp  = GetCuDNNConvOp(param,
-  compute_type, compute_type, in_shape, out_shape, ctx.run_ctx.ctx);
+  compute_type, compute_type, in_shape, out_shape, ctx.run_ctx);
   op.Forward(ctx, inputs, req, outputs);
 }
   })
@@ -146,9 +149,10 @@ void ConvolutionCompute(const nnvm::NodeAttrs& attrs,
 
 template<>
 void ConvolutionGradCompute(const nnvm::NodeAttrs& attrs,
-const OpContext& ctx, const std::vector& inputs,
-const std::vector& req,
-const std::vector& outputs) {
+ const OpContext& ctx,
+ const std::vector& inputs,
+ const std::vector& req,
+ const std::vector& outputs) {
   const ConvolutionParam& param = 

[GitHub] piiswrong closed pull request #10392: [MXNET-266] Fix cudnn_conv and cudnn_deconv deadlock

2018-04-04 Thread GitBox
piiswrong closed pull request #10392: [MXNET-266] Fix cudnn_conv and 
cudnn_deconv deadlock
URL: https://github.com/apache/incubator-mxnet/pull/10392
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/operator/nn/convolution.cu b/src/operator/nn/convolution.cu
index f6d14e3558b..045e570f9d8 100644
--- a/src/operator/nn/convolution.cu
+++ b/src/operator/nn/convolution.cu
@@ -36,10 +36,12 @@ namespace op {
 
 #if MXNET_USE_CUDNN == 1
 template
-static CuDNNConvolutionOp (const ConvolutionParam& param,
-int forward_compute_type, int backward_compute_type,
-const std::vector& in_shape, const std::vector& out_shape,
-const Context& ctx) {
+static CuDNNConvolutionOp& GetCuDNNConvOp(const ConvolutionParam& param,
+ int forward_compute_type,
+ int backward_compute_type,
+ const std::vector& 
in_shape,
+ const std::vector& 
out_shape,
+ const RunContext& rctx) {
 #if DMLC_CXX11_THREAD_LOCAL
   static thread_local std::unordered_map,
@@ -62,7 +64,7 @@ static CuDNNConvolutionOp (const 
ConvolutionParam& param,
   key.AddSign(backward_compute_type);
   key.AddSign(in_shape);
   key.AddSign(out_shape);
-  key.AddSign(ctx.dev_id);
+  key.AddSign(rctx.ctx.dev_id);
 
   auto it = ops.find(key);
   if (it == ops.end()) {
@@ -72,7 +74,7 @@ static CuDNNConvolutionOp (const 
ConvolutionParam& param,
 CHECK(ins_ret.second);
 it = ins_ret.first;
 it->second->Init(param, forward_compute_type, backward_compute_type, 
in_shape,
- out_shape, ctx);
+ out_shape, rctx);
   }
   return *it->second;
 }
@@ -80,9 +82,10 @@ static CuDNNConvolutionOp (const 
ConvolutionParam& param,
 
 template<>
 void ConvolutionCompute(const nnvm::NodeAttrs& attrs,
-const OpContext& ctx, const std::vector& inputs,
-const std::vector& req,
-const std::vector& outputs) {
+ const OpContext& ctx,
+ const std::vector& inputs,
+ const std::vector& req,
+ const std::vector& outputs) {
   const ConvolutionParam& param = nnvm::get(attrs.parsed);
   int dtype = inputs[conv::kData].type_flag_;
 
@@ -120,7 +123,7 @@ void ConvolutionCompute(const nnvm::NodeAttrs& attrs,
   op.Init(param);
   op.Forward(ctx, inputs, req, outputs);
 } else if (!CuDNNConvolutionOp::Supports(param,
-  compute_type, compute_type, ctx.run_ctx.ctx)) {
+  compute_type, compute_type, ctx.run_ctx.ctx.dev_id)) {
   LOG(WARNING) << "This convolution is not supported by cudnn, MXNET 
convolution is applied.";
   ConvolutionOp op;
   op.Init(param);
@@ -131,7 +134,7 @@ void ConvolutionCompute(const nnvm::NodeAttrs& attrs,
   for (size_t i = 0; i < in_shape.size(); i++)
 in_shape[i] = inputs[i].shape_;
   CuDNNConvolutionOp  = GetCuDNNConvOp(param,
-  compute_type, compute_type, in_shape, out_shape, ctx.run_ctx.ctx);
+  compute_type, compute_type, in_shape, out_shape, ctx.run_ctx);
   op.Forward(ctx, inputs, req, outputs);
 }
   })
@@ -146,9 +149,10 @@ void ConvolutionCompute(const nnvm::NodeAttrs& attrs,
 
 template<>
 void ConvolutionGradCompute(const nnvm::NodeAttrs& attrs,
-const OpContext& ctx, const std::vector& inputs,
-const std::vector& req,
-const std::vector& outputs) {
+ const OpContext& ctx,
+ const std::vector& inputs,
+ const std::vector& req,
+ const std::vector& outputs) {
   const ConvolutionParam& param = nnvm::get(attrs.parsed);
   std::vector in_data(inputs.begin() + 1, inputs.end());
   const TBlob _grad = inputs[0];
@@ -190,7 +194,7 @@ void ConvolutionGradCompute(const nnvm::NodeAttrs& 
attrs,
   op.Init(param);
   op.Backward(ctx, std::vector{out_grad}, in_data, req, in_grad);
 } else if (!CuDNNConvolutionOp::Supports(param,
-  compute_type, compute_type, ctx.run_ctx.ctx)) {
+  compute_type, compute_type, ctx.run_ctx.ctx.dev_id)) {
   LOG(WARNING) << "This convolution is not supported by cudnn, MXNET 
convolution is applied.";
   ConvolutionOp op;
   op.Init(param);
@@ -202,7 +206,7 @@ void ConvolutionGradCompute(const nnvm::NodeAttrs& 
attrs,
   for (size_t i = 0; i < in_shape.size(); i++)
 in_shape[i] = in_data[i].shape_;
   

[GitHub] eric-haibin-lin commented on a change in pull request #10405: [MXNET-176] Support axis=None for sum operator

2018-04-04 Thread GitBox
eric-haibin-lin commented on a change in pull request #10405: [MXNET-176] 
Support axis=None for sum operator
URL: https://github.com/apache/incubator-mxnet/pull/10405#discussion_r179285556
 
 

 ##
 File path: src/operator/tensor/square_sum-inl.h
 ##
 @@ -53,13 +53,15 @@ inline bool SquareSumForwardInferStorageType(const 
nnvm::NodeAttrs& attrs,
   const auto& in_stype = in_attrs->at(0);
   auto& out_stype = out_attrs->at(0);
   bool dispatched = false;
-  if (!dispatched && in_stype == kRowSparseStorage && param.axis[0] == 1 && 
param.keepdims) {
+  const TShape axis = param.axis.has_value() ? param.axis.value() : TShape();
+  if (!dispatched && in_stype == kRowSparseStorage &&
+  axis.ndim() > 0 && axis[0] == 1 && param.keepdims) {
 // sum per row and keep dims
 dispatched = storage_type_assign(_stype, kRowSparseStorage,
  dispatch_mode, DispatchMode::kFComputeEx);
   }
-  if (!dispatched && in_stype == kRowSparseStorage &&
-  (param.axis[0] == 0 || (param.axis[0] == 1 && !param.keepdims))) {
+  if (!dispatched && in_stype == kRowSparseStorage && axis.ndim() > 0 &&
 
 Review comment:
   I added extra check to make sure `axis != TShape()` when accessing axis[0] 
@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] piiswrong commented on issue #10405: [MXNET-176] Support axis=None for sum operator

2018-04-04 Thread GitBox
piiswrong commented on issue #10405: [MXNET-176] Support axis=None for sum 
operator
URL: https://github.com/apache/incubator-mxnet/pull/10405#issuecomment-378747700
 
 
   Looks like you are faking global reduce with reshaping? This is very slow. 
consider writing proper global reduce


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 opened a new issue #10406: Flaky test - test_gluon_data.test_datasets

2018-04-04 Thread GitBox
anirudh2290 opened a new issue #10406: Flaky test - 
test_gluon_data.test_datasets
URL: https://github.com/apache/incubator-mxnet/issues/10406
 
 
   ```
   ==
   
   ERROR: test_gluon_data.test_datasets
   
   --
   
   Traceback (most recent call last):
   
 File "C:\Anaconda3\envs\py2\lib\site-packages\nose\case.py", line 197, in 
runTest
   
   self.test(*self.arg)
   
 File 
"C:\jenkins_slave\workspace\ut-python-gpu\tests\python\unittest\common.py", 
line 157, in test_new
   
   orig_test(*args, **kwargs)
   
 File 
"C:\jenkins_slave\workspace\ut-python-gpu\tests\python\unittest\test_gluon_data.py",
 line 94, in test_datasets
   
   assert len(gluon.data.vision.CIFAR10(root='data/cifar10')) == 5
   
 File 
"C:\jenkins_slave\workspace\ut-python-gpu\pkg_vc14_gpu\python\mxnet\gluon\data\vision\datasets.py",
 line 159, in __init__
   
   super(CIFAR10, self).__init__(root, transform)
   
 File 
"C:\jenkins_slave\workspace\ut-python-gpu\pkg_vc14_gpu\python\mxnet\gluon\data\dataset.py",
 line 197, in __init__
   
   self._get_data()
   
 File 
"C:\jenkins_slave\workspace\ut-python-gpu\pkg_vc14_gpu\python\mxnet\gluon\data\vision\datasets.py",
 line 175, in _get_data
   
   sha1_hash=self._archive_file[1])
   
 File 
"C:\jenkins_slave\workspace\ut-python-gpu\pkg_vc14_gpu\python\mxnet\gluon\utils.py",
 line 220, in download
   
   'the default repo.'.format(fname))
   
   UserWarning: File data/cifar10\cifar-10-binary.tar.gz is downloaded but the 
content hash does not match. The repo may be outdated or download may be 
incomplete. If the "repo_url" is overridden, consider switching to the default 
repo.
   
    >> begin captured stdout << -
   
   Downloading data/mnist\train-images-idx3-ubyte.gz from 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/mnist/train-images-idx3-ubyte.gz...
   
   Downloading data/mnist\train-labels-idx1-ubyte.gz from 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/mnist/train-labels-idx1-ubyte.gz...
   
   Downloading data/mnist\t10k-images-idx3-ubyte.gz from 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/mnist/t10k-images-idx3-ubyte.gz...
   
   Downloading data/mnist\t10k-labels-idx1-ubyte.gz from 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/mnist/t10k-labels-idx1-ubyte.gz...
   
   Downloading data/fashion-mnist\train-images-idx3-ubyte.gz from 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-images-idx3-ubyte.gz...
   
   Downloading data/fashion-mnist\train-labels-idx1-ubyte.gz from 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz...
   
   Downloading data/fashion-mnist\t10k-images-idx3-ubyte.gz from 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/t10k-images-idx3-ubyte.gz...
   
   Downloading data/fashion-mnist\t10k-labels-idx1-ubyte.gz from 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/t10k-labels-idx1-ubyte.gz...
   
   Downloading data/cifar10\cifar-10-binary.tar.gz from 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/cifar10/cifar-10-binary.tar.gz...
   
   
   
   - >> end captured stdout << --
   
    >> begin captured logging << 
   
   requests.packages.urllib3.connectionpool: DEBUG: Starting new HTTPS 
connection (1): apache-mxnet.s3-accelerate.dualstack.amazonaws.com
   
   requests.packages.urllib3.connectionpool: DEBUG: 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com:443 "GET 
/gluon/dataset/mnist/train-images-idx3-ubyte.gz HTTP/1.1" 200 9912422
   
   requests.packages.urllib3.connectionpool: DEBUG: Starting new HTTPS 
connection (1): apache-mxnet.s3-accelerate.dualstack.amazonaws.com
   
   requests.packages.urllib3.connectionpool: DEBUG: 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com:443 "GET 
/gluon/dataset/mnist/train-labels-idx1-ubyte.gz HTTP/1.1" 200 28881
   
   requests.packages.urllib3.connectionpool: DEBUG: Starting new HTTPS 
connection (1): apache-mxnet.s3-accelerate.dualstack.amazonaws.com
   
   requests.packages.urllib3.connectionpool: DEBUG: 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com:443 "GET 
/gluon/dataset/mnist/t10k-images-idx3-ubyte.gz HTTP/1.1" 200 1648877
   
   requests.packages.urllib3.connectionpool: DEBUG: Starting new HTTPS 
connection (1): apache-mxnet.s3-accelerate.dualstack.amazonaws.com
   
   requests.packages.urllib3.connectionpool: DEBUG: 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com:443 "GET 
/gluon/dataset/mnist/t10k-labels-idx1-ubyte.gz 

[GitHub] eric-haibin-lin commented on issue #10041: Reduce operators do not support axis=None

2018-04-04 Thread GitBox
eric-haibin-lin commented on issue #10041: Reduce operators do not support 
axis=None
URL: 
https://github.com/apache/incubator-mxnet/issues/10041#issuecomment-378744083
 
 
   https://github.com/apache/incubator-mxnet/pull/10405 


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] mbaijal commented on a change in pull request #10390: [WIP] Initial PR for RAT License Check

2018-04-04 Thread GitBox
mbaijal commented on a change in pull request #10390: [WIP] Initial PR for RAT 
License Check 
URL: https://github.com/apache/incubator-mxnet/pull/10390#discussion_r179268483
 
 

 ##
 File path: tests/nightly/apache_rat_license_check/.rat-excludes
 ##
 @@ -0,0 +1,54 @@
+.*xml
+\..*
+.*css
+\\.*
+.*ipynb
+.*html
+.*json
+.*js
+.*txt
+.*md
+3rdparty/*
+R-package/*
+src/operator/mkl/*
+trunk/*
+docker/*
+docker_multiarch/*
+.*\\.m
+.*\\.mk
+.*\\.R
+contrib/*
+Dockerfile*
+.*svg
+.*cfg
+.*config
+docs/*
+__init__.py
+build/*
+.*\\.t
+perl-package/*
 
 Review comment:
   Yea, these are packages I am not sure about the licensing, I have added 
details here - 
   https://cwiki.apache.org/confluence/display/MXNET/MXNet+Source+Licenses


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] rahul003 commented on issue #10232: [MXNET-136] Enabling USE_DIST_KVSTORE flag for CI

2018-04-04 Thread GitBox
rahul003 commented on issue #10232: [MXNET-136] Enabling USE_DIST_KVSTORE flag 
for CI
URL: https://github.com/apache/incubator-mxnet/pull/10232#issuecomment-378726983
 
 
   @marcoabreu This is ready to be merged!


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] jesterhazy opened a new pull request #10404: fix nproc arg

2018-04-04 Thread GitBox
jesterhazy opened a new pull request #10404: fix nproc arg
URL: https://github.com/apache/incubator-mxnet/pull/10404
 
 
   ## Description ##
   
   fix nproc arg to make
   
   current version causes error:
   
   `./prepare_mkldnn.sh: line 105: NUM_PROC: command not found`
   
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [x] Changes are complete (i.e. I finished coding on this PR)
   - [x] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   


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 opened a new issue #10403: Flaky test - ONNX

2018-04-04 Thread GitBox
anirudh2290 opened a new issue #10403: Flaky test - ONNX
URL: https://github.com/apache/incubator-mxnet/issues/10403
 
 
   ```
   
   
   @contextmanager
   
   def _error_catcher(self):
   
   """
   
   Catch low-level python exceptions, instead re-raising urllib3
   
   variants, so that low-level exceptions are not leaked in the
   
   high-level api.
   
   
   
   On exit, release the connection back to the pool.
   
   """
   
   clean_exit = False
   
   
   
   try:
   
   try:
   
   yield
   
   
   
   except SocketTimeout:
   
   # FIXME: Ideally we'd like to include the url in the 
ReadTimeoutError but
   
   # there is yet no clean way to get at it from this context.
   
   raise ReadTimeoutError(self._pool, None, 'Read timed out.')
   
   
   
   except BaseSSLError as e:
   
   # FIXME: Is there a better way to differentiate between 
SSLErrors?
   
   if 'read operation timed out' not in str(e):  # Defensive:
   
   # This shouldn't happen but just in case we're missing 
an edge
   
   # case, let's avoid swallowing SSL errors.
   
   raise
   
   
   
   raise ReadTimeoutError(self._pool, None, 'Read timed out.')
   
   
   
   except (HTTPException, SocketError) as e:
   
   # This includes IncompleteRead.
   
   >   raise ProtocolError('Connection broken: %r' % e, e)
   
   E   urllib3.exceptions.ProtocolError: ("Connection broken: 
ConnectionResetError(104, 'Connection reset by peer')", 
ConnectionResetError(104, 'Connection reset by peer'))
   
   
   
   /usr/local/lib/python3.5/dist-packages/urllib3/response.py:320: ProtocolError
   
   
   
   During handling of the above exception, another exception occurred:
   
   
   
   def test_bvlc_rcnn_ilsvrc13():
   
   """Tests the bvlc rcnn model"""
   
   >   model_path, inputs, outputs = 
get_test_files('bvlc_reference_rcnn_ilsvrc13')
   
   
   
   tests/python-pytest/onnx/onnx_test.py:232: 
   
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ 
   
   tests/python-pytest/onnx/onnx_test.py:155: in get_test_files
   
   tar_name = download(URLS.get(name), dirname=CURR_PATH.__str__())
   
   python/mxnet/test_utils.py:1417: in download
   
   for chunk in r.iter_content(chunk_size=1024):
   
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ 
   
   
   
   def generate():
   
   # Special case for urllib3.
   
   if hasattr(self.raw, 'stream'):
   
   try:
   
   for chunk in self.raw.stream(chunk_size, 
decode_content=True):
   
   yield chunk
   
   except ProtocolError as e:
   
   >   raise ChunkedEncodingError(e)
   
   E   requests.exceptions.ChunkedEncodingError: ("Connection 
broken: ConnectionResetError(104, 'Connection reset by peer')", 
ConnectionResetError(104, 'Connection reset by peer'))
   
   
   
   /usr/local/lib/python3.5/dist-packages/requests/models.py:748: 
ChunkedEncodingError
   
   = 1 failed, 9 passed in 350.06 seconds 
=
   
   build.py: 2018-04-04 19:36:41,846 Running of command in container failed 
(1): docker run --rm -v /home/jenkins_slave/workspace/it-onnx-cpu:/work/mxnet 
-v /home/jenkins_slave/workspace/it-onnx-cpu/build:/work/build -u 1001:1001 
mxnet/build.ubuntu_cpu /work/runtime_functions.sh 
integrationtest_ubuntu_cpu_onnx
   
   build.py: 2018-04-04 19:36:41,846 You can try to get into the container by 
using the following command: docker run --rm -v 
/home/jenkins_slave/workspace/it-onnx-cpu:/work/mxnet -v 
/home/jenkins_slave/workspace/it-onnx-cpu/build:/work/build -u 1001:1001 -ti 
--entrypoint /bin/bash mxnet/build.ubuntu_cpu /work/runtime_functions.sh 
integrationtest_ubuntu_cpu_onnx
   
   into container: False
   
   Traceback (most recent call last):
   
 File "ci/build.py", line 253, in 
   
   sys.exit(main())
   
 File "ci/build.py", line 193, in main
   
   container_run(platform, docker_binary, command)
   
 File "ci/build.py", line 119, in container_run
   
   raise subprocess.CalledProcessError(ret, cmd)
   
   subprocess.CalledProcessError: Command 'docker run --rm -v 
/home/jenkins_slave/workspace/it-onnx-cpu:/work/mxnet -v 
/home/jenkins_slave/workspace/it-onnx-cpu/build:/work/build -u 1001:1001 
mxnet/build.ubuntu_cpu /work/runtime_functions.sh 
integrationtest_ubuntu_cpu_onnx' returned non-zero exit status 1
   
   script returned exit code 1
   ```
   
   Please see: 

[GitHub] szhengac commented on issue #10388: [MXNET-265] Update optimizer doc to clarify wd behaviors

2018-04-04 Thread GitBox
szhengac commented on issue #10388: [MXNET-265] Update optimizer doc to clarify 
wd behaviors
URL: https://github.com/apache/incubator-mxnet/pull/10388#issuecomment-378714141
 
 
   I found the following line rescales the gradient outside the clipping 
function. This is inconsistent with other optimizers. 
   
   
https://github.com/eric-haibin-lin/mxnet/blob/90bb058bccb35df63366057d0538fb411f2f5151/python/mxnet/optimizer.py#L440


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] szhengac commented on a change in pull request #10388: [MXNET-265] Update optimizer doc to clarify wd behaviors

2018-04-04 Thread GitBox
szhengac commented on a change in pull request #10388: [MXNET-265] Update 
optimizer doc to clarify wd behaviors
URL: https://github.com/apache/incubator-mxnet/pull/10388#discussion_r179251532
 
 

 ##
 File path: python/mxnet/optimizer.py
 ##
 @@ -1210,6 +1210,15 @@ class AdaDelta(Optimizer):
 This class implements AdaDelta, an optimizer described in  *ADADELTA: An 
adaptive
 learning rate method*, available at https://arxiv.org/abs/1212.5701.
 
+This optimizer updates each weight by::
+
+grad = clip(grad * rescale_grad, clip_gradient)
+acc_grad = rho * acc_grad + (1. - rho) * grad * grad
+delta = sqrt(acc_delta + epsilon) / sqrt(acc_grad + epsilon) * grad
+acc_delta = rho * acc_delta + (1. - rho) * delta * delta
+weight -= delta + wd * weight
 
 Review comment:
   See my comment for Adagrad


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] szhengac commented on a change in pull request #10388: [MXNET-265] Update optimizer doc to clarify wd behaviors

2018-04-04 Thread GitBox
szhengac commented on a change in pull request #10388: [MXNET-265] Update 
optimizer doc to clarify wd behaviors
URL: https://github.com/apache/incubator-mxnet/pull/10388#discussion_r179251962
 
 

 ##
 File path: python/mxnet/optimizer.py
 ##
 @@ -1076,6 +1076,13 @@ class AdaGrad(Optimizer):
 Methods for Online Learning and Stochastic Optimization*, and available at
 http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf.
 
+This optimizer updates each weight by::
+
+grad = clip(grad * rescale_grad, clip_gradient)
+history += square(grad)
+div = grad / sqrt(history + float_stable_eps)
+weight += (div + weight * wd) * -lr
 
 Review comment:
   This step is problematic. For Adagrad, the stpesize is generally much 
smaller than the one for SGD, but here you separate the gradient of l2 norm 
from the div. This can make the training slow if we use a small stepwise, vice 
versa, a large stepwise can lead to divergence.


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   >