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/05/16 02:32:47 UTC

[GitHub] [tvm] zhuzilin edited a comment on pull request #8041: [Relay][PRNG] Add uniform distribution generator wrt threefry PRNG

zhuzilin edited a comment on pull request #8041:
URL: https://github.com/apache/tvm/pull/8041#issuecomment-841694188


   @FrozenGene @tkonolige @altanh Thank you for your reviews. I've updated this PR based on them.
   
   > I think there are 2 options: 1. Ref Conv2DRel. 2. You could restrict the type here and raise exception. I prefer option 1.
   
   @FrozenGene Thank you for the clue! However, I haven't find how to restrict the dtype attributes in `Conv2DRel` or `Conv2DAttrs`... Should I add the type restriction to the `UniformAttrs`, or raise error in the `MakeUniform` and `UniformRel`?
   
   > How well does this approach work when we have a large range (high - low)? It seems like we would be loosing a lot of potential randomness.
   
   @tkonolige As this approach is only using the fraction bits to represent float, there will be loss of randomness for all floats, at least `(2^nexp-1) / 2^nexp` of the float (nexp stands for the number of exponential digits). However, it's a little tricky to use all 64 digits of the random bit to represent a uniform distributed float number... Do you have any idea on that?
   
   > Perhaps this is the operation you're looking for? https://github.com/altanh/tvm/blob/2d9ac7710ab055d4f20e8b5a0a3580836723efac/python/tvm/topi/generic/algorithm.py#L465
   
   @altanh Thank you for your references! The `reinterpret` is exactly what I was looking for. I've updated the algorithm and right now it is the same as the one used in jax.


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