Skip to content

Commit

Permalink
[GPU] Enable disabled network fro oneDNNv2.6-pc2 (openvinotoolkit#10226)
Browse files Browse the repository at this point in the history
Some networks newly uses wtags in oneDNN.
Add g_os_is_yx_osa2_isa8_osv8_isv2

Signed-off-by: hyunback <[email protected]>
  • Loading branch information
hyunback authored Feb 10, 2022
1 parent 50dffb8 commit efbfd95
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/plugins/intel_gpu/include/intel_gpu/runtime/format.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ struct format {
gi_yxs_os_yxsv2_osv16,
giy_xs_os_xsv2_osv8__ao32,
giy_xs_os_xsv2_osv16__ao32,
g_os_is_yx_osa2_isa8_osv8_isv2,
g_os_is_yx_osa4_isa8_osv8_isv4,
g_os_is_yx_osa4_isa8_osv8_isv2,
g_os_is_yx_osa2_isa8_osv16_isv2,
Expand Down
1 change: 1 addition & 0 deletions src/plugins/intel_gpu/src/graph/impls/onednn/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ static cldnn::format convert_format(dnnl::memory::format_tag fmt, bool is_groupe
case dnnl::memory::format_tag::Abcde16a: return cldnn::format::gs_oiyx_gsv16;
case dnnl::memory::format_tag::Abcde32a: return cldnn::format::gs_oiyx_gsv32;
case dnnl::memory::format_tag::aCBde16c16b: return cldnn::format::g_is_os_yx_isv16_osv16;
case dnnl::memory::format_tag::aBCde2b8c8b2c: return cldnn::format::g_os_is_yx_osa2_isa8_osv8_isv2;
case dnnl::memory::format_tag::aBCde4b8c8b4c: return cldnn::format::g_os_is_yx_osa4_isa8_osv8_isv4;
case dnnl::memory::format_tag::aBCde4b8c8b2c: return cldnn::format::g_os_is_yx_osa4_isa8_osv8_isv2;
case dnnl::memory::format_tag::aBCd2b8c16b4c: return cldnn::format::g_os_is_yx_osa2_isa8_osv16_isv4;
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/intel_gpu/src/graph/kernel_selector_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ kernel_selector::weights_layout to_weights_layout(format f, bool is_grouped) {
return kernel_selector::weights_layout::os_is_zyx_osa4_isa8_osv8_isv2;
case format::os_is_zyx_osa4_isa8_osv8_isv4:
return kernel_selector::weights_layout::os_is_zyx_osa4_isa8_osv8_isv4;
case format::g_os_is_yx_osa2_isa8_osv8_isv2:
return kernel_selector::weights_layout::g_os_is_yx_osa2_isa8_osv8_isv2;
case format::g_os_is_yx_osa4_isa8_osv8_isv2:
return kernel_selector::weights_layout::g_os_is_yx_osa4_isa8_osv8_isv2;
case format::g_os_is_yx_osa4_isa8_osv8_isv4:
Expand Down Expand Up @@ -456,6 +458,8 @@ cldnn::format::type from_weights_layout(kernel_selector::weights_layout l) {
return cldnn::format::os_is_zyx_osa4_isa8_osv8_isv2;
case kernel_selector::weights_layout::os_is_zyx_osa4_isa8_osv8_isv4:
return cldnn::format::os_is_zyx_osa4_isa8_osv8_isv4;
case kernel_selector::weights_layout::g_os_is_yx_osa2_isa8_osv8_isv2:
return cldnn::format::g_os_is_yx_osa2_isa8_osv8_isv2;
case kernel_selector::weights_layout::g_os_is_yx_osa4_isa8_osv8_isv2:
return cldnn::format::g_os_is_yx_osa4_isa8_osv8_isv2;
case kernel_selector::weights_layout::g_os_is_yx_osa4_isa8_osv8_isv4:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ WeightsTensor::WeightsChannelArray WeightsTensor::weightsChannelArray {{
{ WeightsLayout::os_is_yx_isa8_osv16_isv4, { 0, 1, -1, 2, 3, -1 } },
{ WeightsLayout::os_is_yx_isa8_osv8_isv4_swizzled_by_4, { 0, 1, -1, 2, 3, -1 } },
{ WeightsLayout::os_is_yx_osa4_isa8_osv8_isv4, { 0, 1, -1, 2, 3, -1 } },
{ WeightsLayout::g_os_is_yx_osa2_isa8_osv8_isv2, { 0, 1, -1, 2, 3, 4 } },
{ WeightsLayout::g_os_is_yx_osa4_isa8_osv8_isv4, { 0, 1, -1, 2, 3, 4 } },
{ WeightsLayout::g_os_is_zyx_osa4_isa8_osv8_isv4, { 0, 1, 2, 3, 4, 5 } },
{ WeightsLayout::os_is_yx_osa4_isa8_osv8_isv2, { 0, 1, -1, 2, 3, -1 } },
Expand Down Expand Up @@ -544,6 +545,7 @@ NDims WeightsTensor::GetSimpleDims(const std::vector<size_t>& d, WeightsLayout l
break;
case os_is_yx_osa2_isa8_osv8_isv2:
case is_os_yx_isa2_osa8_isv8_osv2:
case g_os_is_yx_osa2_isa8_osv8_isv2:
newDims[2] = RoundUp(newDims[2], 16);
newDims[3] = RoundUp(newDims[3], 16);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ enum WeightsLayout {
os_is_zyx_isa8_osv16_isv4, // for fully connected MMAD
os_is_yx_osa4_isa8_osv8_isv4, // for MMAD convolution swizzled from ofm 0..7 to 0,4,8,12,16,20,24,28,
is_os_yx_isa4_osa8_isv8_osv4, // for onednn deconvolution
g_os_is_yx_osa2_isa8_osv8_isv2, // for MMAD convolution swizzled from ofm 0..7 to 0,4,8,12,16,20,24,28,
g_os_is_yx_osa4_isa8_osv8_isv4, // for MMAD convolution swizzled from ofm 0..7 to 0,4,8,12,16,20,24,28,
g_os_is_zyx_osa4_isa8_osv8_isv4, // for MMAD convolution swizzled from ofm 0..7 to 0,4,8,12,16,20,24,28,
os_is_yx_osa4_isa8_osv8_isv2, // for MMAD convolution swizzled from ofm 0..7 to 0,4,8,12,16,20,24,28,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,16 @@ inline uint get_g_is_os_yx_isa4_osa8_isv8_osv4(uint g, uint o, uint i, uint z, u
CAT(prefix, _OFM_NUM), \
CAT(prefix, _OFFSET))

#define GET_FILTER_G_OS_IS_YX_OSA2_ISA8_OSV8_ISV2_INDEX(prefix, g, o, i, y, x) \
get_g_os_is_yx_osa2_isa8_osv8_isv2( \
g, o, i, 0, y, x, \
CAT(prefix, _SIZE_X), \
CAT(prefix, _SIZE_Y), \
1, \
CAT(prefix, _IFM_NUM), \
CAT(prefix, _OFM_NUM), \
CAT(prefix, _OFFSET))

#define GET_FILTER_OS_IS_YX_OSA2_ISA8_OSV8_ISV2_INDEX(prefix, o, i, y, x) \
get_g_os_is_yx_osa2_isa8_osv8_isv2( \
0, o, i, 0, y, x, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ inline uint FUNC(get_input_index)(uint g, uint o, uint i, uint z, uint y, uint x
return GET_FILTER_OS_IS_ZYX_OSV16_ISV16_INDEX(INPUT0, o, i, z, y, x);
#elif defined INPUT0_LAYOUT_OS_IS_YX_OSA2_ISA8_OSV16_ISV4
return GET_FILTER_OS_IS_YX_OSA2_ISA8_OSV16_ISV4_INDEX(INPUT0, o, i, y, x);
#elif defined INPUT0_LAYOUT_G_OS_IS_YX_OSA2_ISA8_OSV8_ISV2
return GET_FILTER_G_OS_IS_YX_OSA2_ISA8_OSV8_ISV2_INDEX(INPUT0, g, o, i, y, x);
#elif defined INPUT0_LAYOUT_G_OS_IS_YX_OSA2_ISA8_OSV16_ISV4
return GET_FILTER_G_OS_IS_YX_OSA2_ISA8_OSV16_ISV4_INDEX(INPUT0, g, o, i, y, x);
#elif defined INPUT0_LAYOUT_OS_IS_YX_OSA2_ISA8_OSV16_ISV2
Expand Down Expand Up @@ -225,6 +227,8 @@ inline uint FUNC(get_output_index)(uint g, uint o, uint i, uint z, uint y, uint
return GET_FILTER_G_OS_IS_ZYX_OSA4_ISA8_OSV8_ISV2_INDEX(OUTPUT, g, o, i, z, y, x);
#elif defined OUTPUT_LAYOUT_OS_IS_YX_OSA2_ISA8_OSV16_ISV2
return GET_FILTER_OS_IS_YX_OSA2_ISA8_OSV16_ISV2_INDEX(OUTPUT, o, i, y, x);
#elif defined OUTPUT_LAYOUT_G_OS_IS_YX_OSA2_ISA8_OSV8_ISV2
return GET_FILTER_G_OS_IS_YX_OSA2_ISA8_OSV8_ISV2_INDEX(OUTPUT, g, o, i, y, x);
#elif defined OUTPUT_LAYOUT_G_OS_IS_YX_OSA2_ISA8_OSV16_ISV2
return GET_FILTER_G_OS_IS_YX_OSA2_ISA8_OSV16_ISV2_INDEX(OUTPUT, g, o, i, y, x);
#elif defined OUTPUT_LAYOUT_OS_IS_YX_OSA2_ISA8_OSV16_ISV4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ std::string toString(WeightsLayout layout) {
case WeightsLayout::gs_oi_yxs_gsv16_yxsv4: return "GS_OI_YXS_GSV16_YXSV4";
case WeightsLayout::gs_oi_yxs_gsv32_yxsv4: return "GS_OI_YXS_GSV32_YXSV4";
case WeightsLayout::os_is_yx_osa4_isa8_osv8_isv4: return "OS_IS_YX_OSA4_ISA8_OSV8_ISV4";
case WeightsLayout::g_os_is_yx_osa2_isa8_osv8_isv2: return "G_OS_IS_YX_OSA2_ISA8_OSV8_ISV2";
case WeightsLayout::g_os_is_yx_osa4_isa8_osv8_isv4: return "G_OS_IS_YX_OSA4_ISA8_OSV8_ISV4";
case WeightsLayout::g_os_is_zyx_osa4_isa8_osv8_isv4: return "G_OS_IS_ZYX_OSA4_ISA8_OSV8_ISV4";
case WeightsLayout::os_is_yx_osa4_isa8_osv8_isv2: return "OS_IS_YX_OSA4_ISA8_OSV8_ISV2";
Expand Down
1 change: 1 addition & 0 deletions src/plugins/intel_gpu/src/runtime/format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ const format_traits& format::traits(type fmt) {
FMT_TRAITS(g_os_zyx_is_osv32_isv4, 1, 1, 3, 1, {0, 1, 2, 3, 4, 5}, "gozyxi", "oixyz?g", {{0, 32}, {1, 4}}),
FMT_TRAITS(g_os_zyx_is_osv32_isv16, 1, 1, 3, 1, {0, 1, 2, 3, 4, 5}, "gozyxi", "oixyz?g", {{0, 32}, {1, 16}}),
FMT_TRAITS(g_os_zyx_is_osv32_isv32, 1, 1, 3, 1, {0, 1, 2, 3, 4, 5}, "gozyxi", "oixyz?g", {{0, 32}, {1, 32}}),
FMT_TRAITS(g_os_is_yx_osa2_isa8_osv8_isv2, 1, 1, 2, 1, {0, 1, 2, 3, 4}, "goiyx", "oixy??g", {{0, 16}, {1, 16}}),
FMT_TRAITS(g_os_is_yx_osa4_isa8_osv8_isv4, 1, 1, 2, 1, {0, 1, 2, 3, 4}, "goiyx", "oixy??g", {{0, 32}, {1, 32}}),
FMT_TRAITS(g_os_is_zyx_osa4_isa8_osv8_isv4, 1, 1, 3, 1, {0, 1, 2, 3, 4, 5}, "goizyx", "oixyz?g", {{0, 32}, {1, 32}}),
FMT_TRAITS(g_os_is_yx_osa4_isa8_osv8_isv2, 1, 1, 2, 1, {0, 1, 2, 3, 4}, "goiyx", "oixy??g", {{0, 32}, {1, 16}}),
Expand Down

0 comments on commit efbfd95

Please sign in to comment.