[SOT][3.12] Fix that frame
in eval custom code was not released in tstate
- step 2
#62470
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
Others
Description
背景:
我们在 #61703 修改了对
frame
的管理,但是并没有考虑到PyObject_CallObject
是 error 的情况, 反应到代码上就是PyObject_CallObject
的结果为NULL
。具体表现就是,当有
assertRaises
检查和try
运行失败的时候,会导致frame
没能正常释放TODO:
在支持的同时发现了另一个问题,是由 log 导致的
复现方式:
export SOT_LOG_LEVEL=9 COST_MODEL=False MIN_GRAPH_SIZE=0 STRICT_MODE=True FLAGS_cudnn_deterministic=False python test/sot/test_simulate_initialize.py TestInit.test_created_layer_reconstruct
SOT_LOG_LEVEL
设置为 3 以上即可, 目前定位是在python/paddle/jit/sot/opcode_translator/eval_frame_callback.py
的print_locals
函数相关链接:
frame
in eval custom code was not released intstate
#61703