beanduan22 commented on issue #19543: URL: https://github.com/apache/tvm/issues/19543#issuecomment-4427931925
I agree that the ONNX `Sign` specification does not explicitly define the behavior for NaN inputs. However, since the Relax ONNX frontend is intended to import ONNX models, I wonder whether it would still be preferable to align with ONNX Runtime behavior where possible, especially for floating-point edge cases. In this case, ONNX Runtime preserves NaN for `Sign(NaN)`, while TVM currently returns `0`. This may lead to silent numerical divergence when users compile existing ONNX models with TVM. Would it be reasonable to either: 1. preserve NaN for `Sign` in the Relax ONNX frontend / lowering path, so that the behavior is closer to ONNX Runtime; or 2. explicitly document that NaN behavior is undefined / implementation-dependent in TVM for this operator? Thanks again! -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
