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

[OpenCL] fix opencl init bugs & optimize :do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config. #10557

Merged

Conversation

xiebaiyuan
Copy link
Collaborator

@xiebaiyuan xiebaiyuan commented Aug 15, 2024

PR devices

OpenCL

PR types

opencl runtime optimize and bug fix.

PR changes

Backends

Description

[OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.

  1. create opencl runtime and context when use , avoid of static loading.
  2. if use an arm model , do not create opencl runtime / context.
  3. when find opencl target kernel , create opencl.
  4. when opencl env check found, enable opencl
  5. default make option on, to let user feel nothing. add api for Professional users

…cl models

1. add one way to allow use to close opencl, to reduce memory.
2. create opencl runtime and context when use , avoid of static loading.
3. if use an arm model , do not create opencl runtime / context.
4. when find opencl target kernel , create opencl.
test=develop
…use Use opencl. auto enable opencl when opencl model load and opencl check or config.

1. create opencl runtime and context when use , avoid of static loading.
2. if use an arm model , do not create opencl runtime / context.
3. when find opencl target kernel , create opencl.
4. when opencl env check found, enable opencl
test=develop
Copy link

paddle-bot bot commented Aug 15, 2024

Thanks for your contribution!

…use Use opencl. auto enable opencl when opencl model load and opencl check or config.

5. default make option on, to let user feel nothing. add api for Professional users
test=develop
…use Use opencl. auto enable opencl when opencl model load and opencl check or config.

5. only reset flag once
test=develop
lite/api/paddle_api.cc Outdated Show resolved Hide resolved
lite/api/paddle_api.cc Outdated Show resolved Hide resolved
lite/backends/opencl/cl_context.h Outdated Show resolved Hide resolved
lite/backends/opencl/cl_global.h Outdated Show resolved Hide resolved
lite/backends/opencl/cl_global.h Outdated Show resolved Hide resolved
lite/core/context.h Outdated Show resolved Hide resolved
lite/core/context.h Outdated Show resolved Hide resolved
lite/backends/opencl/cl_context.h Outdated Show resolved Hide resolved
lite/core/program.h Outdated Show resolved Hide resolved
lite/core/program.h Outdated Show resolved Hide resolved
lite/api/paddle_api.h Outdated Show resolved Hide resolved
lite/core/context.h Outdated Show resolved Hide resolved
lite/core/context.h Outdated Show resolved Hide resolved
…use Use opencl. auto enable opencl when opencl model load and opencl check or config.

6.fix pr review
test=develop
…use Use opencl. auto enable opencl when opencl model load and opencl check or config.

6.fix pr review
test=develop
…use Use opencl. auto enable opencl when opencl model load and opencl check or config.

6.fix pr review
test=develop
…use Use opencl. auto enable opencl when opencl model load and opencl check or config.

6.fix pr review
test=develop
…use Use opencl. auto enable opencl when opencl model load and opencl check or config.

6.fix pr review
test=develop
…use Use opencl. auto enable opencl when opencl model load and opencl check or config.

6.fix pr review
test=develop
…use Use opencl. auto enable opencl when opencl model load and opencl check or config.

6.fix pr review
test=develop
…use Use opencl. auto enable opencl when opencl model load and opencl check or config.

6.fix pr review
test=develop
@xiebaiyuan
Copy link
Collaborator Author

@hong19860320 fix all issues as comments.

@xiebaiyuan xiebaiyuan closed this Aug 19, 2024
@xiebaiyuan xiebaiyuan reopened this Aug 19, 2024
Copy link
Collaborator

@hong19860320 hong19860320 left a comment

Choose a reason for hiding this comment

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

LGTM

@PaddlePaddle PaddlePaddle locked as resolved and limited conversation to collaborators Aug 20, 2024
@PaddlePaddle PaddlePaddle unlocked this conversation Aug 20, 2024
@hong19860320 hong19860320 merged commit f6eb176 into PaddlePaddle:develop Aug 23, 2024
16 of 44 checks passed
hong19860320 pushed a commit that referenced this pull request Aug 26, 2024
* [Doc] fix doc/index.rst (#10530)

Co-authored-by: chenhuan09 <chenhuan09@baidu.com>

* [PASS] xpu__fc_fuse_pass batchnorm fusion (#10532)

* [XPU] modify xpu_fc_pass to fused bn to xpu_fc

* [XPU] add int8 support for bn fc fusion

* [XPU] fix codestyle

* [XPU] remove unused code

* [OpenCL] Fix multi-thread CL_INVALID_CONTEXT (#10529)

* [Metal] Fix project build metal shader bugs (#10544)

* [Metal] Fix concat error, fix fetch typo error (#10541)
* [Metal] fix build_xcode.sh error, add building with metal option (#10542)

* [XPU] Add greedy L3 tune strategy (#10546)

* support search gan model. 1.add pixel_unshuffle support &2.enable fill_constant calc offline on arm and opencl & 3.enable reshape_calc_offline_pass on arm and opencl  (#10537)

* support search gan model.
1. add pixel_unshuffle support
2. enable fill_constant calc offline on arm and opencl
3. enable reshape_calc_offline_pass on arm and opencl
4. use chinese comments
5. add test for new kernel.
test=develop

* support search gan model.
1. add pixel_unshuffle support
2. enable fill_constant calc offline on arm and opencl
3. enable reshape_calc_offline_pass on arm and opencl
4. use chinese comments
5. add test for new kernel.
test=develop

* support search gan model.
1. add pixel_unshuffle support
2. enable fill_constant calc offline on arm and opencl
3. enable reshape_calc_offline_pass on arm and opencl
4. use chinese comments
5. add test for new kernel.
6. fix metal pre-commit
test=develop

* [Doc] Update python_demo.md (#10555)

* [OpenCL] fix opencl init bugs & optimize :do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config. (#10557)

* [OpenCL]do not init OpenCL runtime if use a arm only model, when LITE_WITH_OPENCL ENABLED

test=develop

* [OpenCL] fix opencl init bugs. reduce opencl memory when not use opencl models
1. add one way to allow use to close opencl, to reduce memory.
2. create opencl runtime and context when use , avoid of static loading.
3. if use an arm model , do not create opencl runtime / context.
4. when find opencl target kernel , create opencl.
test=develop

* [OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.

1. create opencl runtime and context when use , avoid of static loading.
2. if use an arm model , do not create opencl runtime / context.
3. when find opencl target kernel , create opencl.
4. when opencl env check found, enable opencl
test=develop

* [OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.
5. default make option on, to let user feel nothing. add api for Professional users
test=develop

* [OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.
5. only reset flag once
test=develop

* [OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.
6.fix pr review
test=develop

* [OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.
6.fix pr review
test=develop

* [OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.
6.fix pr review
test=develop

* [OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.
6.fix pr review
test=develop

* [OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.
6.fix pr review
test=develop

* [OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.
6.fix pr review
test=develop

* [OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.
6.fix pr review
test=develop

* [OpenCL] fix opencl init bugs. do not create opencl when user do not use Use opencl. auto enable opencl when opencl model load and opencl check or config.
6.fix pr review
test=develop

---------

Co-authored-by: cmcamdy <1027740945@qq.com>
Co-authored-by: chenhuan09 <chenhuan09@baidu.com>
Co-authored-by: GaoYuYang <gaomeyy@gmail.com>
Co-authored-by: wasupandceacar <wasupandceacar@gmail.com>
Co-authored-by: newway <237745+newway@users.noreply.github.com>
Co-authored-by: xiebaiyuan <xiebaiyuan@139.com>
Co-authored-by: Kayzwer <68285002+Kayzwer@users.noreply.github.com>
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