Skip to content

Commit

Permalink
xe: softmax: workaround for bug in wg_reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
syurkevi committed Jan 16, 2025
1 parent db7bb91 commit 6bc11a0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/gpu/intel/ocl/reusable_softmax.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2019-2024 Intel Corporation
* Copyright 2019-2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -180,6 +180,20 @@ status_t reusable_softmax_fwd_t::pd_t::init_dispatch_workgroup_per_reduction(
conf.gws_params = dispatch.get_compile_params();
rt_conf.gws_params = dispatch.get_runtime_params();

auto dispatch_lws = dispatch.get_runtime_params().nd_range.local_range();
auto dispatch_gws = dispatch.get_runtime_params().nd_range.global_range();

auto *device_info = compute_engine->device_info();
const size_t multiple_of_sg_lws
= utils::rnd_up(dispatch_lws[0], device_info->max_subgroup_size());

compute::range_t softmax_gws
= {multiple_of_sg_lws, dispatch_gws[1], dispatch_gws[2]};
compute::range_t softmax_lws
= {multiple_of_sg_lws, dispatch_lws[1], dispatch_lws[2]};
compute::nd_range_t softmax_ndrange(softmax_gws, softmax_lws);
rt_conf.gws_params.nd_range = softmax_ndrange;

return status::success;
}

Expand Down

0 comments on commit 6bc11a0

Please sign in to comment.