CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[SOT][dynamic shape] add SymbolicTracker to replace DummyTracker #64500
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
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -121,6 +121,25 @@ def need_guard(self) -> bool: | |||
return False | |||
|
|||
|
|||
class SymbolicTracker(DummyTracker): |
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.
感觉 SymbolicTracker
语义不太足,「符号化」更多表示输入变量是个符号?但这个 tracker 用于表示变量之间的操作,感觉还是叫 SymbolicOperationTracker
吧,虽然长一些,但语义是够的~
class SymbolicTracker(DummyTracker): | ||
""" | ||
SymbolicTracker is a subclass of Tracker that specifically tracks variables cannot be reproduced from the frame. | ||
It is mostly generated by complex operations (instructions). |
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.
这里应该说明来源是 symbolic 变量的运算
python/paddle/jit/sot/opcode_translator/executor/opcode_executor.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/opcode_executor.py
Outdated
Show resolved
Hide resolved
return bool(self.get_py_value()) | ||
|
||
def bool(self): | ||
return ConstantVariable(bool(self), self.graph, DummyTracker([self])) |
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.
这里不是 SymbolicOperationTracker 么?
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.
SymbolicVariable不支持bool的话,bool操作的时候是不是应该就给截断了变成Constant,然后guard value
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.
也就是只要取值就转成 Constant 是么,可以
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.
python/paddle/jit/sot/opcode_translator/executor/function_graph.py
Outdated
Show resolved
Hide resolved
This reverts commit 6492b08.
return bool(self.get_py_value()) | ||
|
||
def bool(self): | ||
return ConstantVariable(bool(self), self.graph, DummyTracker([self])) |
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.
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.
PR Category
Others
PR Types
Others
Description
使用 SymbolicTracker 替换 DummyTracker 的准备工作,后续实现SymbolicVariable的表示机制