pytorch
075d36d3 - [Dynamo] Fix nested function resume execution (#100426)

Commit
2 years ago
[Dynamo] Fix nested function resume execution (#100426) Fixes #99665 Let me explain the root cause using the unit test I added: * This bug is triggered when: * ```wrapped``` is a nested function. * ```wrapped``` is in another module which is different from the main function ```fn```. * There is a graph break inside of ```wrapped```. * The root cause is when resuming nested function, actually we are using the outermost function(```fn``` in my example)'s global variables, but ```wrapped``` calls ```inner_func``` which is not part of ```fn```'s globals, so we have to set correct globals when nested function resume execution. Pull Request resolved: https://github.com/pytorch/pytorch/pull/100426 Approved by: https://github.com/jansel
Author
Committer
Parents
  • .ci/pytorch
    • File
      test.sh
  • test
    • dynamo
      • File
        test_misc.py
      • File
        utils.py
    • jit
      • File
        test_tracer.py
    • File
      test_binary_ufuncs.py
    • File
      test_indexing.py
    • File
      test_native_functions.py
  • torch/_dynamo/variables
    • File
      functions.py