Skip to content

Commit

Permalink
[TVMC] Only load extra targets when there are workspace pools
Browse files Browse the repository at this point in the history
After apache#11427, `tvmc compile` wouldn't work for external codegens that
don't have a `Target` registered by `TVM_REGISTER_TARGET_KIND`. Such
external codegens can be expected to have no workspace pools and may not
always have a target associated as their implementation predates this
mechanism. While it is likely a `Target` is specified for all external
codegens in the future, we should still support external codegens
without an associated `Target` until this is enforced.

Change-Id: Ida8bf85ed1cafd301b9465641c66a5370d73c429
  • Loading branch information
lhutton1 committed Aug 1, 2022
1 parent a49273e commit 1924b41
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions python/tvm/driver/tvmc/workspace_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,6 @@ def workspace_pools_recombobulate(parsed, targets, extra_target):
"workspace_pools_target_burst_bytes",
]

# Load extra targets from CLI
additional_targets = []

for t in extra_target:
additional_targets.append(Target(t["raw"], host=targets[0].host or targets[0]))

target = targets + additional_targets
if targets[0].host:
target.append(targets[0].host)

workspace_pools = _split_pools_to_pool_names(parsed.workspace_pools)
if not workspace_pools:
return None
Expand All @@ -186,6 +176,16 @@ def workspace_pools_recombobulate(parsed, targets, extra_target):
for workspace_pool_param in WORKSPACE_POOL_TARGET_PARAMS
}

# Load extra targets from CLI
additional_targets = []

for t in extra_target:
additional_targets.append(Target(t["raw"], host=targets[0].host or targets[0]))

target = targets + additional_targets
if targets[0].host:
target.append(targets[0].host)

return WorkspaceMemoryPools(
[
WorkspacePoolInfo(
Expand Down

0 comments on commit 1924b41

Please sign in to comment.