-
Notifications
You must be signed in to change notification settings - Fork 314
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
fma relu combination for convolution-output #31
Changes from 3 commits
bdc4619
267ae02
cdeaac7
214a66f
51922c5
01f5e59
f68d944
2731511
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 |
---|---|---|
|
@@ -391,6 +391,7 @@ static void compute_convolution_output( | |
|
||
enum nnp_status nnp_convolution_output( | ||
enum nnp_convolution_algorithm algorithm, | ||
enum nnp_activation activation, | ||
size_t batch_size, | ||
size_t input_channels, | ||
size_t output_channels, | ||
|
@@ -454,14 +455,32 @@ enum nnp_status nnp_convolution_output( | |
case nnp_convolution_algorithm_ft8x8: | ||
input_transform_function = nnp_hwinfo.transforms.fft8x8_and_stream; | ||
kernel_transform_function = nnp_hwinfo.transforms.fft8x8_and_stream; | ||
output_transform_function = nnp_hwinfo.transforms.ifft8x8_with_bias; | ||
switch (activation) { | ||
case nnp_activation_relu: | ||
output_transform_function = nnp_hwinfo.transforms.ifft8x8_with_bias_with_relu; | ||
break; | ||
case nnp_activation_identity: | ||
output_transform_function = nnp_hwinfo.transforms.ifft8x8_with_bias; | ||
break; | ||
default: | ||
goto cleanup; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
transform_tile = (struct nnp_size) { .height = 8, .width = 8 }; | ||
fourier_transform = true; | ||
break; | ||
case nnp_convolution_algorithm_ft16x16: | ||
input_transform_function = nnp_hwinfo.transforms.fft16x16_and_stream; | ||
kernel_transform_function = nnp_hwinfo.transforms.fft16x16_and_stream; | ||
output_transform_function = nnp_hwinfo.transforms.ifft16x16_with_bias; | ||
switch (activation) { | ||
case nnp_activation_relu: | ||
output_transform_function = nnp_hwinfo.transforms.ifft16x16_with_bias_with_relu; | ||
break; | ||
case nnp_activation_identity: | ||
output_transform_function = nnp_hwinfo.transforms.ifft16x16_with_bias; | ||
break; | ||
default: | ||
goto cleanup; | ||
} | ||
transform_tile = (struct nnp_size) { .height = 16, .width = 16 }; | ||
fourier_transform = true; | ||
break; | ||
|
@@ -473,6 +492,16 @@ enum nnp_status nnp_convolution_output( | |
input_transform_function = nnp_hwinfo.transforms.iwt_f6x6_3x3_and_stream; | ||
kernel_transform_function = nnp_hwinfo.transforms.kwt_f6x6_3x3; | ||
output_transform_function = nnp_hwinfo.transforms.owt_f6x6_3x3_with_bias; | ||
switch (activation) { | ||
case nnp_activation_relu: | ||
output_transform_function = nnp_hwinfo.transforms.owt_f6x6_3x3_with_bias_with_relu; | ||
break; | ||
case nnp_activation_identity: | ||
output_transform_function = nnp_hwinfo.transforms.owt_f6x6_3x3_with_bias; | ||
break; | ||
default: | ||
goto cleanup; | ||
} | ||
transform_tile = (struct nnp_size) { .height = 8, .width = 8 }; | ||
fourier_transform = false; | ||
break; | ||
|
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.
Is the order correct? In
include/nnpack.h
activation is the second argument