-
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
[Dy2St] pir dy2st unittest verification - Part 8 #59120
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
✅ This PR's description meets the template requirements! |
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.
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.
一些修改注解,@gouzil @DrRyanHuang 可以看看
@@ -575,8 +575,24 @@ def convert_len(var): | |||
'len(var) only supports LoDTensor/LoDTensorArray/SelectedRows, but received %s.' | |||
% type(var) | |||
) | |||
elif isinstance(var, OpResult): |
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.
适配 convert_len
OpResult 上需要用 is_dense_tensor_array_type
等方法来判断 type
if len(args) == 3: | ||
return paddle.arange(args[0], args[1], args[2], paddle.int64) | ||
return paddle.arange(args[0], args[1], args[2], "int64") |
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.
适配 convert_range
目前 PIR API 不支持 VarType,但支持 str,与震哥同步是将来会通过将 paddle.int64 这些 API 在 pir mode 下直接改为 DataType 来实现,但这件事情目前还没有排期
目前的解决方案就是遇到相关代码就改为 str
# TODO(dev): Remove the program and var_cache shims after PIR become default state. | ||
# self.var_cache = {} | ||
# self.main_program = paddle.static.Program() | ||
# self.startup_program = paddle.static.Program() |
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.
利用底层 @cached_property
做 lazy initialize,顶层 @property
来按照 ir mode 分发,确保 cache 的属性在不同模式下是不同的
相关代码都是冗余代码,在老 IR 退场后可以直接写回注释中的版本
--------- Co-authored-by: SigureMo <[email protected]>
PR types
Others
PR changes
Others
Description
test_cache_program
:TestToOutputWithCache
paddle.static.nn.control_flow.While._complete
方法,WhileGuard 报错ValueError: (InvalidArgument) Currently, we can only get name of OpResult that is persistable
test_resnet
InvalidArgumentError: The type of data we are trying to retrieve (uint8) does not match the type of data (float32) currently contained in the container.
test_rollback
setUP
中设置的device
是否生效, 原因Part 3test_backward_without_params
test_for_enumerate
:TestForInRange
ValueError: (InvalidArgument) Currently, we can only get name of OpResult that is persistable (at /workspace/Paddle/paddle/fluid/pybind/pir.cc:745)
test_for_enumerate
:TestForIterVarNumpy
OpResult.clone
,依赖 #59115AttributeError: 'paddle.base.libpaddle.pir.OpResult' object has no attribute 'clone'
test_for_enumerate
:TestForInRange
ValueError: (InvalidArgument) Currently, we can only get name of OpResult that is persistable (at /workspace/Paddle/paddle/fluid/pybind/pir.cc:745)
test_for_enumerate
:TestForZip
test_for_enumerate
:TestForIterVarList
test_print
中间态问题记录:
test/dygraph_to_static/test_for_enumerate.py
文件的TestForInRange.test_transformed_result_compare
单测,需要装饰@test_pir_only
复现 (注意有部分单测继承它)报错信息:
相关链接: