tlopex commented on PR #20239: URL: https://github.com/apache/tvm/pull/20239#issuecomment-5530892869
`10 ** abs(decimals)` is evaluated as a Python integer before it is converted to the target dtype. PyTorch accepts values such as `decimals=309`, and `torch.export` emits a valid `aten.round.decimals` node, but `relax.const(10**309, "float32")` and the float64 variant raise `OverflowError: int too large to convert to float`. As a result, these valid exported programs still fail during import. Even larger values can also require constructing an unnecessarily large host integer. Please construct or saturate the scale directly in the target floating-point dtype, or handle scale overflow explicitly, and add a regression test with a large `decimals` value. -- 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]
