tqchen commented on issue #4979: [Relay/TOPI/TF][Op] Add support for randomuniform Op in TVM URL: https://github.com/apache/incubator-tvm/pull/4979#issuecomment-596221752 To chime in a bit here. I think the main thing that need to be discussed is not the implementation, but how can PRNG being represented in the high-level relay graph. Inherently, the low level program need to have some of the opaque global states in certain execution mode(e.g. IO, PRNG or cudnn handle). It does not, however, prevent us from adopting a functional style program at the high-level. as these functional style program can still be lowered into low-level program that has side-effect(via a global random number generator). ```python data1, rng = uniform(rng, shape) data2, rng = uniform(rng, shape) ``` For example, the program above can be lowered by ignoring `rng` as an empty object, but makes use of the data flow dep to preserve ordering of the random numbers(where before they do not have dependencies. We do however, would like to discussion a few alternatives, and how to best represent such program in relay overall. Functional style program representation is easier to transform, distribute, but also brings interesting challenge about how to construct them initially from program that may not have a functional form. Let us open an RFC to discuss that
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
