From 20fb3e14807f617162aa3c6bbd3cf1d7ed1d232b Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Mon, 16 Dec 2024 14:58:16 -0800 Subject: [PATCH] merge main & include 1 more test --- onnxruntime/core/providers/webgpu/tensor/slice.cc | 6 +++++- onnxruntime/test/providers/cpu/tensor/slice_op.test.cc | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/onnxruntime/core/providers/webgpu/tensor/slice.cc b/onnxruntime/core/providers/webgpu/tensor/slice.cc index d510bf7da808a..99c7c13c1dfb6 100644 --- a/onnxruntime/core/providers/webgpu/tensor/slice.cc +++ b/onnxruntime/core/providers/webgpu/tensor/slice.cc @@ -157,7 +157,11 @@ Status Slice::ComputeInternal(ComputeContext& context) const { // temporary steps vector to handle negative steps std::vector steps_tmp; for (unsigned int i = 0; i < steps_raw.size(); i++) { - steps_tmp.push_back(static_cast(steps_raw[i])); + if (steps_raw[i] >= std::numeric_limits::max()) { + steps_tmp.push_back(std::numeric_limits::max()); + } else { + steps_tmp.push_back(static_cast(steps_raw[i])); + } } if (static_cast(axes.size()) != input_rank) { diff --git a/onnxruntime/test/providers/cpu/tensor/slice_op.test.cc b/onnxruntime/test/providers/cpu/tensor/slice_op.test.cc index ab53b516d7d64..f04a862fa4c2c 100644 --- a/onnxruntime/test/providers/cpu/tensor/slice_op.test.cc +++ b/onnxruntime/test/providers/cpu/tensor/slice_op.test.cc @@ -727,9 +727,6 @@ TEST(SliceTest, Slice5D_SubsetOfAxes_Flatten2Dims_OffsetInput) { // ORT crash due to integer overflow on 32bit system // See, https://github.com/microsoft/onnxruntime/issues/9368 TEST(SliceTest, Slice5D_LargeStep) { - if (DefaultWebGpuExecutionProvider().get() != nullptr) { - GTEST_SKIP() << "Not covered by WebGPU test suite"; - } RunSliceTest({1, 2, 2, 2, 2}, {1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f,