[OpenCL] Set flush period of command queue #5905
Merged
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 耗时: