Skip to content
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

[AutoParallel] Set value phi yaml #58893

Merged
merged 18 commits into from
Nov 14, 2023

Conversation

wanghuancoder
Copy link
Contributor

PR types

Others

PR changes

Others

Description

将set value迁移至PHI yaml。动态图走最终态。并支持AutoParallel

Pcard-73145

@@ -1573,10 +1573,10 @@ def test_forward_version(self):
self.assertEqual(var.inplace_version, 1)

inplace_var[0] = 2
self.assertEqual(var.inplace_version, 1)
self.assertEqual(var.inplace_version, 2)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的修改是因为原来对set_value的inplace处理是错的,而单测“迎合”了错误的处理逻辑。这里给修改掉

@@ -829,7 +829,6 @@ def test_setitem(self):
np.testing.assert_allclose(out[1, 2, 3, 4], np.array(10))
self.assertEqual(x.grad.shape, [2, 3, 4, 5])
x_grad_expected = np.ones((2, 3, 4, 5)) * 2
x_grad_expected[1, 2, 3, 4] = 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里之所以删掉是因为,原来中间态set_value的反向,不管有没有ValueTensor都调set_value_grad。但按着Maker的表述,如果有ValueTensor调set_value_grad,否则调assign。单测这里迎合了中间态的产品形态。

@@ -829,7 +829,6 @@ def test_setitem(self):
np.testing.assert_allclose(out[1, 2, 3, 4], np.array(10))
self.assertEqual(x.grad.shape, [2, 3, 4, 5])
x_grad_expected = np.ones((2, 3, 4, 5)) * 2
x_grad_expected[1, 2, 3, 4] = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是和原来的计算行为不一样了吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里之所以删掉是因为,原来中间态set_value的反向,不管有没有ValueTensor都调set_value_grad。但按着Maker的表述,如果有ValueTensor调set_value_grad,否则调assign。单测这里迎合了中间态的产品形态。

@wanghuancoder wanghuancoder merged commit 8bc09e7 into PaddlePaddle:develop Nov 14, 2023
28 checks passed
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
@zoooo0820 zoooo0820 mentioned this pull request Nov 16, 2023
SecretXV pushed a commit to SecretXV/Paddle that referenced this pull request Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants