[GPU] Fix bfyx conv degradation for gen9 (#8911)
* Fix for bfyx conv performance issue. PR 6399 was for wide palne + shallow featuremap cases. If the plane is too small so that the increased computation due toe the alignment for block_size is relatively large, performance drops. * Fix for bfyx conv performance issue. Use subgroup size 16 when output feature size is >= 8 instead of > 8 * Set bfyx convolution subgroup size to be 16 when output_feature size is 8 and the dtype is fp16
This commit is contained in:
1 parent
8e67d74932
commit
746e55a330
2 files changed
+12
-5
No files matched your search
+6
-4
@@ -80,7 +80,7 @@ static std::pair<size_t, size_t> get_bfyx_req_input_block_dims(size_t output_blo
|
||||
return std::make_pair(input_block_array_size, input_block_read_width);
|
||||
}
|
||||
|
||||
static void shrink_blocks_to_output_size(size_t output_x, size_t output_y, size_t& block_x, size_t& block_y) {
|
||||
static void shrink_blocks_to_output_size(size_t output_x, size_t output_y, size_t& block_x, size_t& block_y, size_t sub_group_size) {
|
||||
// how many elements we will compute in each dimension
|
||||
size_t computed_x = Align(output_x, block_x);
|
||||
size_t computed_y = Align(output_y, block_y);
|
||||
@@ -94,8 +94,10 @@ static void shrink_blocks_to_output_size(size_t output_x, size_t output_y, size_
|
||||
block_x -= unused_x / simds_x;
|
||||
block_y -= unused_y / simds_y;
|
||||
|
||||
block_x = Align(block_x, 2);
|
||||
block_y = Align(block_y, 2);
|
||||
if (simds_x * simds_y >= sub_group_size) {
|
||||
block_x = Align(block_x, 2);
|
||||
block_y = Align(block_y, 2);
|
||||
}
|
||||
}
|
||||
|
||||
ConvolutionKernel_bfyx_os_iyx_osv16::AutoTuneOption ConvolutionKernel_bfyx_os_iyx_osv16::GetAutoTuneOptions(
|
||||
@@ -145,7 +147,7 @@ ConvolutionKernel_bfyx_os_iyx_osv16::AutoTuneOption ConvolutionKernel_bfyx_os_iy
|
||||
// if this is not 1x1 batch1 case then shrink filters, other way we're memory bound and it's best to use 16x1 block
|
||||
// sizes
|
||||
if (cp.filterSize.x != 1 || cp.filterSize.y != 1 || cp.output.Batch().v != 1) {
|
||||
shrink_blocks_to_output_size(cp.output.X().v, cp.output.Y().v, option.blockWidth, option.blockHeight);
|
||||
shrink_blocks_to_output_size(cp.output.X().v, cp.output.Y().v, option.blockWidth, option.blockHeight, sub_group_size);
|
||||
}
|
||||
return option;
|
||||
}
|
||||
|
||||
+6
-1
@@ -40,7 +40,12 @@ protected:
|
||||
// Smaller # EU tends to be computation bounds.
|
||||
// In such case, using larger worksize will result in larger computational inefficiency
|
||||
// w.r.t the unalined output feature
|
||||
return (params.output.Feature().v > 8 || !IsSIMDSizeSupported(params.engineInfo, 8)) ? 16 : 8;
|
||||
if (params.output.Feature().v > 8 || !IsSIMDSizeSupported(params.engineInfo, 8)
|
||||
|| (params.output.GetDType() == Datatype::F16) && params.output.Feature().v == 8) {
|
||||
return 16;
|
||||
} else {
|
||||
return 8;
|
||||
}
|
||||
} else {
|
||||
return 16;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user