onnxruntime
eabc40d9 - [WebGPU] Fix nearest half-tie handling for round_prefer_ceil/floor (#28757)

Commit
131 days ago
[WebGPU] Fix nearest half-tie handling for round_prefer_ceil/floor (#28757) ### Description ResizeOpTest.ResizeOpNearestUpSample_RoundPreferCeil_HalfPixel_2x2to7x8 fails on Intel WebGPU devices: ``` error: The difference between cur_expected[i] and cur_actual[i] is 2, which exceeds tolerance, where cur_expected[i] evaluates to 3, cur_actual[i] evaluates to 1, and tolerance evaluates to 0.00030999997397884727. ``` ### Motivation and Context The WebGPU shader logic used exact half-tie equality checks combined with i32 truncation arithmetic. This approach is fragile under GPU floating-point precision constraints and misbehaves on negative halfway coordinates. This change replaces the exact comparisons with a robust, epsilon-based fractional tie check (<= 1e-6) for both ROUND_PREFER_CEIL and ROUND_PREFER_FLOOR execution paths. Also add regression coverage for round_prefer_floor in resize_op_test.cc: - ResizeOpNearestUpSample_RoundPreferFloor_HalfPixel_2x2to7x8 - ResizeOpNearestUpSample_RoundPreferFloor_HalfPixel_GH28291_Regression
Author
Parents
Loading