Skip to content

Commit e06f287

Browse files
authored
override sort in yaml file (#5032)(#5036)
* override sort to WA PR for TGI TP=2 issue: RuntimeError: UR backend failed. UR backend returns:40 (UR_RESULT_ERROR_OUT_OF_RESOURCES)
1 parent 71e6090 commit e06f287

File tree

2 files changed

+4
-58
lines changed

2 files changed

+4
-58
lines changed

csrc/gpu/aten/operators/Sort.cpp

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#include <core/Memory.h>
22
#include <core/detail/IndexUtils.h>
33
#include <core/detail/TensorInfo.h>
4-
#ifdef USE_OVERRIDE_OP
5-
#include "utils/CustomOperatorRegistration.h"
6-
#endif
74
#include <utils/DPCPP.h>
85
#include "comm/ATDispatch.h"
96
#include "comm/Numerics.h"
@@ -58,56 +55,5 @@ Tensor argsort(const Tensor& self, bool stable, int64_t dim, bool descending) {
5855
return std::get<1>(
5956
sort_out_stable(self, stable, dim, descending, sorted, indices));
6057
}
61-
#ifdef USE_OVERRIDE_OP
62-
std::tuple<at::Tensor, at::Tensor> sort_ipex(
63-
const at::Tensor& self,
64-
int64_t dim,
65-
bool descending) {
66-
return at::AtenIpexTypeXPU::sort(self, dim, descending);
67-
}
68-
69-
std::tuple<Tensor&, Tensor&> sort_values(
70-
const Tensor& input,
71-
int64_t dim,
72-
bool order,
73-
Tensor& sorted,
74-
Tensor& indices) {
75-
return at::AtenIpexTypeXPU::sort_out(input, dim, order, sorted, indices);
76-
}
77-
78-
std::tuple<Tensor, Tensor> sort_stable(
79-
const Tensor& self,
80-
c10::optional<bool> stable,
81-
int64_t dim,
82-
bool descending) {
83-
return at::AtenIpexTypeXPU::sort(self, stable, dim, descending);
84-
}
85-
86-
std::tuple<Tensor&, Tensor&> sort_values_stable(
87-
const Tensor& self,
88-
c10::optional<bool> stable,
89-
int64_t dim,
90-
bool descending,
91-
Tensor& values,
92-
Tensor& indices) {
93-
return at::AtenIpexTypeXPU::sort_out(
94-
self, stable, dim, descending, values, indices);
95-
}
96-
#endif
9758
} // namespace AtenIpexTypeXPU
9859
} // namespace at
99-
100-
#ifdef USE_OVERRIDE_OP
101-
namespace {
102-
103-
IPEX_TORCH_LIBRARY_IMPL(aten, XPU, m) {
104-
m.impl("sort", TORCH_FN((&at::AtenIpexTypeXPU::sort_ipex)));
105-
m.impl("sort.stable", TORCH_FN((&at::AtenIpexTypeXPU::sort_stable)));
106-
m.impl("sort.values", TORCH_FN((&at::AtenIpexTypeXPU::sort_values)));
107-
m.impl(
108-
"sort.values_stable",
109-
TORCH_FN((&at::AtenIpexTypeXPU::sort_values_stable)));
110-
}
111-
112-
} // namespace
113-
#endif

scripts/tools/torchgen/yaml/xpu_functions.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ supported:
2424
# - glu_backward.grad_input
2525
# - index_select
2626
# - index_select.out
27-
# - sort
28-
# - sort.stable
29-
# - sort.values
30-
# - sort.values_stable
27+
- sort
28+
- sort.stable
29+
- sort.values
30+
- sort.values_stable
3131
################## override below ops due to performance issues
3232
# - convolution_overrideable
3333
# - convolution_backward_overrideable

0 commit comments

Comments
 (0)