Skip to content

Conversation

YuanRisheng
Copy link
Contributor

@YuanRisheng YuanRisheng commented Oct 11, 2023

PR types

Others

PR changes

Others

Description

Pcard-67164
补全如下算子的新IR单测,并解决单测验证中出现的问题:
assign / softmax_mask_fuse_upper_triangle / tile / tril_triu / pad

@paddle-bot
Copy link

paddle-bot bot commented Oct 11, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@YuanRisheng YuanRisheng changed the title [PIR]Perfect unittest for assign / softmax_mask_fuse_upper_triangle / tile / tril_triu [PIR]Perfect unittest for assign / softmax_mask_fuse_upper_triangle / tile / tril_triu / pad Oct 13, 2023

def get_attr_repeat_times(list_repeat_times):
attrs_repeat_times = []
for idx, times in enumerate(list_repeat_times):
if isinstance(times, Variable):
if isinstance(times, (Variable, paddle.pir.OpResult)):
Copy link
Contributor

Choose a reason for hiding this comment

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

在非pir的分支下也会出现OpResult类型吗?

Copy link
Contributor Author

@YuanRisheng YuanRisheng Oct 16, 2023

Choose a reason for hiding this comment

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

不会,下个PR删一下

@@ -288,6 +290,7 @@ def test_errors(self):
self.assertRaises(TypeError, paddle.assign, x2)
paddle.disable_static()

@test_with_pir_api
def test_type_error(self):
paddle.enable_static()
with program_guard(Program(), Program()):
Copy link
Contributor

Choose a reason for hiding this comment

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

这个地方Program是base 引入的,可能还是旧的program, 可以检查一下

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里应该是旧Program,下个pr重新修改一下这个单测

@@ -275,6 +276,7 @@ def test_assign_bfp16(self):


class TestAssignOpErrorApi(unittest.TestCase):
@test_with_pir_api
def test_errors(self):
paddle.enable_static()
with program_guard(Program(), Program()):
Copy link
Contributor

Choose a reason for hiding this comment

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

同下

@@ -105,6 +105,18 @@ def test_assign(self):
np.testing.assert_array_equal(fetched_x, self.value)
self.assertEqual(fetched_x.dtype, self.value.dtype)

def test_pir_assign(self):
with paddle.pir_utils.IrGuard():
Copy link
Contributor

Choose a reason for hiding this comment

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

在guard 中使用paddle.static.Program() 便于后续静态图退场统一入口

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,谢谢

@@ -107,7 +111,7 @@ def test_static(self):

exe = base.Executor(base.CUDAPlace(0))
fetches = exe.run(
base.default_main_program(),
paddle.static.default_main_program(),
Copy link
Contributor

Choose a reason for hiding this comment

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

guard中是paddle.static.program(). 这里执行默认的program是同一个吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

是的

@YuanRisheng YuanRisheng merged commit b72175c into PaddlePaddle:develop Oct 16, 2023
jiahy0825 pushed a commit to jiahy0825/Paddle that referenced this pull request Oct 26, 2023
… tile / tril_triu / pad (PaddlePaddle#58026)

* compact unittest

* fix windows bugs

* fix bugs

* modify code

* fix mkldnn
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
… tile / tril_triu / pad (PaddlePaddle#58026)

* compact unittest

* fix windows bugs

* fix bugs

* modify code

* fix mkldnn
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.

4 participants