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

Resolve GH issue 12706 #12815

Merged
merged 5 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,19 @@ static const std::unordered_map<std::string_view, const HandlerInfo&> handler_ma
{"Split", split_handler},
{"Shape", shape_handler},
{"Pad", pad_handler},
// The CUDA Resize kernel assumes that the input is NCHW and
// Resize can't be supported in ORT builds with CUDA enabled.
// TODO: Enable this once the CUDA Resize kernel is implemented
// "generically" (i.e.) aligning with the generic nature of the
// ONNX spec.
// See https://github.com/microsoft/onnxruntime/pull/10824 for
// a similar fix applied to the CPU Resize kernel.
// Per tests included in #10824, the ROCM EP also generates
// incorrect results when this handler is used, so the Resize
// handler is not enabled even for those builds.
#if !defined(USE_CUDA) && !defined(USE_ROCM)
{"Resize", resize_handler},
#endif
{"ReduceSum", reduce_sum_handler},

{"ReduceLogSum", reduce_op_handler},
Expand Down
12 changes: 12 additions & 0 deletions onnxruntime/test/optimizer/transpose_optimizer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,17 @@ TEST(TransposeOptimizerTests, TestPadNonconst) {
/*opset_version*/ 11);
}

// The CUDA Resize kernel assumes that the input is NCHW and
// Resize can't be supported in ORT builds with CUDA enabled.
// TODO: Enable this once the CUDA Resize kernel is implemented
// "generically" (i.e.) aligning with the generic nature of the
// ONNX spec.
// See https://github.com/microsoft/onnxruntime/pull/10824 for
// a similar fix applied to the CPU Resize kernel.
// Per tests included in #10824, the ROCM EP also generates
// incorrect results when this handler is used, so the Resize
// handler is not enabled even for those builds.
#if !defined(USE_CUDA) && !defined(USE_ROCM)
Copy link
Contributor

@yihonglyu yihonglyu Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to give a warning or skip the tests instead of just comment out the tests for CUDA or ROCM?

Copy link
Member Author

@hariharans29 hariharans29 Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the resize handler is not part of such builds (CUDA or ROCM), we will have to skip it (can't even continue with warning). But I am curious - what value will it add instead of this approach ? Can you elaborate please ?

TEST(TransposeOptimizerTests, TestResize) {
auto build_test_case_1 = [&](ModelTestBuilder& builder) {
auto* input0_arg = MakeInput<float>(builder, {{4, -1, 2, -1}}, {4, 6, 2, 10}, 0.0, 1.0);
Expand Down Expand Up @@ -498,6 +509,7 @@ TEST(TransposeOptimizerTests, TestResizeNonconstOpset13) {
/*opset_version*/ 13);
}

#endif
TEST(TransposeOptimizerTests, TestAdd) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: #endif // !defined(USE_CUDA) && !defined(USE_ROCM) would be nicer

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I will include the change in another PR to avoid running all the CIs again.

auto build_test_case_1 = [&](ModelTestBuilder& builder) {
auto* input0_arg = builder.MakeInput<float>({4, 6, 10}, 0.0, 1.0);
Expand Down