-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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] add StringCompareGuard
and support RangeVariable
#70362
base: develop
Are you sure you want to change the base?
[SOT][Faster Guard] add StringCompareGuard
and support RangeVariable
#70362
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
Copilot
AI
left a comment
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 is powered by AI, so mistakes are possible. Review output carefully before use.
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.
差评
PR Category
Execute Infrastructure
PR Types
Performance
Description
StringCompareGuard
RangeVariable
TODO
StringCompareGuard
有点问题,[Guard]: lambda frame: StringCheckGuard_6171297008(frame.f_locals['fn'].__code__) and ValueMatchGuard_6171297200(frame.f_locals['x'])
相关链接