Skip to content

Commit 02bcd80

Browse files
jianyizhCopilot
andcommitted
Apply suggestions from copilot
Co-authored-by: Copilot <[email protected]>
1 parent 0121231 commit 02bcd80

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ATen/native/xpu/sycl/LayerNormKernels.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ void _layer_norm_backward_kernel(
10561056
config_w.workgroup_num * config_w.block_row * config_w.workgroup_size;
10571057
int thread_slots = syclGpuEuCount() * syclGpuHWThreadsPerEU();
10581058
// use two stage col reduction if norm config occupancy < 50%
1059-
// TODO: we can releax this restriction in future for better perf
1059+
// TODO: we can relax this restriction in future for better perf
10601060
bool use_two_stage_col_reduction =
10611061
(dY.dtype() == kFloat || dY.dtype() == kBFloat16 ||
10621062
dY.dtype() == kHalf) &&
@@ -1077,7 +1077,7 @@ void _layer_norm_backward_kernel(
10771077
int num_tile_n = (N + tile_size_n - 1) / tile_size_n;
10781078
bool adjust_m = true;
10791079
// for M = 64*1024, N = 1, we choose tile size (256, 16) on pvc
1080-
// TODO: we can tune these conditions in future
1080+
// TODO: Consider tuning the tile size selection logic (tile_size_m, tile_size_n) and occupancy calculation
10811081
for (auto i = 0; i < 3; i++) {
10821082
// occupancy <= 50%
10831083
if (num_tile_m * num_tile_n * local_size_x * SIMD /
@@ -1097,7 +1097,8 @@ void _layer_norm_backward_kernel(
10971097
}
10981098
}
10991099
// tile size can be (1024,32), (512,32), (512,16), (256, 16)
1100-
// Change these parameters will cause changes in kernel
1100+
// Modifying these parameters (num_subgroup, workgroup_size, tile_size, elements_per_thread)
1101+
// will alter the kernel configuration, potentially affecting performance and behavior.
11011102
const scalar_t* dY_data = dY.const_data_ptr<scalar_t>();
11021103
const scalar_t* X_data = X.const_data_ptr<scalar_t>();
11031104
weight_t* dg_data =

0 commit comments

Comments
 (0)