Skip to content

unified vulkan khr/nv cooperative matrix shader#6116

Merged
nihui merged 1 commit into
Tencent:masterfrom
nihui:unified-cm-khr-nv
Jun 11, 2025
Merged

unified vulkan khr/nv cooperative matrix shader#6116
nihui merged 1 commit into
Tencent:masterfrom
nihui:unified-cm-khr-nv

Conversation

@nihui

@nihui nihui commented Jun 11, 2025

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request removes a number of shader files that implement various convolution and deconvolution operations using both NV and CM cooperative matrix extensions, moving toward a unified approach that conditionally handles VK_KHR and NV cooperative matrix features.

  • Removed shader implementations for deconvolution, convolution, winograd transforms, and 1x1 convolutions that were specific to NV and CM variants.
  • The changes use preprocessor conditionals (e.g. #if ncnn_VK_KHR_cooperative_matrix / #elif ncnn_VK_NV_cooperative_matrix) to manage the different cooperative matrix approaches.

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/layer/vulkan/shader/deconvolution_pack4_gemm_nv_cm_16_8_8.comp Removed NV-specific deconvolution shader
src/layer/vulkan/shader/deconvolution_pack4_gemm_nv_cm_16_16_16.comp Removed NV-specific deconvolution shader
src/layer/vulkan/shader/deconvolution_pack4_gemm_cm_16_8_8.comp Removed CM shader file with conditional cooperative matrix support
src/layer/vulkan/shader/deconvolution_pack4_gemm_cm_16_16_16.comp Removed CM shader file with conditional cooperative matrix support
src/layer/vulkan/shader/convolution_pack4_gemm_nv_cm_16_8_8.comp Removed NV-specific convolution shader
src/layer/vulkan/shader/convolution_pack4_gemm_nv_cm_16_16_16.comp Removed NV-specific convolution shader
src/layer/vulkan/shader/convolution_pack4_gemm_cm_16_8_8.comp Removed CM shader file with conditional cooperative matrix support
src/layer/vulkan/shader/convolution_pack4_gemm_cm_16_16_16.comp Removed CM shader file with conditional cooperative matrix support
src/layer/vulkan/shader/convolution_pack4_3x3s1d1_winograd_gemm_nv_cm_16_8_8.comp Removed NV-specific Winograd convolution shader
src/layer/vulkan/shader/convolution_pack4_3x3s1d1_winograd_gemm_nv_cm_16_16_16.comp Removed NV-specific Winograd convolution shader
src/layer/vulkan/shader/convolution_pack4_3x3s1d1_winograd_gemm_cm_16_8_8.comp Removed CM shader file with conditional cooperative matrix support for Winograd convolution
src/layer/vulkan/shader/convolution_pack4_3x3s1d1_winograd_gemm_cm_16_16_16.comp Removed CM shader file with conditional cooperative matrix support for Winograd convolution
src/layer/vulkan/shader/convolution_pack4_1x1s1d1_nv_cm_16_8_8.comp Removed NV-specific 1x1 convolution shader
src/layer/vulkan/shader/convolution_pack4_1x1s1d1_nv_cm_16_16_16.comp Removed NV-specific 1x1 convolution shader
src/layer/vulkan/shader/convolution_pack4_1x1s1d1_cm_16_8_8.comp Removed CM shader file with conditional cooperative matrix support for 1x1 convolution

@codecov-commenter

codecov-commenter commented Jun 11, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 39.13043% with 28 lines in your changes missing coverage. Please review.

Project coverage is 95.85%. Comparing base (b9f98f0) to head (76ba62c).

Files with missing lines Patch % Lines
src/gpu.cpp 50.00% 18 Missing ⚠️
src/layer/vulkan/convolution_vulkan.cpp 0.00% 8 Missing ⚠️
src/layer/vulkan/deconvolution_vulkan.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6116   +/-   ##
=======================================
  Coverage   95.84%   95.85%           
=======================================
  Files         829      829           
  Lines      270492   270472   -20     
=======================================
+ Hits       259264   259266    +2     
+ Misses      11228    11206   -22     

☔ 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.

@github-actions

Copy link
Copy Markdown

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 16499656 16466160 -33496 😘
armhf 7384308 7350836 -33472 😘
aarch64 10778064 10711680 -66384 😘

@nihui
nihui merged commit 9cdc02b into Tencent:master Jun 11, 2025
106 of 109 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants