-
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
[Dy2St] pir dy2st unittest verification - Part 9 #59232
Conversation
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.
@@ -39,8 +39,10 @@ | |||
|
|||
|
|||
def convert_attr(x, attr): |
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.
elif
好像没必要存在?直接删掉即可
这里应该是为了对齐动态图 x.size
和老 IR x.size()
动静不统一的问题的,在 PIR 下动静统一,所以 convert_attr
以及 AttributeJstTransformer
应该都是可以清理了的
我觉得我们可以记一个 TODO(cleanup-legacy-ir)
,说明下老 IR 退场时是可以直接删掉相关 convert 和 Transformer
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.
已直接修改
@@ -356,6 +372,43 @@ def clone(self): | |||
""" | |||
return paddle.assign(self) | |||
|
|||
@fake_interface_only | |||
def clear_gradient(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.
TODO: 等 CI 过了让震哥来 review API 变动
需要解决下冲突 |
…_push_9 # Conflicts: # python/paddle/pir/math_op_patch.py
done |
…_push_9 # Conflicts: # test/dygraph_to_static/test_mnist.py # test/dygraph_to_static/test_tensor_methods.py # test/dygraph_to_static/test_tensor_shape.py # test/dygraph_to_static/test_train_step.py
@@ -31,6 +32,21 @@ | |||
] | |||
|
|||
|
|||
def _fake_interface_only_(func): |
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.
framework.py中有一个相同的_fake_interface_only_函数,能直接用framework.py中的那个函数吗?
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.
会循环引用emmm,得解了才能复用
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.
LGTM for math_op_patch.py
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.
Great work!
to_static, | ||
prediction, | ||
[img.name], | ||
img = to_variable(dy_x_data) |
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.
后续遇到类似to_variable这种旧的API,可否替换为paddle.to_tensor?
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.
LGTM for docs (反正base的文档不暴露嘻嘻
PR types
Others
PR changes
Others
Description
test_train_step
AttributeError: 'paddle.base.libpaddle.pir.OpResult' object has no attribute 'backward'
test_train_step_resnet18_sgd
test_train_step_resnet18_adam
test_tensor_shape
:{TestOpNumWithTensorShapeInIf1, TestOpNumWithTensorShapeInFor1, TestOpNumWithTensorShapeInWhile1}
test_mnist
:test_mnist_to_static
partial_program_layer
_prepare_attributes
时候报错,self.program 里调用_append_backward_desc
会报错test_tensor_methods
size
的改动可以看一下#58987test_tensor_memcpy_on_gpu
test_for_enumerate.py
:TestForIterVarNumpy
test_for_enumerate.py
:TestForEnumerateVarWithNestedRange
TestForIterVarNumpy
的TestForEnumerateVarWithNestedRange
包含控制流,所以不支持;另外注意这个 case 中间态也有问题,中间态会在 Win 和 mac CI 上挂掉,本地没问题相关链接: