Skip to content

[BugFix][OpenCL] Fix concat image impl when axis is not 1. test=develop #4241

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

Merged
merged 8 commits into from
Sep 7, 2020

Conversation

zhaoyang-star
Copy link
Collaborator

@zhaoyang-star zhaoyang-star commented Sep 2, 2020

【问题1】当 concat 的 axis 不为 1 时,opencl concat image 实现计算错误。
【原因】在成员函数PrepareForRun中定义了一个临时变量axis_(该临时变量与类的成员变量axis_重名),在PrepareForRun中对临时变量的赋值并不会传递到成员函数Run中,因此在Run中读取的axis_值恒为默认值。
【解决方法】删除成员函数PrepareForRun中对axis_的定义,改为直接对成员变量axis_赋值。

【问题2】当 concat 的 axis 为 -1 时,opencl concat image 实现计算错误且有内存越界现象。
【原因】当 axis==-1时,需要对其进行转换。
【解决方法】将 axis 置为 output 的最后一个 axis。

【其他】修改了输出debug信息时存在的内存越界访问。

@zhaoyang-star zhaoyang-star changed the title [BugFix][OpenCL] Fix concat image impl when concat axis is not 1. test=develop [BugFix][OpenCL] Fix concat image impl when axis is not 1. test=develop Sep 2, 2020
ysh329
ysh329 previously approved these changes Sep 2, 2020
Copy link
Contributor

@ysh329 ysh329 left a comment

Choose a reason for hiding this comment

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

LGTM

ysh329
ysh329 previously approved these changes Sep 2, 2020
Copy link
Contributor

@ysh329 ysh329 left a comment

Choose a reason for hiding this comment

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

没其他问题。LGTM

xiebaiyuan
xiebaiyuan previously approved these changes Sep 2, 2020
Copy link
Collaborator

@xiebaiyuan xiebaiyuan left a comment

Choose a reason for hiding this comment

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

LGTM

chenjiaoAngel
chenjiaoAngel previously approved these changes Sep 3, 2020
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

Copy link
Contributor

@ysh329 ysh329 left a comment

Choose a reason for hiding this comment

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

LGTM

@ysh329 ysh329 merged commit 9bc1f34 into PaddlePaddle:develop Sep 7, 2020
@zhaoyang-star zhaoyang-star deleted the fix_concat branch September 7, 2020 06:37
zhaoyang-star added a commit to zhaoyang-star/Paddle-Lite that referenced this pull request Sep 14, 2020
…op (PaddlePaddle#4241)

* [BugFix][OpenCL] Fix concat image impl when concat axis is not 1

* fix code when axis == 1. test=develop

* fix illegal access when print debug info. test=develop

* fix typo
ysh329 pushed a commit that referenced this pull request Sep 15, 2020
…op (#4241) (#4327)

* [BugFix][OpenCL] Fix concat image impl when concat axis is not 1

* fix code when axis == 1. test=develop

* fix illegal access when print debug info. test=develop

* fix typo
zhaoyang-star added a commit to zhaoyang-star/Paddle-Lite that referenced this pull request Sep 24, 2020
…op (PaddlePaddle#4241)

* [BugFix][OpenCL] Fix concat image impl when concat axis is not 1

* fix code when axis == 1. test=develop

* fix illegal access when print debug info. test=develop

* fix typo
juncaipeng pushed a commit to juncaipeng/Paddle-Lite that referenced this pull request Oct 27, 2020
…op (PaddlePaddle#4241)

* [BugFix][OpenCL] Fix concat image impl when concat axis is not 1

* fix code when axis == 1. test=develop

* fix illegal access when print debug info. test=develop

* fix typo
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.

4 participants