Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target = None error while tuing an autotvm task #7790

Closed
huochaitiantang opened this issue Apr 2, 2021 · 1 comment · Fixed by #7791
Closed

target = None error while tuing an autotvm task #7790

huochaitiantang opened this issue Apr 2, 2021 · 1 comment · Fixed by #7791

Comments

@huochaitiantang
Copy link
Contributor

After PR7534(#7534), while tuning an autotvm task, self.target = None, self.target_host = None (default) in class tvm.autotvm.task.Task, will introduce the error :

@zxybazh

Traceback (most recent call last):
  File "test_quantize.py", line 66, in <module>
    tuner.tune(20, logfile=logfile)
  File "~/Desktop/tvms/tvm-oplib/tvmoplib/tvm_tuner/onnx_tuner.py", line 215, in tune
    tuner.load_history(tvm.autotvm.record.load_from_file(tmp_log_file))
  File "~/Desktop/tvms/tvm/python/tvm/autotvm/tuner/model_based_tuner.py", line 294, in load_history
    success = base_model.fit_log(data_set, self.plan_size)
  File "~/Desktop/tvms/tvm/python/tvm/autotvm/tuner/xgboost_cost_model.py", line 250, in fit_log
    res = pool.map(feature_extract_func, data)
  File "~/.pyenv/versions/3.6.4/lib/python3.6/multiprocessing/pool.py", line 266, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "~/.pyenv/versions/3.6.4/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
  File "~/.pyenv/versions/3.6.4/lib/python3.6/multiprocessing/pool.py", line 424, in _handle_tasks
    put(task)
  File "~/.pyenv/versions/3.6.4/lib/python3.6/multiprocessing/connection.py", line 206, in send
    self._send_bytes(_ForkingPickler.dumps(obj))
  File "~/.pyenv/versions/3.6.4/lib/python3.6/multiprocessing/reduction.py", line 51, in dumps
    cls(buf, protocol).dump(obj)
  File "~/Desktop/tvms/tvm/python/tvm/autotvm/task/task.py", line 179, in __getstate__
    self.target, self.target_host
  File "~/Desktop/tvms/tvm/python/tvm/target/target.py", line 197, in check_and_update_host_consist
    target = Target(target, host)
  File "~/Desktop/tvms/tvm/python/tvm/target/target.py", line 98, in __init__
    raise ValueError("target has to be a string or dictionary.")
ValueError: target has to be a string or dictionary.
@zxybazh
Copy link
Member

zxybazh commented Apr 2, 2021

Hi, this is a case when the target and target host are both empty, the Target constructor function would fail. I have patched the case in the new PR. Thanks for letting me know!

@comaniac comaniac linked a pull request Apr 2, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants