Skip to content

Commit 5872efe

Browse files
authored
Revert "Add subgroup topk kernel for XPU (part1 of #3369) (#3371)" (#3707)
This reverts commit 8eaa591, except new overloads of `sycl_kernel_submit`. The motivation is that #3371 caused build timeout in stock CD.
1 parent e7ae0b0 commit 5872efe

3 files changed

Lines changed: 11 additions & 548 deletions

File tree

‎src/ATen/native/xpu/sycl/TensorTopKKernel.cpp‎

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <ATen/native/xpu/sycl/SortingKernels.h>
1717

1818
#include <ATen/native/xpu/sycl/TensorTopKKernel.h>
19-
#include <ATen/native/xpu/sycl/TensorTopKSbtopkKernel.h>
2019

2120
namespace at {
2221
namespace native {
@@ -114,25 +113,17 @@ void topk_kernel(
114113
const scalar_t* self_ptr = self_.const_data_ptr<scalar_t>();
115114
scalar_t* values_ptr = values_.data_ptr<scalar_t>();
116115
int64_t* indices_ptr = indices_.data_ptr<int64_t>();
117-
118-
SbtopkResult sbtopk_result = sbtopk_try_launch(
119-
self_, nsegments, nelements, k, largest, values_, indices_);
120-
if (sbtopk_result == SbtopkResult::FAILED) {
121-
segmented_group_select_pairs<scalar_t, int64_t>(
122-
self_ptr,
123-
values_ptr,
124-
nullptr,
125-
(int64_t*)indices_ptr,
126-
nsegments,
127-
nelements,
128-
k,
129-
largest);
130-
}
131-
132-
// Only sort if the user asked for sorted output AND the optimized
133-
// kernel did not already produce a sorted result. The subgroup topk
134-
// kernel returns SORTED; the original kernel returns FAILED.
135-
if (sorted && sbtopk_result != SbtopkResult::SORTED) {
116+
segmented_group_select_pairs<scalar_t, int64_t>(
117+
self_ptr,
118+
values_ptr,
119+
nullptr,
120+
(int64_t*)indices_ptr,
121+
nsegments,
122+
nelements,
123+
k,
124+
largest);
125+
126+
if (sorted) {
136127
segmented_sort_pairs<scalar_t, int64_t>(
137128
values_ptr,
138129
values_ptr,

0 commit comments

Comments
 (0)