[OpenCL] Set flush period of command queue #5905
Merged
zhaoyang-star merged 5 commits intoPaddlePaddle:developfrom Apr 18, 2021
Merged
[OpenCL] Set flush period of command queue #5905zhaoyang-star merged 5 commits intoPaddlePaddle:developfrom
zhaoyang-star merged 5 commits intoPaddlePaddle:developfrom
Conversation
|
Thanks for your contribution! |
ysh329
approved these changes
Apr 16, 2021
Contributor
ysh329
left a comment
There was a problem hiding this comment.
LGTM,这个和program.cc里的有重复,可以考虑将program.cc里的Flush移除保留这里
daming5432
approved these changes
Apr 16, 2021
Collaborator
Author
在 program.cc 中没有找到对命令队列人工刷新的代码,还请确认。 |
zhaoyang-star
added a commit
that referenced
this pull request
Apr 18, 2021
This reverts commit 34b96de.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
【背景】
OpenCL kernel从CPU提交到任务队列后会经历Queued/Submitted/Ready/Running等整个执行状态。对于某个算子从入队等待到真正执行是有延迟的,具体延迟情况依赖厂商平台调度。
刷新命令队列的周期是一个经验值,并没有理论指导,更多地需要结合实际测试数据选取合适的刷新周期。
其他框架设定的刷新周期也不统一,如:
【本PR内容】

实测数据发现,刷新周期对性能的提升很有限,但不会降低性能。因此本次设置:不区分 gpu 类型,定时刷新命令队列,周期是 10.
下图是在 kirin990 和 865 上 armv7 执行 ssd_mobilenetv3 模型的 Paddle-Lite 耗时: