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

Global work group size is not evenly divisible by local work group size #9380

Closed
engineer1109 opened this issue Aug 26, 2022 · 7 comments
Closed
Assignees

Comments

@engineer1109
Copy link
Contributor

   1)Paddle Lite 版本:develop(v2.11)
   2)Host 环境:Ubuntu20.04 x64
   3)运行设备环境:/
   4)预测后端信息: Intel 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40Ghz

  • 预测信息
       1)预测 API:C++
       2)预测选项信息:OpenCL
       3)预测库来源:源码编译 ./lite/tools/build_linux.sh --arch=x86 --with_opencl=ON --with_log=ON --with_extra=ON full_publish

  • 复现信息:ResNet50(官方模型生成) 输入推断。

  • 问题描述:

I0826 09:43:00.282701 11272 cl_context.cc:38] --- to get program image/matmul_opt_kernel.cl ---
I0826 09:43:00.282702 11272 cl_runtime.cc:156] precision_: CL_PRECISION_FP32
I0826 09:43:00.282704 11272 cl_runtime.cc:157] OpenCL build_option: -DUSE_IMAGE_Y -DADRENO_HIGH -cl-fast-relaxed-math -cl-mad-enable -DCL_DTYPE_float -DCL_DTYPE_FLOAT_FORCE
I0826 09:43:00.282713 11272 cl_runtime.cc:341] OpenCL kernel file name: image/matmul_opt_kernel.cl
I0826 09:43:00.282716 11272 cl_runtime.cc:342] Program source size: 7566
I0826 09:43:00.282716 11272 cl_runtime.cc:323] --- begin build program from source -> image/matmul_opt_kernel.cl -DUSE_IMAGE_Y -DADRENO_HIGH -cl-fast-relaxed-math -cl-mad-enable -DCL_DTYPE_float -DCL_DTYPE_FLOAT_FORCE ---
I0826 09:43:00.297749 11272 cl_context.cc:42] --- end get program ---
I0826 09:43:00.297763 11272 cl_context.cc:43] --- to create kernel: matmul ---
I0826 09:43:00.297873 11272 cl_context.cc:49] --- end create kernel ---
I0826 09:43:00.297883 11272 cl_context.cc:59] --- kernel count: 97 ---
I0826 09:43:00.297901 11272 matmul_image_compute.cc:461] local_work_size[3D]: 8 4 16
I0826 09:43:00.297904 11272 matmul_image_compute.cc:463] global_work_size[3D]: 1 4 3
OCL 3740875: Global work group size is not evenly divisible by local work group size
F0826 09:43:00.298005 11272 matmul_image_compute.cc:542] OpenCL error with code CL_INVALID_WORK_GROUP_SIZE happened in file /home/wjl/github/Paddle-Lite/lite/kernels/opencl/matmul_image_compute.cc at line 542. Exiting.
*** Check failure stack trace: ***

OpenCL
Matmul_V2 这个算子是不是写错了, local_work_size global_work_size 出现除不了的情况

@paddle-bot
Copy link

paddle-bot bot commented Aug 26, 2022

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网文档常见问题历史Issue来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQ and Github Issue to get the answer.Have a nice day!

@engineer1109
Copy link
Contributor Author

I0826 09:43:00.281939 11272 matmul_image_compute.cc:112] persistableY: 1, transposeY: 0
I0826 09:43:00.281944 11272 matmul_image_compute.cc:185] y_ext_dims: {2048,12}
I0826 09:43:00.281946 11272 matmul_image_compute.cc:57] fp16_support = 0
I0826 09:43:00.282686 11272 matmul_image_compute.cc:236] x_dims:{1,2048}
I0826 09:43:00.282691 11272 matmul_image_compute.cc:237] y_dims:{2048,10}
I0826 09:43:00.282693 11272 matmul_image_compute.cc:238] out_dims:{1,10}
I0826 09:43:00.282696 11272 matmul_image_compute.cc:239] transpose_X:0
I0826 09:43:00.282697 11272 matmul_image_compute.cc:240] transpose_Y:0
I0826 09:43:00.282699 11272 matmul_image_compute.cc:348] batch:1, m_:1, k_:2048, n_:10
I0826 09:43:00.282701 11272 cl_context.cc:38] --- to get program image/matmul_opt_kernel.cl ---
I0826 09:43:00.282702 11272 cl_runtime.cc:156] precision_: CL_PRECISION_FP32
I0826 09:43:00.282704 11272 cl_runtime.cc:157] OpenCL build_option: -DUSE_IMAGE_Y -DADRENO_HIGH -cl-fast-relaxed-math -cl-mad-enable -DCL_DTYPE_float -DCL_DTYPE_FLOAT_FORCE
I0826 09:43:00.282713 11272 cl_runtime.cc:341] OpenCL kernel file name: image/matmul_opt_kernel.cl
I0826 09:43:00.282716 11272 cl_runtime.cc:342] Program source size: 7566
I0826 09:43:00.282716 11272 cl_runtime.cc:323] --- begin build program from source -> image/matmul_opt_kernel.cl -DUSE_IMAGE_Y -DADRENO_HIGH -cl-fast-relaxed-math -cl-mad-enable -DCL_DTYPE_float -DCL_DTYPE_FLOAT_FORCE ---
I0826 09:43:00.297749 11272 cl_context.cc:42] --- end get program ---
I0826 09:43:00.297763 11272 cl_context.cc:43] --- to create kernel: matmul ---
I0826 09:43:00.297873 11272 cl_context.cc:49] --- end create kernel ---
I0826 09:43:00.297883 11272 cl_context.cc:59] --- kernel count: 97 ---
I0826 09:43:00.297901 11272 matmul_image_compute.cc:461] local_work_size[3D]: 8 4 16
I0826 09:43:00.297904 11272 matmul_image_compute.cc:463] global_work_size[3D]: 1 4 3
OCL 3740875: Global work group size is not evenly divisible by local work group size
F0826 09:43:00.298005 11272 matmul_image_compute.cc:542] OpenCL error with code CL_INVALID_WORK_GROUP_SIZE happened in file /home/wjl/github/Paddle-Lite/lite/kernels/opencl/matmul_image_compute.cc at line 542. Exiting.
*** Check failure stack trace: ***

