Skip to content

Commit

Permalink
[Autoscheduler] Reduce task weight coercion overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Salas committed Sep 13, 2021
1 parent 1914462 commit fe34cbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/tvm/auto_scheduler/relay_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def extract_tasks(
desc=",".join(func_names),
)
)
weights.append(weight)
weights.append(int(weight))

if dump_workload_to_dag_log is not None:
with open(dump_workload_to_dag_log, "w") as f:
Expand Down
7 changes: 5 additions & 2 deletions src/node/reflection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,11 @@ runtime::TVMRetValue ReflectionVTable::GetAttr(Object* self, const String& field
}
}
if (!success) {
LOG(FATAL) << "AttributeError: " << self->GetTypeKey() << " object has no attributed "
<< getter.skey;
// This exception is typically caught, sometimes in a loop. LOG(FATAL) is very
// expensive (it collects a backtrace) so throw an explicit exception instead.
std::ostringstream os;
os << "AttributeError: " << self->GetTypeKey() << " object has no attribute " << getter.skey;
throw dmlc::Error(os.str());
}
return ret;
}
Expand Down

0 comments on commit fe34cbb

Please sign in to comment.