Skip to content

Conversation

malfet
Copy link
Contributor

@malfet malfet commented Mar 20, 2020

Test Plan: CI + bin/test_jit --gtest_filter=JitTest.CustomOperators --gtest_repeat=2

@malfet malfet requested review from smessmer and suo March 20, 2020 18:29
@malfet malfet requested a review from apaszke as a code owner March 20, 2020 18:29
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Mar 20, 2020
@dr-ci
Copy link

dr-ci bot commented Mar 20, 2020

💊 CircleCI build failures summary and remediations

As of commit 09d452a (more details on the Dr. CI page):


  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following build failures do not appear to be due to upstream breakages (reran 1 job to discount flakiness):

See CircleCI build pytorch_linux_xenial_py3_6_gcc5_4_test (1/1)

Step: "Test" (full log | pattern match details) <confirmed not flaky by 2 failures>

Mar 26 01:32:58 AssertionError: 1 not less than or equal to 1e-05 :
Mar 26 01:32:58   File "test_quantization.py", line 1358, in test_per_tensor_dynamic_quant_observers 
Mar 26 01:32:58     min_side=1, max_side=10), 
Mar 26 01:32:58   File "/var/lib/jenkins/.local/lib/python3.6/site-packages/hypothesis/core.py", line 1116, in wrapped_test 
Mar 26 01:32:58     raise the_error_hypothesis_found 
Mar 26 01:32:58   File "test_quantization.py", line 1373, in test_per_tensor_dynamic_quant_observers 
Mar 26 01:32:58     self.assertEqual(ref[1], qparams[1]) 
Mar 26 01:32:58   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 795, in assertEqual 
Mar 26 01:32:58     allow_inf=allow_inf, exact_dtype=exact_dtype) 
Mar 26 01:32:58   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 915, in assertEqual 
Mar 26 01:32:58     super(TestCase, self).assertLessEqual(abs(x - y), prec, message) 
Mar 26 01:32:58 AssertionError: 1 not less than or equal to 1e-05 :  
Mar 26 01:32:58  
Mar 26 01:32:58 ---------------------------------------------------------------------- 
Mar 26 01:32:58 Ran 39 tests in 56.339s 
Mar 26 01:32:58  
Mar 26 01:32:58 FAILED (failures=1, skipped=2) 
Mar 26 01:32:58  
Mar 26 01:32:58 Generating XML reports... 
Mar 26 01:32:58 Generated XML report: test-reports/python-unittest/TEST-EagerModePostTrainingQuantTest-20200326013202.xml 
Mar 26 01:32:58 Generated XML report: test-reports/python-unittest/TEST-EagerModeQuantizationAwareTrainingTest-20200326013202.xml 
Mar 26 01:32:58 Generated XML report: test-reports/python-unittest/TEST-FunctionalModuleTest-20200326013202.xml 

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker.

See how this bot performed.

This comment has been revised 15 times.

@malfet malfet force-pushed the malfet/add-torch-jit-deregister-operator branch from 9187879 to 3ef65d2 Compare March 20, 2020 21:03
@malfet malfet requested a review from ezyang March 20, 2020 21:05
@malfet
Copy link
Contributor Author

malfet commented Mar 20, 2020

Modified diff to workaround global destructor order ambiguity issue.

@ezyang
Copy link
Contributor

ezyang commented Mar 23, 2020

This looks reasonable but you should get a review from someone who has actually touched this code before.

@bhosmer
Copy link

bhosmer commented Mar 23, 2020

cc @smessmer, how would this interact with c10/jit registry syncing via listener etc.?

@malfet malfet force-pushed the malfet/add-torch-jit-deregister-operator branch from 3ef65d2 to 821f3fd Compare March 25, 2020 03:10
Copy link
Contributor

@smessmer smessmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for implementing this, this has been long overdue.

cc @smessmer, how would this interact with c10/jit registry syncing via listener etc.?

That's the line I commented on. This should finally make c10 deregistrations work in a sound way (i.e. call through to also deregister the wrapper from JIT).

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malfet is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@bhosmer
Copy link

bhosmer commented Mar 25, 2020

That's the line I commented on. This should finally make c10 deregistrations work in a sound way (i.e. call through to also deregister the wrapper from JIT).

Yeah that's very cool :) also wanted to double check that c10 isn't depending on a critical way on the invariant that ops registered to the jit via listener are definitely present, given that this can be called unilaterally, but it sounds like we're not :)

@malfet malfet force-pushed the malfet/add-torch-jit-deregister-operator branch from 821f3fd to 4b5fce4 Compare March 25, 2020 23:45
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Test Plan: CI + `bin/test_jit --gtest_filter=JitTest.CustomOperators --gtest_repeat=2`
@malfet malfet force-pushed the malfet/add-torch-jit-deregister-operator branch from 4b5fce4 to 09d452a Compare March 25, 2020 23:59
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malfet is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@malfet malfet deleted the malfet/add-torch-jit-deregister-operator branch March 26, 2020 17:57
auto raw_ptr = listener.get();
listeners_.push_back(std::move(listener));
return RegistrationHandleRAII([this, raw_ptr] {
const auto& found_it = std::find_if(listeners_.begin(), listeners_.end(), [raw_ptr](auto& it) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of calling find() here, which could be slow, you could make listeners_ a std::list and just remember the iterator in the closure. std::list keeps iterators valid, so that's not an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do in follow up PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bin/test_jit --gtest_filter=JitTest.CustomOperators --gtest_repeat=2 fails

5 participants