CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[SOT][DynamicShape] Fix SymbolicVariable
get_py_value
reversed call and break graph on infermeta encount TypeError
#70009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…d break graph on infermeta encount `TypeError`
你的PR提交成功,感谢你对开源项目的贡献! |
SOT_BREAK_GRAPH_ON_GET_SYMBOLIC_VALUE
and break graph on infermeta encount TypeError
SOT_BREAK_GRAPH_ON_GET_SYMBOLIC_VALUE
and break graph on infermeta encount TypeError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 suggestion.
Comments skipped due to low confidence (2)
python/paddle/jit/sot/opcode_translator/executor/function_graph.py:666
- The word 'encount' should be 'encounter'.
raise BreakGraphError(f"InferMeta encount {type(e)}, but all args are not symbolic.")
python/paddle/jit/sot/opcode_translator/executor/function_graph.py:693
- The word 'encount' should be 'encounter'.
raise BreakGraphError(f"InferMeta encount {type(e)}, but all args are not symbolic.")
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 suggestion.
Comments skipped due to low confidence (2)
python/paddle/jit/sot/opcode_translator/executor/function_graph.py:666
- The error message contains a typo: 'encount'. It should be 'encountered'.
raise BreakGraphError(f"InferMeta encount {type(e)}, but all args are not symbolic.")
python/paddle/jit/sot/opcode_translator/executor/function_graph.py:693
- The error message contains a typo: 'encount'. It should be 'encountered'.
raise BreakGraphError(f"InferMeta encount {type(e)}, but all args are not symbolic.")
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: gouzil <66515297+gouzil@users.noreply.github.com>
SOT_BREAK_GRAPH_ON_GET_SYMBOLIC_VALUE
and break graph on infermeta encount TypeError
SymbolicVariable
get_py_value
reversed call and break graph on infermeta encount TypeError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 4 out of 4 changed files in this pull request and generated no suggestions.
Comments skipped due to low confidence (1)
python/paddle/jit/sot/opcode_translator/executor/variables/basic.py:109
- The function 'method_to_reverse_method' is not covered by any tests. Please add a test case to ensure its correctness.
def method_to_reverse_method(method_name: str) -> str | None:
SymbolicVariable
get_py_value
reversed call and break graph on infermeta encount TypeError
SymbolicVariable
get_py_value
reversed call and break graph on infermeta encount TypeError
PR Category
Execute Infrastructure
PR Types
Bug fixes
Description
目前 Fallback 回静态 shape 的策略有点 bug,比如
SymbolicVariable(10) * SymbolicVariable(0.25)
的结果的 Tracker 里的 method 是__mul__
,但实际上触发的是float.__rmul__
,而这里按照记录的__mul__
计算的结果是(10).__mul__(0.25) = NotImplemented
,导致后续挂掉因此将暂时通过转为SOT_BREAK_GRAPH_ON_GET_SYMBOLIC_VALUE
开启默认,直接打断,不走 Fallback 回静态 shape,预期可能有部分模型有性能下降,但正确性优先__rmul__
解决,之后需要寻找一个更好的方案另外就是有些 API 动静不统一,比如
randperm
的第一个参数n
,输入是 int,动态图下 API 可以将 Tensor cast 为 int,但动转静后传入 Value 是会挂的,因此如果遇到TypeError
直接 BreakGraph 确保正确性PCard-66972