Lunderberg opened a new pull request, #13773:
URL: https://github.com/apache/tvm/pull/13773

   The `crop_and_resize` operator uses floating-point arithmetic to determine 
whether an index is within a view-box.  This can cause the use of 
`extrapolation_value` to depend on target-dependent rounding differences.
   
   For example, this issue was initially noticed on Vulkan during debugging of 
https://github.com/apache/tvm/pull/13530, and was the result of computing 
`0.2*223.0 + 0.8*223.0 < 223.0`.  If all intermediates are cast to float32, the 
left-hand side evaluates to `223.00002`.  If intermediates are kept at a higher 
precision, the left-hand side evaluates to `223.0`.
   
   The floating-point indexing can't be removed, because the operator must 
match the API defined by TensorFlow's operator implementation. The TensorFlow 
documentation for
   
[`CropAndResize`](https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/crop-and-resize)
 does not specify behavior in these cases, nor do the current TensorFlow unit 
tests check cases of rounding error.  Since the TensorFlow unit tests only use 
binary fractions for the `boxes` argument, which largely avoids the rounding 
issue, this commit updates the TVM unit tests to avoid depending on 
floating-point precision.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to