CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[SOT][Faster Guard] remove RangeMatchGuard
#70362
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] remove RangeMatchGuard
#70362
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.
Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 comment.
Files not reviewed (3)
- paddle/fluid/pybind/jit.cc: Language not supported
- paddle/fluid/pybind/sot/guards.cc: Language not supported
- paddle/fluid/pybind/sot/guards.h: Language not supported
Comments suppressed due to low confidence (1)
python/paddle/jit/sot/opcode_translator/executor/guard.py:208
- The
StringCheckGuard
should be initialized with the correct value. Ensure thatobj_free_var_name
is the intended parameter.
paddle.framework.core.StringCheckGuard(obj_free_var_name),
StringifiedExpression( | ||
"isinstance({0}, range) and " | ||
FasterStringifiedExpression( | ||
"id(type({0})) == id(range) and " |
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.
The attribute 'init_value' is used but not defined in the 'RangeVariable' class. This will lead to an AttributeError. Define 'init_value' in the class or use an existing attribute.
"id(type({0})) == id(range) and " | |
+ f"{{0}}.start == {self.some_existing_attribute.start} and " |
Copilot uses AI. Check for mistakes.
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.
The attribute 'init_value' is used but not defined in the 'RangeVariable' class. This will lead to an AttributeError. Define 'init_value' in the class or use an existing attribute.
差评
paddle/fluid/pybind/sot/guards.cc
Outdated
std::string expected_str = PyUnicode_AsUTF8(expected_); | ||
std::cout << "[StringCheckGuard]" << expected_str << std::endl; | ||
std::string str = PyUnicode_AsUTF8(value); | ||
std::cout << "[StringCheckGuard]" << str << std::endl; |
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.
这个expected_是不是可以直接在初始化的时候就变成string
StringifiedExpression( | ||
"isinstance({0}, range) and " | ||
FasterStringifiedExpression( | ||
"id(type({0})) == id(range) and " |
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.
The attribute 'init_value' is used but not defined in the 'RangeVariable' class. This will lead to an AttributeError. Define 'init_value' in the class or use an existing attribute.
差评
Sorry to inform you that ba27bc4's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
…guard_StringCompareGuard
test/sot/test_06_call_function.py
Outdated
@@ -167,6 +176,7 @@ def fn2(x): | |||
|
|||
|
|||
class TestApplyDifferentFunctions(TestCaseBase): | |||
@test_with_faster_guard |
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 先清理下,这个测试用的装饰器应该没必要了
StringCompareGuard
and support RangeVariable
RangeVariable
RangeVariable
RangeMatchGuard
paddle/fluid/pybind/jit.cc
Outdated
GuardBase, | ||
std::shared_ptr<StringCompareGuard>>( | ||
*m, "StringCompareGuard", R"DOC(StringCompareGuard Class.)DOC") | ||
.def(py::init<const char &>(), py::arg("str")); |
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.
char是不是一个字符啊,应该是 char[]或者string吧
…ard_StringCompareGuard
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
Execute Infrastructure
PR Types
Performance
Description
删除
RangeMatchGuard
, 可以使用下面这种逻辑替代相关链接