Skip to content

Commit 96e6b3f

Browse files
icemelonwweic
authored andcommitted
[Bugfix] Fix target host for vm compiler (apache#4057)
* fix * tweak
1 parent 7af55cf commit 96e6b3f

File tree

1 file changed

+5
-0
lines changed
  • python/tvm/relay/backend

1 file changed

+5
-0
lines changed

python/tvm/relay/backend/vm.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ def compile(self, mod, target=None, target_host=None):
178178
"""
179179
target = _update_target(target)
180180
target_host = None if target_host == "" else target_host
181+
if not target_host:
182+
for device_type, tgt in target.items():
183+
if device_type.value == tvm.nd.cpu(0).device_type:
184+
target_host = tgt
185+
break
181186
if not target_host:
182187
target_host = "llvm" if tvm.module.enabled("llvm") else "stackvm"
183188
target_host = tvm.target.create(target_host)

0 commit comments

Comments
 (0)