You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/01/25 20:55:22 UTC

[GitHub] [tvm] altanh opened a new issue #7339: [Parser] Parser/tokenizer doesn't handle inf float

altanh opened a new issue #7339:
URL: https://github.com/apache/tvm/issues/7339


   Running `AnnotateSpans` pass on a module which uses `inf` float literal (such as in the case of `clip(x, 0, np.inf)`) causes an error.


----------------------------------------------------------------
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.

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



[GitHub] [tvm] jroesch closed issue #7339: [Bug][Parser] Parser/tokenizer doesn't handle inf float

Posted by GitBox <gi...@apache.org>.
jroesch closed issue #7339:
URL: https://github.com/apache/tvm/issues/7339


   


----------------------------------------------------------------
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.

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



[GitHub] [tvm] altanh edited a comment on issue #7339: [Bug][Parser] Parser/tokenizer doesn't handle inf float

Posted by GitBox <gi...@apache.org>.
altanh edited a comment on issue #7339:
URL: https://github.com/apache/tvm/issues/7339#issuecomment-769340016


   @masahi 
   ```
   import numpy as np
   import tvm
   from tvm import relay
   
   
   x = relay.var("x", shape=(3, 4), dtype="float32")
   y = relay.clip(x, 0, np.inf)
   
   f = relay.Function([x], y)
   mod = tvm.IRModule.from_expr(f)
   
   mod = relay.transform.AnnotateSpans()(mod)
   ```


----------------------------------------------------------------
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.

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



[GitHub] [tvm] jroesch commented on issue #7339: [Bug][Parser] Parser/tokenizer doesn't handle inf float

Posted by GitBox <gi...@apache.org>.
jroesch commented on issue #7339:
URL: https://github.com/apache/tvm/issues/7339#issuecomment-768807297


   I would be happy to mentor anyone who wants to pick this one up.


----------------------------------------------------------------
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.

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



[GitHub] [tvm] masahi commented on issue #7339: [Bug][Parser] Parser/tokenizer doesn't handle inf float

Posted by GitBox <gi...@apache.org>.
masahi commented on issue #7339:
URL: https://github.com/apache/tvm/issues/7339#issuecomment-769299290


   I'm interested in taking this up, @altanh can you post a repro script?


----------------------------------------------------------------
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.

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



[GitHub] [tvm] altanh commented on issue #7339: [Bug][Parser] Parser/tokenizer doesn't handle inf float

Posted by GitBox <gi...@apache.org>.
altanh commented on issue #7339:
URL: https://github.com/apache/tvm/issues/7339#issuecomment-769541879


   Not sure if Python should be the source of truth but `float("inf")` returns `inf` whereas `float("inff")` fails. Also numpy seems to have similar behavior (but they somehow avoid erroring by ignoring the rest of the input...):
   ```
   >>> np.fromstring("inff, 1.0", dtype=float, sep=",")
   array([inf])
   ```


----------------------------------------------------------------
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.

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



[GitHub] [tvm] masahi commented on issue #7339: [Bug][Parser] Parser/tokenizer doesn't handle inf float

Posted by GitBox <gi...@apache.org>.
masahi commented on issue #7339:
URL: https://github.com/apache/tvm/issues/7339#issuecomment-769540320


   Printing `mod` shows that `inff` is a thing:
   
   ```
   def @main(%x: Tensor[(3, 4), float32]) {
     clip(%x, a_min=0.5f, a_max=inff)
   }
   ```
   Do we want to special-case `inf` in the printer as well?


----------------------------------------------------------------
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.

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



[GitHub] [tvm] masahi edited a comment on issue #7339: [Bug][Parser] Parser/tokenizer doesn't handle inf float

Posted by GitBox <gi...@apache.org>.
masahi edited a comment on issue #7339:
URL: https://github.com/apache/tvm/issues/7339#issuecomment-769540320


   Printing `mod` shows that `inff` is a thing:
   
   ```
   def @main(%x: Tensor[(3, 4), float32]) {
     clip(%x, a_min=0.5f, a_max=inff)
   }
   ```
   Do we want to special-case `inf` in the printer as well? (i.e. which of `inf` or `inff` we want to see in the tokenizer)


----------------------------------------------------------------
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.

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



[GitHub] [tvm] altanh commented on issue #7339: [Bug][Parser] Parser/tokenizer doesn't handle inf float

Posted by GitBox <gi...@apache.org>.
altanh commented on issue #7339:
URL: https://github.com/apache/tvm/issues/7339#issuecomment-769340016


   @masahi 
   ```import numpy as np
   import tvm
   from tvm import relay
   
   
   x = relay.var("x", shape=(3, 4), dtype="float32")
   y = relay.clip(x, 0, np.inf)
   
   f = relay.Function([x], y)
   mod = tvm.IRModule.from_expr(f)
   
   mod = relay.transform.AnnotateSpans()(mod)
   ```


----------------------------------------------------------------
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.

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