Skip to content

Conversation

@xiaoguoguo626807
Copy link
Contributor

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

pcard-67164

x_data = paddle.static.data(shape=self.shape, name="data", dtype="float32")
output = paddle.incubate._npu_identity(x=x_data, format=self.format)

上述网络在PIR 下输出有误,原因是npu_identity b=不只是内存拷贝,还会根据format 修改内存布局,因此从npu 拷贝到cpu 时也需要用专用的kernel.
pir 的memcpy_d2h kernel 选择逻辑是按照src_place .type() 选backend, 所有的custom place 都选择custom backend , 而npu 注册了自己的kernel没被选到。 修改选kernel的逻辑,如果是customplace, 按照value.place 构造fake tensor, 进行kernr key set准备,按照优先级选到npu kernel。

@paddle-bot
Copy link

paddle-bot bot commented Apr 9, 2025

你的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.

Copy link
Contributor

@changeyoung98 changeyoung98 left a comment

Choose a reason for hiding this comment

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

LGTM

@xiaoguoguo626807 xiaoguoguo626807 merged commit 7e2c9ed into PaddlePaddle:develop Apr 10, 2025
33 of 34 checks passed
@xiaoguoguo626807 xiaoguoguo626807 deleted the npu_indentity branch April 10, 2025 07:19
YqGe585 pushed a commit to YqGe585/Paddle that referenced this pull request May 7, 2025
…lePaddle#72149) * modify place error * modify place error * modify RemoveRedundantMemcpyAfterShadowFeed * change input place by next op need * recover * add npu memcpy_d2h choose * add npu memcpy_d2h choose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants