Skip to content

fix cm pipeline compilation failure on adreno#6720

Open
nihui wants to merge 1 commit into
Tencent:masterfrom
nihui:fix-adreno-cm
Open

fix cm pipeline compilation failure on adreno#6720
nihui wants to merge 1 commit into
Tencent:masterfrom
nihui:fix-adreno-cm

Conversation

@nihui
Copy link
Copy Markdown
Member

@nihui nihui commented May 12, 2026

large tile sizes on adreno gpu cause excessive shared memory usage when loops are unrolled. disabling unroll specifically for the adreno to prevent compilation errors.

@tencent-adm
Copy link
Copy Markdown
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 12, 2026

Codecov Report

❌ Patch coverage is 17.64706% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.91%. Comparing base (421de78) to head (f83ba09).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/layer/vulkan/convolution_vulkan.cpp 16.66% 15 Missing ⚠️
src/layer/vulkan/convolution1d_vulkan.cpp 16.66% 10 Missing ⚠️
src/layer/vulkan/sdpa_vulkan.cpp 22.22% 7 Missing ⚠️
src/layer/vulkan/deconvolution_vulkan.cpp 16.66% 5 Missing ⚠️
src/layer/vulkan/gemm_vulkan.cpp 16.66% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #6720    +/-   ##
========================================
  Coverage   93.90%   93.91%            
========================================
  Files         933      933            
  Lines      310041   309919   -122     
========================================
- Hits       291140   291047    -93     
+ Misses      18901    18872    -29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nihui
Copy link
Copy Markdown
Member Author

nihui commented May 12, 2026

HNBKQ:/data/local/tmp $ ./benchncnn 4 1 2 0 0                                                                                                                                                                                                                                                                              
[0] apiVersion = 1.4.295
[0] driverVersion = 512.842.25
[0] vendorID = 5143
[0] deviceID = 44050a31
[0] deviceType = 1
[0] deviceName = Adreno (TM) 840
[0] pipelineCacheUUID = 849392164
[0 Adreno (TM) 840]  queueC=1[1]  queueT=0[4]  rebar=1  r-score=21
[0 Adreno (TM) 840]  fp16-p/s/u/a=1/1/0/1  int8-p/s/u/a=1/1/0/1  bf16-p/s=1/0
[0 Adreno (TM) 840]  subgroup=64(64~64)  ops=1/1/1/1/1/1/1/1/1/1
[0 Adreno (TM) 840]  fp16-cm=0  int8-cm=0  bf16-cm=0  fp8-cm=0
loop_count = 4
num_threads = 1
powersave = 2
gpu_device = 0
cooling_down = 0
          squeezenet  min =    3.02  max =    3.22  avg =    3.11
           mobilenet  min =    4.69  max =    4.76  avg =    4.73
        mobilenet_v2  min =    4.18  max =    4.25  avg =    4.21
        mobilenet_v3  min =    4.30  max =    4.38  avg =    4.33
          shufflenet  min =    3.58  max =    3.91  avg =    3.78
       shufflenet_v2  min =    3.39  max =    3.41  avg =    3.40
             mnasnet  min =    4.15  max =    4.23  avg =    4.19
     proxylessnasnet  min =    4.39  max =    4.48  avg =    4.43
     efficientnet_b0  min =    6.41  max =    6.50  avg =    6.45
   efficientnetv2_b0  min =    9.02  max =    9.22  avg =    9.07
        regnety_400m  min =    5.11  max =    5.29  avg =    5.19
           blazeface  min =    1.70  max =    1.71  avg =    1.70
           googlenet  min =    8.36  max =    8.41  avg =    8.38
            resnet18  min =    5.11  max =    5.18  avg =    5.14
             alexnet  min =    5.83  max =    5.92  avg =    5.88
               vgg16  min =   23.70  max =   24.06  avg =   23.93
            resnet50  min =   14.60  max =   16.90  avg =   15.85
      squeezenet_ssd  min =    7.30  max =    7.42  avg =    7.36
       mobilenet_ssd  min =    9.28  max =    9.43  avg =    9.37
      mobilenet_yolo  min =   15.72  max =   19.20  avg =   17.64
  mobilenetv2_yolov3  min =   13.95  max =   14.29  avg =   14.09
         yolov4-tiny  min =   17.87  max =   19.68  avg =   19.18
           nanodet_m  min =    8.57  max =    8.86  avg =    8.67
    yolo-fastest-1.1  min =    3.44  max =    3.47  avg =    3.46
      yolo-fastestv2  min =    3.23  max =    3.37  avg =    3.29
  vision_transformer  min =   35.77  max =   37.59  avg =   36.26
          FastestDet  min =    3.14  max =    3.30  avg =    3.19
HNBKQ:/data/local/tmp $ ./benchncnn 4 1 2 0 0                                                                                                                                                                                                                                                                              
[0] apiVersion = 1.4.295
[0] driverVersion = 512.842.25
[0] vendorID = 5143
[0] deviceID = 44050a31
[0] deviceType = 1
[0] deviceName = Adreno (TM) 840
[0] pipelineCacheUUID = 1130390036
[0 Adreno (TM) 840]  queueC=1[1]  queueT=0[4]  rebar=1  r-score=21
[0 Adreno (TM) 840]  fp16-p/s/u/a=1/1/0/1  int8-p/s/u/a=1/1/0/1  bf16-p/s=1/0
[0 Adreno (TM) 840]  subgroup=64(64~64)  ops=1/1/1/1/1/1/1/1/1/1
[0 Adreno (TM) 840]  fp16-cm=64x64x16/64x32x16/64x16x16  int8-cm=64x64x32/64x32x32/64x16x32  bf16-cm=0  fp8-cm=0
loop_count = 4
num_threads = 1
powersave = 2
gpu_device = 0
cooling_down = 0

^C
130|HNBKQ:/data/local/tmp $ ./benchncnn 4 1 2 0 0                                                                                                                                                                                                                                                                          
[0] apiVersion = 1.4.295
[0] driverVersion = 512.842.25
[0] vendorID = 5143
[0] deviceID = 44050a31
[0] deviceType = 1
[0] deviceName = Adreno (TM) 840
[0] pipelineCacheUUID = 862003764
[0 Adreno (TM) 840]  queueC=1[1]  queueT=0[4]  rebar=1  r-score=21
[0 Adreno (TM) 840]  fp16-p/s/u/a=1/1/0/1  int8-p/s/u/a=1/1/0/1  bf16-p/s=1/0
[0 Adreno (TM) 840]  subgroup=64(64~64)  ops=1/1/1/1/1/1/1/1/1/1
[0 Adreno (TM) 840]  fp16-cm=64x64x16/64x32x16/64x16x16  int8-cm=64x64x32/64x32x32/64x16x32  bf16-cm=0  fp8-cm=0
loop_count = 4
num_threads = 1
powersave = 2
gpu_device = 0
cooling_down = 0
          squeezenet  min =    1.74  max =    1.87  avg =    1.78
           mobilenet  min =    2.41  max =    2.62  avg =    2.53
        mobilenet_v2  min =    3.50  max =    3.68  avg =    3.62
        mobilenet_v3  min =    3.17  max =    3.38  avg =    3.28
          shufflenet  min =    2.16  max =    2.22  avg =    2.19
       shufflenet_v2  min =    2.56  max =    2.74  avg =    2.62
             mnasnet  min =    3.16  max =    3.91  avg =    3.47
     proxylessnasnet  min =    3.12  max =    3.67  avg =    3.50
     efficientnet_b0  min =    5.61  max =    5.82  avg =    5.68
   efficientnetv2_b0  min =    7.68  max =    8.88  avg =    8.05
        regnety_400m  min =    4.43  max =    4.66  avg =    4.50
           blazeface  min =    1.19  max =    1.22  avg =    1.21
           googlenet  min =    6.47  max =    6.65  avg =    6.58
            resnet18  min =    3.93  max =    3.98  avg =    3.96
             alexnet  min =    5.59  max =    5.79  avg =    5.69
               vgg16  min =   15.00  max =   18.21  avg =   16.73
            resnet50  min =    8.79  max =    9.30  avg =    8.96
      squeezenet_ssd  min =    6.05  max =    6.12  avg =    6.08
       mobilenet_ssd  min =    5.59  max =    5.70  avg =    5.62
      mobilenet_yolo  min =    7.05  max =    7.16  avg =    7.11
  mobilenetv2_yolov3  min =   11.86  max =   12.29  avg =   12.07
         yolov4-tiny  min =    5.39  max =    5.51  avg =    5.44
           nanodet_m  min =    7.70  max =    7.79  avg =    7.76
    yolo-fastest-1.1  min =    3.10  max =    3.30  avg =    3.17
      yolo-fastestv2  min =    2.52  max =    2.79  avg =    2.68
  vision_transformer  min =   29.49  max =   30.22  avg =   29.84
          FastestDet  min =    2.19  max =    2.41  avg =    2.24

@nihui
Copy link
Copy Markdown
Member Author

nihui commented May 12, 2026

coopMatLoad/coopMatStore layout that depends on push constant breaks adreno driver

vkCreateComputePipelines failed -13

if (p.elempack == 4)
{
    coopMatStore(sum, tmp, 0, stride, gl_CooperativeMatrixLayoutColumnMajor);
}
else
{
    coopMatStore(sum, tmp, 0, stride, gl_CooperativeMatrixLayoutRowMajor);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants