Skip to content
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

[IE CLDNN] Extend resample int8 packing optimization #1662

Merged
merged 1 commit into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ static size_t packing_factor(const resample_params& params) {
size_t input_factor = get_layout_packing_factor(params.inputs[0].GetLayout());
size_t output_factor = get_layout_packing_factor(params.output.GetLayout());

return std::min(input_factor, output_factor);
if (input_factor % output_factor == 0 || output_factor % input_factor == 0)
return std::min(input_factor, output_factor);
return 1;
}

static bool use_packing(const resample_params& params) {
Expand All @@ -83,8 +85,7 @@ static bool use_packing(const resample_params& params) {
if (pack == 1)
return false;

if (params.inputs[0].Feature().v % pack != 0 || params.output.Feature().v % pack != 0 ||
params.inputs[0].Feature().pad.before % pack != 0 || params.output.Feature().pad.before % pack != 0)
if (params.inputs[0].Feature().pad.before % pack != 0 || params.output.Feature().pad.before % pack != 0)
return false;

auto packed_work_items = params.output.X().v * params.output.Y().v * params.output.Z().v
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,4 +775,6 @@ INSTANTIATE_TEST_CASE_P(smoke,

.smoke_params(data_types::f32, format::b_fs_yx_fsv16, format::b_fs_yx_fsv16)
.smoke_params(data_types::f16, format::b_fs_yx_fsv16, format::b_fs_yx_fsv16)
.smoke_params(data_types::i8, format::b_fs_yx_fsv16, format::b_fs_yx_fsv16)
.smoke_params(data_types::u8, format::b_fs_yx_fsv16, format::b_fs_yx_fsv16)
), );