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

【PIR API adaptor No.65, 69】Migrate some ops into pir #58698

Merged
merged 8 commits into from
Nov 27, 2023

Conversation

longranger2
Copy link
Contributor

@longranger2 longranger2 commented Nov 5, 2023

PR types

Others

PR changes

APIs

Description

PIR API 推全升级
将如下算子迁移升级至 pir,并更新单测

  • empty_like(3/3)
    这个文件下继承自 TestEmptyLikeAPICommon 的单测均为动态图单测,不在本次组网API PIR 迁移的单测覆盖目标内。目前在 empty_like 的单测中,除了 TestEmptyError 尚未支持,其他都已经适配了

  • eye(5/7):TestEyeRowsCol暂时不支持

  • 新IR Python API适配升级 #58067

@paddle-bot paddle-bot bot added the contributor External developers label Nov 5, 2023
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Nov 6, 2023
@@ -1199,7 +1199,7 @@ def _check_attr(attr, message):
else:
num_columns = num_rows

if in_dynamic_mode():
if in_dynamic_or_pir_mode():
Copy link
Contributor

Choose a reason for hiding this comment

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

这里的适配有些问题。上面的 _check_attr 应该还需要适配 OpResult 的情况:
image

@@ -2177,7 +2179,7 @@ def empty_like(x, dtype=None, name=None):
dtype = x.dtype
dtype = convert_dtype(dtype)

if in_dynamic_mode():
if in_dynamic_or_pir_mode():
Copy link
Contributor

Choose a reason for hiding this comment

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

这里静态图多了一些处理逻辑,有时候动态图逻辑是不能复用的,需要有pir自己的逻辑的
image
可修改如下:

    elif in_pir_mode():
        shape = paddle.shape(x)
        out = _C_ops.empty(
            shape,
            convert_np_dtype_to_dtype_(dtype),
            _current_expected_place(),
        )
        out.stop_gradient = True
        return out

@@ -144,6 +145,7 @@ def init_info(self):
self.shapes = [[2, 3, 4]]
self.save_path = os.path.join(self.temp_dir.name, self.path_prefix())

@test_with_pir_api
Copy link
Contributor

@MarioLulab MarioLulab Nov 19, 2023

Choose a reason for hiding this comment

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

可以先跳过这个单测,然后在 PR 描述里记录该单测暂不支持

Copy link

paddle-ci-bot bot commented Nov 23, 2023

Sorry to inform you that ba8dc2b's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@MarioLulab
Copy link
Contributor

long 师傅这个 pr 还在推进吗~

@longranger2
Copy link
Contributor Author

long 师傅这个 pr 还在推进吗~

推的哈哈,最近比较忙~

@longranger2
Copy link
Contributor Author

long 师傅这个 pr 还在推进吗~

done

Copy link
Contributor

@MarioLulab MarioLulab left a comment

Choose a reason for hiding this comment

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

nice work~

Copy link
Contributor

Choose a reason for hiding this comment

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

这个文件下还缺少了 API_TestTensorEye 单测没有适配,辛苦有空的时候适配一下吧~ 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

这个文件下继承自 TestEmptyLikeAPICommon 的单测均为动态图单测,不在本次组网API PIR 迁移的单测覆盖目标内。目前看来 empty_like 的单测中,除了 TestEmptyError 尚未支持,其他都已经适配了。所以请更新一下 pr 描述里的单测覆盖率吧~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@MarioLulab MarioLulab left a comment

Choose a reason for hiding this comment

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

LGTM

@0x45f 0x45f merged commit 46900ef into PaddlePaddle:develop Nov 27, 2023
28 checks passed
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
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants