KEMBAR78
update the pytorch-gdb example so that it works on current master by antocuni · Pull Request #61175 · pytorch/pytorch · GitHub
Skip to content

Conversation

@antocuni
Copy link
Contributor

@antocuni antocuni commented Jul 2, 2021

As pointed out by #54339 (comment), the pytorch-gdb example is currently broken because the code has been refactored.

This PR updates the example so that it works again.

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jul 2, 2021

💊 CI failures summary and remediations

As of commit 8997c3e (more details on the Dr. CI page and at hud.pytorch.org/pr/61175):


  • 2/2 failures introduced in this PR

🕵️ 2 new failures recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_linux_bionic_cuda10_2_cudnn7_py3_9_gcc7_test2 (1/2)

Step: "Run tests" (full log | diagnosis details | 🔁 rerun)

Jul 02 15:24:29 AssertionError: False is not true : Scalars failed to compare as equal! 0 != 1
Jul 02 15:24:29   test_math_autogradcpu (__main__.TestPythonDispatcher) ... ok (0.001s)
Jul 02 15:24:29 
Jul 02 15:24:29 ======================================================================
Jul 02 15:24:29 FAIL [0.001s]: test_find_dangling_impls (__main__.TestPythonDispatcher)
Jul 02 15:24:29 ----------------------------------------------------------------------
Jul 02 15:24:29 Traceback (most recent call last):
Jul 02 15:24:29   File "/var/lib/jenkins/workspace/test/test_dispatch.py", line 891, in test_find_dangling_impls
Jul 02 15:24:29     self.assertEqual(0, len(C._dispatch_find_dangling_impls()))
Jul 02 15:24:29   File "/opt/conda/lib/python3.9/site-packages/torch/testing/_internal/common_utils.py", line 1498, in assertEqual
Jul 02 15:24:29     super().assertTrue(result, msg=self._get_assert_msg(msg, debug_msg=debug_msg))
Jul 02 15:24:29 AssertionError: False is not true : Scalars failed to compare as equal! 0 != 1
Jul 02 15:24:29 
Jul 02 15:24:29 ----------------------------------------------------------------------
Jul 02 15:24:29 Ran 29 tests in 20.466s
Jul 02 15:24:29 
Jul 02 15:24:29 FAILED (failures=1)
Jul 02 15:24:29 
Jul 02 15:24:29 Generating XML reports...
Jul 02 15:24:29 Generated XML report: test-reports/python-unittest/test_dispatch/TEST-TestDispatch-20210702152409.xml
Jul 02 15:24:29 Generated XML report: test-reports/python-unittest/test_dispatch/TEST-TestPythonDispatcher-20210702152409.xml
Jul 02 15:24:30 Traceback (most recent call last):

See CircleCI build pytorch_linux_xenial_cuda11_1_cudnn8_py3_gcc7_test1 (2/2)

Step: "Run tests" (full log | diagnosis details | 🔁 rerun)

Jul 02 15:31:14 AssertionError: False is not true : Scalars failed to compare as equal! 0 != 1
Jul 02 15:31:14   test_math_autogradcpu (__main__.TestPythonDispatcher) ... ok (0.001s)
Jul 02 15:31:14 
Jul 02 15:31:14 ======================================================================
Jul 02 15:31:14 FAIL [0.001s]: test_find_dangling_impls (__main__.TestPythonDispatcher)
Jul 02 15:31:14 ----------------------------------------------------------------------
Jul 02 15:31:14 Traceback (most recent call last):
Jul 02 15:31:14   File "test_dispatch.py", line 891, in test_find_dangling_impls
Jul 02 15:31:14     self.assertEqual(0, len(C._dispatch_find_dangling_impls()))
Jul 02 15:31:14   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 1498, in assertEqual
Jul 02 15:31:14     super().assertTrue(result, msg=self._get_assert_msg(msg, debug_msg=debug_msg))
Jul 02 15:31:14 AssertionError: False is not true : Scalars failed to compare as equal! 0 != 1
Jul 02 15:31:14 
Jul 02 15:31:14 ----------------------------------------------------------------------
Jul 02 15:31:14 Ran 29 tests in 24.449s
Jul 02 15:31:14 
Jul 02 15:31:14 FAILED (failures=1)
Jul 02 15:31:14 
Jul 02 15:31:14 Generating XML reports...
Jul 02 15:31:14 Generated XML report: test-reports/python-unittest/test_dispatch/TEST-TestDispatch-20210702153050.xml
Jul 02 15:31:14 Generated XML report: test-reports/python-unittest/test_dispatch/TEST-TestPythonDispatcher-20210702153050.xml
Jul 02 15:31:14 Traceback (most recent call last):

Preview docs built from this PR

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 to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@antocuni antocuni added the module: docs Related to our documentation, both in docs/ and docblocks label Jul 2, 2021
@wwwwcu
Copy link

wwwwcu commented Jul 5, 2021

Thank you for updating the pytorch-gdb example. But I meet this error. Did I miss some configurations?

(gdb) run 
Starting program: /root/anaconda3/envs/pytorch/bin/python 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[...]
>>> import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ww/pytorch/torch/__init__.py", line 208, in <module>
    from torch._C import _initExtension
ImportError: cannot import name '_initExtension'

and then I try to run the test_script by the following way, It gives me another error:

(gdb) r ../test_script/test.py
Starting program: /root/anaconda3/envs/pytorch/bin/python ../test_script/test.py
[Thread debugging using libthread_db enabled]
[...]
Breakpoint 1, at::Tensor::neg (this=0x7ffff7f06060) at /home/ww/pytorch/build/aten/src/ATen/core/TensorMethods.cpp:2437
2437	    static auto op = c10::Dispatcher::singleton()
(gdb) torch-tensor-repr this
Python Exception <class 'gdb.error'> Cannot resolve function tensor_repr to any overloaded instance: 
Error occurred in Python command: Cannot resolve function tensor_repr to any overloaded instance

I've added the following line to ~/.gdbinit

add-auto-load-safe-path /home/ww/pytorch/.gdbinit

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@ezyang merged this pull request in 93d98ec.

@YCB-1027
Copy link

Thank you for updating the pytorch-gdb example. But I meet this error. Did I miss some configurations?

(gdb) run 
Starting program: /root/anaconda3/envs/pytorch/bin/python 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[...]
>>> import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ww/pytorch/torch/__init__.py", line 208, in <module>
    from torch._C import _initExtension
ImportError: cannot import name '_initExtension'

and then I try to run the test_script by the following way, It gives me another error:

(gdb) r ../test_script/test.py
Starting program: /root/anaconda3/envs/pytorch/bin/python ../test_script/test.py
[Thread debugging using libthread_db enabled]
[...]
Breakpoint 1, at::Tensor::neg (this=0x7ffff7f06060) at /home/ww/pytorch/build/aten/src/ATen/core/TensorMethods.cpp:2437
2437	    static auto op = c10::Dispatcher::singleton()
(gdb) torch-tensor-repr this
Python Exception <class 'gdb.error'> Cannot resolve function tensor_repr to any overloaded instance: 
Error occurred in Python command: Cannot resolve function tensor_repr to any overloaded instance

I've added the following line to ~/.gdbinit

add-auto-load-safe-path /home/ww/pytorch/.gdbinit

I have also encountered this problem. Have you resolved it

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

Labels

cla signed Merged module: docs Related to our documentation, both in docs/ and docblocks open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants