tvm icon indicating copy to clipboard operation
tvm copied to clipboard

[Bug] Issue with tvmc run with repeat=0

Open f2013519 opened this issue 3 years ago • 0 comments
trafficstars

Thanks for participating in the TVM community! We use https://discuss.tvm.ai for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first :smile_cat:

Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.

Expected behavior

When we run tvmc run with repeats=0, I would expect that the inference runs for 1 time (no repeat). Also unrelated, I would expect that this is the default value, but that is debatable.

Actual behavior

We receive an error

Environment

OS: Linux 4.15.0-188-generic #199-Ubuntu SMP Wed Jun 15 20:42:56 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux tvm 0.9

Steps to reproduce

Generate a model.tar from any model and run tvmc run --inputs infer.npz --outputs predict.npz model.tar --print-time --repeat=0

/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py:3373: RuntimeWarning: Mean of empty slice. out=out, **kwargs) /usr/local/lib/python3.7/dist-packages/numpy/core/_methods.py:170: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) /usr/local/lib/python3.7/dist-packages/numpy/core/_methods.py:234: RuntimeWarning: Degrees of freedom <= 0 for slice keepdims=keepdims) /usr/local/lib/python3.7/dist-packages/numpy/core/_methods.py:195: RuntimeWarning: invalid value encountered in true_divide arrmean, rcount, out=arrmean, casting='unsafe', subok=False) /usr/local/lib/python3.7/dist-packages/numpy/core/_methods.py:226: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) Traceback (most recent call last): File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/nfs/bnusers1/kbindumadhav/kbindumadhav/tvm3/tvm/python/tvm/driver/tvmc/main.py", line 24, in tvmc.main.main() File "/nfs/bnusers1/kbindumadhav/kbindumadhav/tvm3/tvm/python/tvm/driver/tvmc/main.py", line 115, in main sys.exit(_main(sys.argv[1:])) File "/nfs/bnusers1/kbindumadhav/kbindumadhav/tvm3/tvm/python/tvm/driver/tvmc/main.py", line 103, in _main return args.func(args) File "/nfs/bnusers1/kbindumadhav/kbindumadhav/tvm3/tvm/python/tvm/driver/tvmc/runner.py", line 280, in drive_run options=options, File "/nfs/bnusers1/kbindumadhav/kbindumadhav/tvm3/tvm/python/tvm/driver/tvmc/runner.py", line 684, in run_module times = module.benchmark(dev, number=number, repeat=repeat, end_to_end=end_to_end) File "/nfs/bnusers1/kbindumadhav/kbindumadhav/tvm3/tvm/python/tvm/contrib/graph_executor.py", line 450, in benchmark repeats_to_cooldown=repeats_to_cooldown, File "/nfs/bnusers1/kbindumadhav/kbindumadhav/tvm3/tvm/python/tvm/runtime/module.py", line 354, in evaluator return BenchmarkResult(results) File "/nfs/bnusers1/kbindumadhav/kbindumadhav/tvm3/tvm/python/tvm/runtime/module.py", line 73, in init self.min = np.min(self.results) File "<array_function internals>", line 6, in amin File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 2831, in amin keepdims=keepdims, initial=initial, where=where) File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 87, in _wrapreduction return ufunc.reduce(obj, axis, dtype, out, **passkwargs) ValueError: zero-size array to reduction operation minimum which has no identity

f2013519 avatar Sep 21 '22 15:09 f2013519