metal : add CONV_2D_DW (depthwise convolution) support (#21565)

* metal : add CONV_2D_DW (depthwise 2D convolution) support

* test : add perf cases for CONV_2D_DW

* metal : use 3D dispatch for CONV_2D_DW kernel

* metal : add channel-tiled CONV_2D_DW kernel for non-contiguous layouts

* metal : simplify CONV_2D_DW dispatch and trim comments

* metal : merge duplicate CONV_2D_DW pipeline getters

* tests : add F16 CONV2D_DW tests

* cpu : fix F16 kernel support for CONV_2D_DW

* tests : remove commented-out CONV_2D_DW test block

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
Sou-ly
2026-07-09 12:29:15 +03:00
committed by GitHub
co-authored by Georgi Gerganov
parent ccb0c34223
commit 92b187c97e
9 changed files with 381 additions and 21 deletions
+28
View File
@@ -656,6 +656,34 @@ typedef struct {
int32_t d1;
} ggml_metal_kargs_conv_2d;
typedef struct {
uint64_t nb00; // kernel strides
uint64_t nb01;
uint64_t nb02;
uint64_t nb10; // input strides
uint64_t nb11;
uint64_t nb12;
uint64_t nb13;
uint64_t nb0; // output strides
uint64_t nb1;
uint64_t nb2;
uint64_t nb3;
int32_t IW; // input width
int32_t IH; // input height
int32_t KW; // kernel width
int32_t KH; // kernel height
int32_t C; // channels (IC == OC for depthwise)
int32_t OW; // output width
int32_t OH; // output height
int32_t N; // batch size
int32_t s0; // stride x
int32_t s1; // stride y
int32_t p0; // padding x
int32_t p1; // padding y
int32_t d0; // dilation x
int32_t d1; // dilation y
} ggml_metal_kargs_conv_2d_dw;
typedef struct {
uint64_t ofs0;
uint64_t ofs1;