CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【PIR】add memcpy in PIR #57741
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】add memcpy in PIR #57741
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
同时添加下单测吧,如果相关动转静单测在添加这个单测之后直接能成功,那么直接修一下。
成功了的话可以在 |
Sorry to inform you that 9eb6cc2's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
args : (Tensor x, int dst_place_type) | ||
output : Tensor(out) | ||
kernel: | ||
func : memcpy |
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.
为什么没有infer_meta
配置
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.
我理解的是如果输出的 dtype dims 等信息不需要特殊的处理可以不用添加?默认的都是与输出一致的吧
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.
这里复用UnchangedInferMeta应该就可以了,memcpy现在用的就是UnchangedInferMeta
DECLARE_INFER_SHAPE_FUNCTOR(memcpy,
MemcpyInferShapeFunctor,
PD_INFER_META(phi::UnchangedInferMeta));
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.
if (dst_place_type == 1) { | ||
res.set_backend(phi::Backend::GPU); | ||
} |
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.
为什么只判断了等于1的情况?
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.
现在的代码看上去和旧IR的逻辑不完全等价,这里再check下,可以再加一些注释说明
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.
好的,之后补充一些额外注释。
现在的代码看上去和旧IR的逻辑不完全等价
不完全等价指的是一个是修改了 Backend,一个是修改了 DeviceContext 吗?
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.
原来的逻辑是结合place一起判断处理,新的逻辑看上去没有考虑place信息?
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.
这里疏漏了,之后修改一下把这一部分加上
e84814f
to
5a43e45
Compare
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
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
* fix test_tensor_memcpy_cpu and test_tensor_memcpy_gpu * fix 2023-10-17 * fix place bug 2023-10-19 * delete std::cout 2023-10-19 * fix 2023-10-19_V1 * fix bug
* fix test_tensor_memcpy_cpu and test_tensor_memcpy_gpu * fix 2023-10-17 * fix place bug 2023-10-19 * delete std::cout 2023-10-19 * fix 2023-10-19_V1 * fix bug
* fix test_tensor_memcpy_cpu and test_tensor_memcpy_gpu * fix 2023-10-17 * fix place bug 2023-10-19 * delete std::cout 2023-10-19 * fix 2023-10-19_V1 * fix bug
PR types
Others
PR changes
OPs
Description
add memcpy op in PIR