@engineer1109
Copy link
Contributor Author

global_work_size 的第一个数 要被 local_work_size的第一个数 能整除才可以 提醒下OpenCL的WorkSize问题

@engineer1109
Copy link
Contributor Author

temp fix on #9381

可以临时解决问题。
但是 是否有其他影响 需要确认。

@sprouteer
Copy link
Collaborator

好的,多谢反馈,我们尽快修复

@engineer1109
Copy link
Contributor Author

@sprouteer On the lastest develop branch, still not fixed.

I0919 18:10:01.222151 577426 matmul_image_compute.cc:112] persistableY: 1, transposeY: 0
I0919 18:10:01.222153 577426 matmul_image_compute.cc:202] y_ext_dims: {1024,1000}
I0919 18:10:01.222157 577426 matmul_image_compute.cc:57] fp16_support = 0
I0919 18:10:01.224364 577426 matmul_image_compute.cc:253] x_dims:{1,1024}
I0919 18:10:01.224370 577426 matmul_image_compute.cc:254] y_dims:{1024,1000}
I0919 18:10:01.224371 577426 matmul_image_compute.cc:255] out_dims:{1,1000}
I0919 18:10:01.224373 577426 matmul_image_compute.cc:256] transpose_X:0
I0919 18:10:01.224375 577426 matmul_image_compute.cc:257] transpose_Y:0
I0919 18:10:01.224378 577426 matmul_image_compute.cc:369] batch:1, m_:1, k_:1024, n_:1000
I0919 18:10:01.224380 577426 cl_context.cc:38]  --- to get program image/matmul_opt_kernel.cl --- 
I0919 18:10:01.224383 577426 cl_runtime.cc:156] precision_: CL_PRECISION_FP32
I0919 18:10:01.224385 577426 cl_runtime.cc:157] OpenCL build_option:  -DUSE_IMAGE_Y  -DADRENO_HIGH  -cl-fast-relaxed-math -cl-mad-enable -DCL_DTYPE_float -DCL_DTYPE_FLOAT_FORCE 
I0919 18:10:01.224395 577426 cl_runtime.cc:341] OpenCL kernel file name: image/matmul_opt_kernel.cl
I0919 18:10:01.224396 577426 cl_runtime.cc:342] Program source size: 7613
I0919 18:10:01.224398 577426 cl_runtime.cc:323]  --- begin build program from source -> image/matmul_opt_kernel.cl -DUSE_IMAGE_Y  -DADRENO_HIGH  -cl-fast-relaxed-math -cl-mad-enable -DCL_DTYPE_float -DCL_DTYPE_FLOAT_FORCE  --- 
I0919 18:10:01.225134 577426 cl_context.cc:42]  --- end get program --- 
I0919 18:10:01.225142 577426 cl_context.cc:43]  --- to create kernel: matmul --- 
I0919 18:10:01.225145 577426 cl_context.cc:49]  --- end create kernel --- 
I0919 18:10:01.225150 577426 cl_context.cc:59]  --- kernel count: 32 --- 
I0919 18:10:01.225160 577426 matmul_image_compute.cc:485] local_work_size[3D]: 8 4 16
I0919 18:10:01.225162 577426 matmul_image_compute.cc:487] global_work_size[3D]: 1 4 250
F0919 18:10:01.225169 577426 matmul_image_compute.cc:573] OpenCL error with code CL_INVALID_WORK_GROUP_SIZE happened in file /home/wjl/github/Paddle-Lite/lite/kernels/opencl/matmul_image_compute.cc at line 573. Exiting.
*** Check failure stack trace: ***

To Get the Model

Inference Model (Manual Gen by https://github.com/PaddlePaddle/PaddleClas/blob/release/2.5/tools/export_model.py)

wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/legendary_models/MobileNetV1_pretrained.pdparams
python3 tools/export_model.py -c './ppcls/configs/ImageNet/MobileNetV1/MobileNetV1.yaml' -o Global.pretrained_model=model/mobilenet_v1/MobileNetV1_pretrained

BaiduYun Link

链接: https://pan.baidu.com/s/1ypvWJTXszMYs-zzeDT08Lw?pwd=drtg 提取码: drtg

@engineer1109
Copy link
Contributor Author

#9475 Fixes

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

No branches or pull requests

3 participants