-
Notifications
You must be signed in to change notification settings - Fork 4.3k
flexible coopmat mnk and unified elempack for vulkan convolution 1x1s1d1 #6154
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
Conversation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6154 +/- ##
==========================================
- Coverage 95.78% 95.77% -0.01%
==========================================
Files 835 835
Lines 264943 265103 +160
==========================================
+ Hits 253783 253910 +127
- Misses 11160 11193 +33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The binary size change of libncnn.so (bytes)
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates flexible cooperative matrix (coopmat) support into the Vulkan 1x1 convolution path by selecting optimal M/N/K tile sizes at runtime and unifying specialized shaders into a single generic shader that handles different element and output packs.
- Added
get_optimal_cooperative_matrix_mnk
utility inGpuInfo
to pick best coopmat dimensions. - Replaced two fixed-size pack4 shaders with one parameterized
convolution_1x1s1d1_cm.comp
. - Extended
Convolution_vulkan
to configure, pack weight and dispatch the unified shader using dynamic M/N/K and elempack settings.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/gpu.cpp | Implemented runtime coopmat MNK selection and fallback to fp32 |
src/gpu.h | Declared new get_optimal_cooperative_matrix_mnk utility |
src/layer/vulkan/shader/convolution_1x1s1d1_cm.comp | Added a single unified 1x1 coopmat shader with dynamic tile sizes |
src/layer/vulkan/convolution_vulkan.h | Added coopmat config members (use_cooperative_matrix , coopmat_* , UNROLL_* ) |
src/layer/vulkan/convolution_vulkan.cpp | Hooked up coopmat parameters, weight packing, pipeline creation and dispatch logic |
Comments suppressed due to low confidence (2)
src/layer/vulkan/convolution_vulkan.h:62
- [nitpick] Member names like
UNROLL_SG_M
use uppercase and underscores, which is inconsistent with the project's camelCase field naming. Consider renaming tounrollSgM
or similar for consistency.
int UNROLL_SG_M;
src/gpu.h:385
- [nitpick] Consider adding documentation comments explaining each parameter and the return behavior of
get_optimal_cooperative_matrix_mnk
, as its signature is complex and understanding M/N/K selection logic will aid future maintainers.
void get_optimal_cooperative_matrix_mnk(int M, int N, int K, VkComponentTypeKHR type, VkComponentTypeKHR acctype, VkScopeKHR scope, int& coopmat_M, int& coopmat_N, int& coopmat_K) const;
No description provided.