FrozenGene commented on a change in pull request #6391:
URL: https://github.com/apache/incubator-tvm/pull/6391#discussion_r483128177
##########
File path: python/tvm/auto_scheduler/measure.py
##########
@@ -657,9 +692,11 @@ def timed_func():
if error_no == 0:
try:
- # TODO(FrozenGene): Update to ndarray.non-empty.
args = [ndarray.empty(get_const_tuple(x.shape), x.dtype, ctx)
for x in
build_res.args]
+ random_fill =
remote.get_function("tvm.contrib.random.random_fill")
Review comment:
I think about it for a while when I implemented it. One possible way to
support both ways is:
```python
if not tvm.get_global_func("tvm.contrib.random.random_fill", True):
args = [np.empty()...]
else
args = [np.empty()...]
random_fill(value)
```
However, `empty` can not make us get precise measure result. And as
`USE_RANDOM` is set to be `ON` by default and we don't have any special reasons
to turn it off until now (like we won't turn off `USE_GRAPHRUNTIME`), so I
prefer only maintain current code implementation. Of course, we could have one
debate here. But IMO, I like we expose the error in compilation (for example,
miss symbol) rather than make it pass but get the result we don't like (for
example we go to the way of `empty` but get not enough precise measure result).
----------------------------------------------------------------
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]