Skip to content

Commit e23ad51

Browse files
committed
Update
[ghstack-poisoned]
1 parent b00ce69 commit e23ad51

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

kernels/optimized/cpu/op_fft_r2c.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#include <pocketfft_hdronly.h>
1313

14+
#include <optional>
15+
1416
namespace torch::executor::native {
1517

1618
// TODO: contents of this anonymous namespace are copy/pasted from

kernels/optimized/cpu/targets.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ _OPTIMIZED_ATEN_OPS = (
2727
op_target(name = "op_exp"),
2828
op_target(
2929
name = "op_fft_r2c",
30-
deps = [] if runtime.is_oss else ["fbsource//third-party/pocketfft:pocketfft"],
30+
deps = [] if runtime.is_oss else ["fbsource//third-party/pocket_fft:pocketfft"],
3131
),
3232
op_target(name = "op_sigmoid"),
3333
op_target(

kernels/test/op_fft_r2c_test.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <executorch/kernels/test/FunctionHeaderWrapper.h> // Declares the operator
1010
#include <executorch/kernels/test/TestUtil.h>
11+
#include <executorch/kernels/test/supported_features.h>
1112
#include <executorch/runtime/core/exec_aten/exec_aten.h>
1213
#include <executorch/runtime/core/exec_aten/testing_util/tensor_factory.h>
1314
#include <executorch/runtime/core/exec_aten/testing_util/tensor_util.h>
@@ -130,6 +131,10 @@ TEST_F(OpFftR2cOutTest, MultipleDims) {
130131
}
131132

132133
TEST_F(OpFftR2cOutTest, InvalidNorm) {
134+
if (torch::executor::testing::SupportedFeatures::get()->is_aten) {
135+
GTEST_SKIP() << "ATen MKL path does not validate norm";
136+
return;
137+
}
133138
auto invalid_norm = [this](int64_t norm) {
134139
test_dtype<float, ScalarType::Float, /* expect_failure = */ true>(norm);
135140
};
@@ -140,6 +145,10 @@ TEST_F(OpFftR2cOutTest, InvalidNorm) {
140145
}
141146

142147
TEST_F(OpFftR2cOutTest, InvalidDim) {
148+
if (torch::executor::testing::SupportedFeatures::get()->is_aten) {
149+
GTEST_SKIP() << "ATen fails UBSAN";
150+
return;
151+
}
143152
auto negative_dim = [this]() {
144153
test_dtype<float, ScalarType::Float, /* expect_failure = */ true>(0, -1);
145154
test_dtype<float, ScalarType::Float, /* expect_failure = */ true>(0, 3);
@@ -150,6 +159,10 @@ TEST_F(OpFftR2cOutTest, InvalidDim) {
150159

151160
// TODO: support this and patch test accordingly!
152161
TEST_F(OpFftR2cOutTest, TwoSidedIsNotSupported) {
162+
if (torch::executor::testing::SupportedFeatures::get()->is_aten) {
163+
GTEST_SKIP() << "ATen supports two-sided";
164+
return;
165+
}
153166
auto twosided = [this]() {
154167
test_dtype<double, ScalarType::Double, /* expect_failure = */ true>(
155168
0, 1, false);

kernels/test/targets.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ def define_common_targets():
244244
_common_op_test("op_exp_test", ["aten", "portable", "optimized"])
245245
_common_op_test("op_expand_copy_test", ["aten", "portable"])
246246
_common_op_test("op_expm1_test", ["aten", "portable"])
247+
_common_op_test("op_fft_r2c_test", ["aten", "optimized"])
247248
_common_op_test("op_fill_test", ["aten", "portable"])
248249
_common_op_test("op_flip_test", ["aten", "portable"])
249250
_common_op_test("op_floor_divide_test", ["aten", "portable"])

0 commit comments

Comments
 (0)