question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Assert based dynamo tests fail on Python 3.9: test_rewrite_assert_with_msg test_rewrite_assert_without_msg

See original GitHub issue

🐛 Describe the bug

===================================== short test summary info =====================================
FAILED test/dynamo/test_dynamic_shapes.py::DynamicShapesReproTests::test_rewrite_assert_with_msg_dynamic_shapes - torch._dynamo.exc.Unsupported: generic_jump TensorVariable()
FAILED test/dynamo/test_dynamic_shapes.py::DynamicShapesReproTests::test_rewrite_assert_without_msg_dynamic_shapes - torch._dynamo.exc.Unsupported: generic_jump TensorVariable()
FAILED test/dynamo/test_no_fake_tensors.py::NoFakeTensorsReproTests::test_rewrite_assert_with_msg_no_fake_tensors - torch._dynamo.exc.Unsupported: generic_jump TensorVariable()
FAILED test/dynamo/test_no_fake_tensors.py::NoFakeTensorsReproTests::test_rewrite_assert_without_msg_no_fake_tensors - torch._dynamo.exc.Unsupported: generic_jump TensorVariable()
FAILED test/dynamo/test_repros.py::ReproTests::test_rewrite_assert_with_msg - torch._dynamo.exc.Unsupported: generic_jump TensorVariable()
FAILED test/dynamo/test_repros.py::ReproTests::test_rewrite_assert_without_msg - torch._dynamo.exc.Unsupported: generic_jump TensorVariable()
FAILED test/dynamo/test_unspec.py::UnspecReproTests::test_batch_norm_act_unspec
FAILED test/dynamo/test_unspec.py::UnspecReproTests::test_rewrite_assert_with_msg_unspec - torch._dynamo.exc.Unsupported: generic_jump TensorVariable()
FAILED test/dynamo/test_unspec.py::UnspecReproTests::test_re

typical backtrace

  File "/data/users/ezyang/a/pytorch/torch/_dynamo/convert_frame.py", line 404, in _compile
    out_code = transform_code_object(code, transform)                             
  File "/data/users/ezyang/a/pytorch/torch/_dynamo/bytecode_transformation.py", line 341, in transf
orm_code_object                                  
    transformations(instructions, code_options)                                                    
  File "/data/users/ezyang/a/pytorch/torch/_dynamo/convert_frame.py", line 392, in transform
    tracer.run()                                                                                   
  File "/data/users/ezyang/a/pytorch/torch/_dynamo/symbolic_convert.py", line 1624, in run         
    super().run()                                                                                  
  File "/data/users/ezyang/a/pytorch/torch/_dynamo/symbolic_convert.py", line 490, in run
    and self.step()                                                                                
  File "/data/users/ezyang/a/pytorch/torch/_dynamo/symbolic_convert.py", line 460, in step         
    getattr(self, inst.opname)(inst)                                                               
  File "/data/users/ezyang/a/pytorch/torch/_dynamo/symbolic_convert.py", line 272, in inner            unimplemented(f"generic_jump {typestr(value)}")                                                
  File "/data/users/ezyang/a/pytorch/torch/_dynamo/exc.py", line 67, in unimplemented                  raise Unsupported(msg)                                                                         
torch._dynamo.exc.Unsupported: generic_jump TensorVariable()  

Error logs

No response

Minified repro

No response

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ezyangcommented, Nov 28, 2022

That’s nice sleuthing! It sounds to me like users may run into this in real code, so we should be able to analyze the pytest assert? Or maybe this only matters for export so whatever, we just need to turn off the pytest rewriting here.

0reactions
tugsbayasgalancommented, Nov 28, 2022

I saw this in fbcode and just turned off the pytest assert rewrite in fbcode as we don’t care about this in export. Maybe we can just turn off pytest assert rewrite? Because in other cases, my assert rewrite condition will fail anyways. The reason you see this error is because my assert rewrite wasn’t able to detect the assert statement so it was a no-op.

Read more comments on GitHub >

github_iconTop Results From Across the Web

unittest — Unit testing framework — Python 3.11.1 ...
This naming convention informs the test runner about which methods represent tests. The crux of each test is a call to assertEqual() to...
Read more >
test_bdb and test_distutils fail on installed Python 3.9, 3.10 ...
test_bdb and test_distutils fail on installed Python 3.9, 3.10 and 3.11 ... Based on this finding, I don't think there's anything that Setuptools...
Read more >
Python pytest mock fails with "assert None" for function call ...
The dynamo DB object is a global variable. So when the expected and actual inputs differ then it fails because of this, however...
Read more >
Assertion Tests | AWS CDK Workshop
Fine-Grained Assertion Tests # Create a test for the DynamoDB table # This section ... platform linux -- Python 3.9.6, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 ......
Read more >
Python's assert: Debug and Test Your Code Like a Pro
The assert statement takes care of raising this exception when the assertion condition fails. Additionally, you shouldn't attempt to handle ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found