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

rm convertToSSA API,test=huawei_ascend_npu test=nvidia_tensorrt test=verisilicon_timvx #8988

Merged
merged 1 commit into from
May 11, 2022
Merged

Conversation

weishengying
Copy link
Collaborator

@weishengying weishengying commented May 5, 2022

之前修复拓扑排序紊乱的PR #8967 已合入。本pr的目的测试删除convertToSSA api的使用, 如果该pr顺利合入的话,证明了之前修复的有效性。

除了删除 converttossa API相关的调用以及cmake定义之外;
本pr还修改了 type_target_cast_pass,原因如下:

直接删除 converttossa , 在xpu_dasou的CI中 模型ernie_gen 会报错,原因如下:
该模型的第8个输入 placeholder_7,作为模型的输入,其是host上的tensor, 但在子block中 assign算子,重新给这个变量赋值了,使placeholder_7成为了 xpu上的tensor,因此模型在第二次run时,初始化数据时, 使用memcpy去给placeholder_7 tensor里面的指针赋值,会报错。只能使用 xpu_memcpy。

一个简化的demo如下图所示:
image
feed 是 op的输入, op的结果回写到feed, 然后再执行其他op,假设这个模型运行在xpu上,得到的中间表达如下:
image
可见,feed var从host上的tensor变成了xpu上的tensor。因此模型第二次run,初始化数据时,只能使用xpu_memcpy。
一个可行的方案是在输出侧也插入 io copy算子。(这样会产生一个新的变量,与原始的converttossa api中生成新的变量类似)
image

@weishengying weishengying changed the title rm convertToSSA API,test=huawei_ascend_npu test=nvidia_tensorrt test=… rm convertToSSA API,test=huawei_ascend_npu test=nvidia_tensorrt test=verisilicon_timvx May 5, 2022
@weishengying weishengying requested a review from liyancas as a code owner May 9, 2022 06:01
Copy link
Collaborator

@chenjiaoAngel chenjiaoAngel left a comment

Choose a reason for hiding this comment

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

LGTM

@weishengying weishengying merged commit 94a069b into PaddlePaddle:develop May 11, 2022
WeiLi233 pushed a commit to WeiLi233/Paddle-Lite that referenced this pull request Jun 28, 2022
WeiLi233 pushed a commit to WeiLi233/Paddle-Lite that referenced this pull request Jun 28, 2022
weishengying added a commit that referenced this pull request Jul 9, 2022
WeiLi233 pushed a commit to WeiLi233/Paddle-Lite that referenced this pull request Feb 13, 2023
test

[OpTestPy] fix expand/expand_v2, fc,flatten_contiguous_range, gather, generate_proposals_v2,greater_equal diff! (PaddlePaddle#8339) (PaddlePaddle#8394)

* test=document_fix

 fix Android C++ demo compile Fail bug (PaddlePaddle#8245)

* fix demo MakeFile

Add a convert_to_ssa macro definition (PaddlePaddle#8869)

rm convertToSSA API,test=huawei_ascend_npu test=nvidia_tensorrt test=verisilicon_timvx (PaddlePaddle#8988)

Sync with offical 3af2ffb

Sync with 3af2ffb
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.

2 participants