-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
performanceissues related to performance regressionsissues related to performance regressions
Description
Describe the issue
Description
We observed a performance regression in the GridSample operator across all configurations between ONNXRuntime v1.22.0 and v1.23.0. This regression affects all interpolation modes and padding modes, with linear interpolation showing higher regression than nearest neighbor.
Affected Operator
GridSample
- Opset Version: 21, 22
- All Modes: linear, nearest (both affected)
- All Padding Modes: zeros, reflection (both affected)
- Regression: +7% to +15% kernel slowdown
Test Case Details
Test Case 1: gridsample_22_v2_gridsample_linear_zeros_align_corners_0_float32
Inputs:
-
input_0 tensor (image):
- Data type: float32
- Shape: [2, 3, 32, 32]
-
input_1 tensor (grid):
- Data type: float32
- Shape: [2, 32, 32, 2]
Attributes:
- mode: linear
- padding_mode: zeros
- align_corners: 0
Performance:
- v1.22.0: 0.315 ms (kernel time)
- v1.23.0: 0.348 ms (kernel time)
- Kernel regression: +10.4% slowdown
- Total time regression: +8.9% slowdown
Test Case 2: gridsample_22_v2_gridsample_linear_zeros_align_corners_1_float32
Inputs:
-
input_0 tensor (image):
- Data type: float32
- Shape: [2, 3, 56, 56]
-
input_1 tensor (grid):
- Data type: float32
- Shape: [2, 64, 64, 2]
Attributes:
- mode: linear
- padding_mode: zeros
- align_corners: 1
Performance:
- v1.22.0: 1.189 ms (kernel time)
- v1.23.0: 1.369 ms (kernel time)
- Kernel regression: +15.1% slowdown
- Total time regression: +13.5% slowdown
Test Case 3: gridsample_gridsample_21_gridsample_nearest_reflection_float32
Inputs:
-
X tensor (image):
- Data type: float32
- Shape: [1, 3, 64, 64]
-
grid tensor:
- Data type: float32
- Shape: [1, 128, 128, 2]
Attributes:
- mode: nearest
- padding_mode: reflection
- align_corners: 1
Performance:
- v1.22.0: 5.902 ms (kernel time)
- v1.23.0: 6.323 ms (kernel time)
- Kernel regression: +7.1% slowdown
- Total time regression: +7.4% slowdown
Test Case 4: gridsample_gridsample_21_gridsample_basic_linear_zeros_float32
Performance:
- v1.22.0: 4.847 ms (kernel time)
- v1.23.0: 5.383 ms (kernel time)
- Kernel regression: +11.0% slowdown
Test Case 5: gridsample_22_v3_test_gridsample_2d_linear_zeros_float32
Performance:
- v1.22.0: 0.315 ms (kernel time)
- v1.23.0: 0.345 ms (kernel time)
- Kernel regression: +9.7% slowdown
Test Case 6: gridsample_22_v3_test_gridsample_2d_linear_zeros_float32_batch1
Performance:
- v1.22.0: 0.359 ms (kernel time)
- v1.23.0: 0.392 ms (kernel time)
- Kernel regression: +9.3% slowdown
To reproduce
- Download zip file
- Run benchmark using the provided script:
python script_profiling.py gridsample_22_v2_gridsample_linear_zeros_align_corners_1_float32 1.22.0 1.23.0
Urgency
No response
Platform
Linux
OS Version
Ubuntu 24.04.3 LTS
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.23
ONNX Runtime API
Python
Architecture
X64
Execution Provider
Default CPU
Execution Provider Library Version
No response
Model File
No response
Is this a quantized model?
Yes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
performanceissues related to performance regressionsissues related to performance regressions