pytorch/torch/_dynamo
Yanbo Liang 075d36d37f [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
2023-05-11 03:10:23 +00:00
..
backends [inductor] Move cpp wrapper trigger logic to inner_compile (#100611) 2023-05-08 15:24:02 +00:00
repro Add --offload-to-disk support to minifier (#100546) 2023-05-05 05:25:03 +00:00
variables [Dynamo] Fix nested function resume execution (#100426) 2023-05-11 03:10:23 +00:00
__init__.py summarize graph breaks (#100696) 2023-05-05 22:27:47 +00:00
allowed_functions.py Reland basic dynamo support for traceable collectives (#100476) 2023-05-04 04:25:35 +00:00
bytecode_analysis.py [dynamo 3.11] fix segfault when printing stack trace (#99934) 2023-05-09 22:12:45 +00:00
bytecode_transformation.py
codegen.py [dynamo][numpy] Add NumpyTensorVariable to translate ndarray attribute calls to tensor attributes (#95849) 2023-04-27 16:18:35 +00:00
comptime.py
config.py [dynamo] Hide guard_fail_hook behind a flag to improve cache lookup time (+10% DebertaV2) (#100590) 2023-05-04 18:52:21 +00:00
config_utils.py Do not use pickle to output config entries in repro scripts (#100354) 2023-05-02 11:44:01 +00:00
convert_frame.py Wrap more constraint violation cases to UserError (#100897) 2023-05-09 16:44:57 +00:00
debug_utils.py Misc accuracy improvements on minifier (#100447) 2023-05-04 02:51:26 +00:00
eval_frame.py Revert "fix specify_constraints's signature when exporting model (#100739)" 2023-05-09 21:42:35 +00:00
exc.py [exportdb] Change case ids to case names for UserErrors. (#100600) 2023-05-04 06:14:50 +00:00
external_utils.py
guards.py dynamic equality constraint (#99993) 2023-05-05 21:09:18 +00:00
hooks.py
logging.py
mutation_guard.py
output_graph.py summarize graph breaks (#100696) 2023-05-05 22:27:47 +00:00
profiler.py
replay_record.py
resume_execution.py
side_effects.py Ensure optimizer state references are cleared (#100282) 2023-05-01 22:25:07 +00:00
skipfiles.py [PT2E][Quant] Use subgraph matcher annotate linear pattern (#100566) 2023-05-04 21:31:59 +00:00
source.py
symbolic_convert.py Activate TracingContext earlier (#100043) 2023-05-03 20:55:30 +00:00
test_case.py
test_minifier_common.py Misc accuracy improvements on minifier (#100447) 2023-05-04 02:51:26 +00:00
testing.py [dynamo][numpy] Add NumpyTensorVariable to translate ndarray attribute calls to tensor attributes (#95849) 2023-04-27 16:18:35 +00:00
types.py
utils.py [quant][pt2e] Support conv bn fusion in convert step for QAT flow (#100442) 2023-05-09 19:43:51 +00:00