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.148】outer #58927

Merged
merged 2 commits into from
Nov 15, 2023
Merged

【PIR API adaptor No.148】outer #58927

merged 2 commits into from
Nov 15, 2023

Conversation

cocoshe
Copy link
Contributor

@cocoshe cocoshe commented Nov 11, 2023

PR types

Others

PR changes

APIs

Description

[used AI Studio]

No.148将 paddle.Tensor.outer 迁移升级至 pir,并更新单测 单测覆盖率:1/2
当前1个test_error单测已跳过

Copy link

paddle-bot bot commented Nov 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.

@paddle-bot paddle-bot bot added the contributor External developers label Nov 11, 2023
@cocoshe
Copy link
Contributor Author

cocoshe commented Nov 11, 2023

nx = x.reshape((-1, 1))
ny = y.reshape((1, -1))
if in_dynamic_mode():
return _C_ops.matmul(nx, ny, False, False)
else:
def __check_input(x, y):
var_names = {'x': x, 'y': y}
for name, val in var_names.items():
check_variable_and_dtype(
val,
name,
['float16', 'float32', 'float64', 'int32', 'int64'],
'outer',
)
__check_input(nx, ny)
helper = LayerHelper('outer', **locals())
out = helper.create_variable_for_type_inference(dtype=nx.dtype)
helper.append_op(
type='matmul_v2', inputs={'X': nx, 'Y': ny}, outputs={'Out': out}
)
return out

nx = x.reshape((-1, 1))的时候,reshape会正常报错(不支持int8)
F_DXI(Y6(0IO9%`1@DZN9T
但是在pir的时候,reshape不报错
(CWY1(F 6RG$D2SSUAXMOQ6
这种情况可以指点一下怎么改嘛?

@cocoshe
Copy link
Contributor Author

cocoshe commented Nov 11, 2023

nx = x.reshape((-1, 1))
ny = y.reshape((1, -1))
if in_dynamic_mode():
return _C_ops.matmul(nx, ny, False, False)
else:
def __check_input(x, y):
var_names = {'x': x, 'y': y}
for name, val in var_names.items():
check_variable_and_dtype(
val,
name,
['float16', 'float32', 'float64', 'int32', 'int64'],
'outer',
)
__check_input(nx, ny)
helper = LayerHelper('outer', **locals())
out = helper.create_variable_for_type_inference(dtype=nx.dtype)
helper.append_op(
type='matmul_v2', inputs={'X': nx, 'Y': ny}, outputs={'Out': out}
)
return out

nx = x.reshape((-1, 1))的时候,reshape会正常报错(不支持int8) F_DXI(Y6(0IO9%`1@DZN9T 但是在pir的时候,reshape不报错 (CWY1(F 6RG$D2SSUAXMOQ6 这种情况可以指点一下怎么改嘛?

已解决

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Nov 13, 2023
for name, val in var_names.items():
check_variable_and_dtype(
val,
name,
Copy link
Contributor

Choose a reason for hiding this comment

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

pir 模式下的 check_dtype 未来会下沉到 C++ 侧去执行,所以可以先跳过检查 dtype 的单测。这里不需要在进入 in_dynamic_or_pir_mode 分支前进行类型判断

Comment on lines 146 to 145
@test_with_pir_api
def test_errors_static(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

test_errors 可以先跳过。理由如上

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 bb7dd59 into PaddlePaddle:develop Nov 15, 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