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/05/19 02:37:26 UTC
[GitHub] [incubator-mxnet] leezu opened a new pull request #18363: Fix reference cycle in gluon.Trainer
leezu opened a new pull request #18363:
URL: https://github.com/apache/incubator-mxnet/pull/18363
Fix reference cycle preventing reference-counting based deallocation of NDArrays due to gluon.Trainer.
cc @eric-haibin-lin
----------------------------------------------------------------
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] leezu commented on a change in pull request #18363: Fix reference cycle in gluon.Trainer
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #18363:
URL: https://github.com/apache/incubator-mxnet/pull/18363#discussion_r427640438
##########
File path: conftest.py
##########
@@ -229,3 +230,50 @@ def doctest(doctest_namespace):
logging.warning('Unable to import numpy/mxnet. Skipping conftest.')
import doctest
doctest.ELLIPSIS_MARKER = '-etc-'
+
+
+@pytest.fixture(scope='session')
+def mxnet_module():
+ import mxnet
+ return mxnet
+
+
+@pytest.fixture()
+# @pytest.fixture(autouse=True) # Fix all the bugs and mark this autouse=True
+def check_leak_ndarray(mxnet_module):
Review comment:
conftest is run for any pytest session started in the mxnet folder. But some of our tests (such as for website build) do not have mxnet present. So we can't just 'import mxnet' in the top of the file.
Instead, the mxnet_module is a pytest fixture that can be used to get mxnet module. It will only be run if the tests requests it (as here).
Autouse must be used to apply the check_leak_ndarray before and after every other mxnet test. Currently there are too many bugs, so we can't enable it. Later, when the bugs are fixed it can be enabled.
----------------------------------------------------------------
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] leezu commented on a change in pull request #18363: Fix reference cycle in gluon.Trainer
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #18363:
URL: https://github.com/apache/incubator-mxnet/pull/18363#discussion_r427640624
##########
File path: conftest.py
##########
@@ -229,3 +230,50 @@ def doctest(doctest_namespace):
logging.warning('Unable to import numpy/mxnet. Skipping conftest.')
import doctest
doctest.ELLIPSIS_MARKER = '-etc-'
+
+
+@pytest.fixture(scope='session')
+def mxnet_module():
+ import mxnet
+ return mxnet
+
+
+@pytest.fixture()
+# @pytest.fixture(autouse=True) # Fix all the bugs and mark this autouse=True
+def check_leak_ndarray(mxnet_module):
Review comment:
You can refer to https://docs.pytest.org/en/latest/fixture.html#autouse-fixtures-xunit-setup-on-steroids
----------------------------------------------------------------
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] eric-haibin-lin commented on a change in pull request #18363: Fix reference cycle in gluon.Trainer
Posted by GitBox <gi...@apache.org>.
eric-haibin-lin commented on a change in pull request #18363:
URL: https://github.com/apache/incubator-mxnet/pull/18363#discussion_r427594015
##########
File path: conftest.py
##########
@@ -229,3 +230,50 @@ def doctest(doctest_namespace):
logging.warning('Unable to import numpy/mxnet. Skipping conftest.')
import doctest
doctest.ELLIPSIS_MARKER = '-etc-'
+
+
+@pytest.fixture(scope='session')
+def mxnet_module():
+ import mxnet
+ return mxnet
+
+
+@pytest.fixture()
+# @pytest.fixture(autouse=True) # Fix all the bugs and mark this autouse=True
+def check_leak_ndarray(mxnet_module):
Review comment:
why do we intend to use autouse? the mxnet_module function does not seem to do much. How does it help here?
----------------------------------------------------------------
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 #18363: Fix reference cycle in gluon.Trainer
Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #18363:
URL: https://github.com/apache/incubator-mxnet/pull/18363#issuecomment-630542835
Hey @leezu , 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**: [centos-cpu, website, unix-gpu, clang, sanity, miscellaneous, windows-cpu, windows-gpu, centos-gpu, unix-cpu, 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] leezu merged pull request #18363: Fix reference cycle in gluon.Trainer
Posted by GitBox <gi...@apache.org>.
leezu merged pull request #18363:
URL: https://github.com/apache/incubator-mxnet/pull/18363
----------------------------------------------------------------
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