-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[SOT][Faster Guard] adapt to faster guard for more variables #69411
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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.
@@ -148,6 +148,19 @@ class ShapeMatchGuard : public GuardBase { | |||
std::vector<std::optional<int64_t>> expected_; | |||
}; | |||
|
|||
class AttributeMatchGuard : public GuardBase { |
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.
AttributeMatchGuard(v, "attr").check(x)
会比 ValueMatchGuard(v).check(x.attr)
快一些是么?
这里我的一个考虑是,如果 IR 表示(表达式树)上包含的是 value_guard_1(x.attr) and value_guard_2(x.attr)
是可以消除公共子表达式的,而 attr_guard_1(x, attr) and attr_guard_2(x, attr)
则是相对来说会更难优化的,这在后续设计时可以考虑下
如果 AttributeMatchGuard
是有优化的,这里可以考虑在最开始 build 的 Guard 树上不体现 AttributeMatchGuard
,以确保公共子表达式消除等优化是可以作用的,最后通过 Pass 将 value_guard_1(x.attr)
fuse 成 attr_guard_1(x, attr)
有点组合算子的意思,IR 上最开始生成的以及后续 Pass 处理的是基础 Guard,经过图变换、融合生成高性能的组合 Guard
PR Category
Execute Infrastructure
PR Types
Performance
Description