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

[rls-v3.7] softmax wg reduce range workaround #2428

Merged
merged 1 commit into from
Jan 21, 2025
Merged
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
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
Loading