-
Notifications
You must be signed in to change notification settings - Fork 334
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
two questions about the indirection in dwconv #236
Comments
I'd need to look closer into 1. Regarding 2. |
@Maratyszcza Thanks for your reply. I didn't notice the 'size_t' type. So using unsigned type here can reduce one branch which should have been added, right? |
Right, using unsigned type removes half of comparisons (and branches) |
Thansk, I get this brilliant trick. What about the first problem? |
The first problem is a bug. It should be |
@Maratyszcza got it. Thanks! |
Fixed in 03ff294 |
I'm trying to understand the indirect convolution algorithm used in xnnpack. It's a cool idea to implement convolution and thanks for contributing this project!
During the code reading, I find a few questions about the implementation of indirect convolution. I list them below.
in XNNPACK/bench/f32-dwconv.cc, line 69
I think the
step_height
represents how many pointers are for one single row of the output. But I cannot understand why it is calculated askernel_size + (output_width * step_width - 1) * kernel_height
. If I understand it correctly, it should bekernel_size + ((output_width-1) * step_width) * kernel_height
. The firstkernel_size
is for one complete convolution window and the following part computes how many new pointers are needed in each step. Please correct me if I do wrong.in XNNPACK/src/indirection.c: xnn_indirection_init_dwconv2d
In this function, we compute the input spatial location
(input_x, input_y)
. The code checks if it's outside the input(input_x < input_width, input_y < input_height
) but it does not compareinput_x
andinput_y
to zero. For example, when we compute the input spatial location for the output location(0, 0)
and the padding size is not zero(input_padding_top>0, input_padding_left>0
), theinput_x
andinput_y
will be negative. Is the corresponding address used to setindirection_buffer
right in this situation?The text was updated successfully, but these errors were encountered: