- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.4k
 
Depthwise 2D convolution #1152
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
Depthwise 2D convolution #1152
Changes from 2 commits
352c9c0
              0af1433
              ac6beac
              084bfe1
              c202573
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| 
          
            
          
           | 
    @@ -6064,6 +6064,174 @@ void ggml_compute_forward_conv_transpose_2d( | |||||
| } | ||||||
| } | ||||||
| 
     | 
||||||
| // ggml_compute_forward_depthwise_conv_2d | ||||||
| 
     | 
||||||
| struct ggml_depthwise_conv_2d_params { | ||||||
                
       | 
||||||
| int64_t channels; | ||||||
| int64_t batch; | ||||||
| int64_t src_w; | ||||||
| int64_t src_h; | ||||||
| int64_t dst_w; | ||||||
| int64_t dst_h; | ||||||
| int64_t knl_w; | ||||||
| int64_t knl_h; | ||||||
| int stride_x; | ||||||
| int stride_y; | ||||||
| int pad_x; | ||||||
| int pad_y; | ||||||
| }; | ||||||
| 
     | 
||||||
| static void ggml_compute_forward_depthwise_conv_2d_cwhn( | ||||||
| const struct ggml_compute_params * params, | ||||||
| const struct ggml_tensor * src, | ||||||
| const struct ggml_tensor * kernel, | ||||||
| struct ggml_tensor * dst, | ||||||
| const struct ggml_depthwise_conv_2d_params p) { | ||||||
                
       | 
||||||
| const struct ggml_depthwise_conv_2d_params p) { | |
| const ggml_depthwise_conv_2d_params & p) { | 
        
          
              
                Outdated
          
        
      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.
| const struct ggml_depthwise_conv_2d_params p) { | |
| const ggml_depthwise_conv_2d_params & p) { | 
        
          
              
                Outdated
          
        
      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.
| float sum = 0.0f; | |
| float sum = 0.0f; | 
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.
Could we rename this to something closer to the current naming scheme? Something like
ggml_conv_2d_dw_director similar. It would be a temporary name until we unify the different conv2d implementations into a single op.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.
Will do.
Is there a preference on which order to use for tensor dimensions in comments and function names? When working on ggml I find it less confusing to stick with
tensor->neorder, but things likeNCHWandNHWCare commonly used to describe memory layout across frameworks and in literature.