You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/07/24 17:22:26 UTC

[GitHub] [incubator-mxnet] ChaiBapchya opened a new pull request #18784: added forward, backward test for linalg.gemm2

ChaiBapchya opened a new pull request #18784:
URL: https://github.com/apache/incubator-mxnet/pull/18784


   ## Description ##
   Related PR: https://github.com/apache/incubator-mxnet/pull/18718
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - [ ] Code is well-documented: 
   - [ ] To the best of my 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 to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] ChaiBapchya commented on pull request #18784: [1.x][LT] Add forward, backward test for linalg.gemm2

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on pull request #18784:
URL: https://github.com/apache/incubator-mxnet/pull/18784#issuecomment-664705005






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] ChaiBapchya commented on pull request #18784: [1.x][LT] Add forward, backward test for linalg.gemm2

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on pull request #18784:
URL: https://github.com/apache/incubator-mxnet/pull/18784#issuecomment-663775855


   Test results:
   ```
   python -m pytest -s --exitfirst --verbose tests/nightly/test_large_array.py::test_gemm2
   ==================================================== test session starts =====================================================
   platform linux -- Python 3.7.7, pytest-5.4.3, py-1.9.0, pluggy-0.13.1 -- /home/ubuntu/gemm2_test_venv/bin/python
   cachedir: .pytest_cache
   rootdir: /home/ubuntu/chai-mxnet
   collected 1 item
   
   tests/nightly/test_large_array.py::test_gemm2 [23:35:35] ../src/base.cc:84: Upgrade advisory: this mxnet has been built against cuDNN lib version 7501, which is older than the oldest version tested by CI (7600).  Set MXNET_CUDNN_LIB_CHECKING=0 to quiet this
   warning.
   PASSED
   
   ======================================================================================================================== warnings summary ========================================================================================================================
   /home/ubuntu/gemm2_test_venv/lib/python3.7/site-packages/nose/importer.py:12
     /home/ubuntu/gemm2_test_venv/lib/python3.7/site-packages/nose/importer.py:12: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
       from imp import find_module, load_module, acquire_lock, release_lock
   
   -- Docs: https://docs.pytest.org/en/latest/warnings.html
   ============================================================================================================ 1 passed, 1 warning in 192.18s (0:03:12) ============================================================================================================
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #18784: added forward, backward test for linalg.gemm2

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #18784:
URL: https://github.com/apache/incubator-mxnet/pull/18784#issuecomment-663645878


   Hey @ChaiBapchya , Thanks for submitting the PR 
   All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands: 
   - To trigger all jobs: @mxnet-bot run ci [all] 
   - To trigger specific jobs: @mxnet-bot run ci [job1, job2] 
   *** 
   **CI supported jobs**: [unix-gpu, sanity, windows-gpu, clang, windows-cpu, unix-cpu, centos-cpu, miscellaneous, centos-gpu, website, edge]
   *** 
   _Note_: 
    Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin. 
   All CI tests must pass before the PR can be merged. 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha merged pull request #18784: [1.x][LT] Add forward, backward test for linalg.gemm2

Posted by GitBox <gi...@apache.org>.
szha merged pull request #18784:
URL: https://github.com/apache/incubator-mxnet/pull/18784


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #18784: [1.x][LT] Add forward, backward test for linalg.gemm2

Posted by GitBox <gi...@apache.org>.
access2rohit commented on a change in pull request #18784:
URL: https://github.com/apache/incubator-mxnet/pull/18784#discussion_r460343210



##########
File path: tests/nightly/test_large_array.py
##########
@@ -1207,9 +1207,28 @@ def check_syrk_batch():
         assert A.grad[0,0,0] == 4
         assert_almost_equal(A.grad[1,0,0], nd.array([0.4]), rtol=1e-3, atol=1e-5)
 
+    def check_gemm2():
+        def run_gemm2(inp1,inp2):
+            inp1.attach_grad()
+            inp2.attach_grad()
+            with mx.autograd.record():
+                out = mx.nd.linalg.gemm2(inp1,inp2)
+            return inp1.grad, inp2.grad, out
+
+        inp1=mx.nd.ones(shape=(SMALL_Y, LARGE_X))
+        inp1[0][0]=0.1
+        inp2=mx.nd.ones(shape=(LARGE_X, SMALL_Y))
+        inp1_grad, inp2_grad, out= run_gemm2(inp1,inp2)
+        assert out.asnumpy()[0][0] == LARGE_X
+        out.backward()
+        assert inp1_grad.asnumpy()[0][0] == SMALL_Y
+        assert_almost_equal(inp2_grad.asnumpy()[0][0],49.1)
+

Review comment:
       output and gradient shape check ? I forgot to mention in other PRs :P
   Need to ask others to fix it in their next PRs too.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] ChaiBapchya commented on pull request #18784: [1.x][LT] Add forward, backward test for linalg.gemm2

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on pull request #18784:
URL: https://github.com/apache/incubator-mxnet/pull/18784#issuecomment-663703236


   @mxnet-label-bot add [pr-awaiting-review]


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] ChaiBapchya commented on a change in pull request #18784: [1.x][LT] Add forward, backward test for linalg.gemm2

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on a change in pull request #18784:
URL: https://github.com/apache/incubator-mxnet/pull/18784#discussion_r461134108



##########
File path: tests/nightly/test_large_array.py
##########
@@ -1207,9 +1207,28 @@ def check_syrk_batch():
         assert A.grad[0,0,0] == 4
         assert_almost_equal(A.grad[1,0,0], nd.array([0.4]), rtol=1e-3, atol=1e-5)
 
+    def check_gemm2():
+        def run_gemm2(inp1,inp2):
+            inp1.attach_grad()
+            inp2.attach_grad()
+            with mx.autograd.record():
+                out = mx.nd.linalg.gemm2(inp1,inp2)
+            return inp1.grad, inp2.grad, out
+
+        inp1=mx.nd.ones(shape=(SMALL_Y, LARGE_X))
+        inp1[0][0]=0.1
+        inp2=mx.nd.ones(shape=(LARGE_X, SMALL_Y))
+        inp1_grad, inp2_grad, out= run_gemm2(inp1,inp2)
+        assert out.asnumpy()[0][0] == LARGE_X
+        out.backward()
+        assert inp1_grad.asnumpy()[0][0] == SMALL_Y
+        assert_almost_equal(inp2_grad.asnumpy()[0][0],49.1)
+

Review comment:
       Added




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mseth10 commented on pull request #18784: [1.x][LT] Add forward, backward test for linalg.gemm2

Posted by GitBox <gi...@apache.org>.
mseth10 commented on pull request #18784:
URL: https://github.com/apache/incubator-mxnet/pull/18784#issuecomment-664608811


   @ChaiBapchya file conflicts need resolving


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org