mbs-octoml commented on code in PR #11173:
URL: https://github.com/apache/tvm/pull/11173#discussion_r865027674
##########
src/relay/backend/te_compiler.cc:
##########
@@ -952,25 +919,24 @@ backend::FunctionInfo UpdateMainWorkspaceSize(const
IRModule& mod, tec::TargetMa
Map<Target, Function> relay_primfuncs;
// Initialize all target workspaces to zero
- for (const auto& kv : targets) {
- auto tgt = kv.second;
- workspace_sizes.Set(tgt, 0);
+ for (const auto& target : config->primitive_targets) {
+ workspace_sizes.Set(target, 0);
}
for (const auto& dev_and_size : device_workspace) {
- auto tgt = tec::GetTargetFromInteger(dev_and_size.first, targets);
- workspace_sizes.Set(tgt, dev_and_size.second);
- relay_primfuncs.Set(tgt, func);
+ Target target = config->FindPrimitiveTargetOrFail(dev_and_size.first);
Review Comment:
Indeed we are still in a transitionary state, moving from using device types
as the only distinguishing property in the heterogenous case to using for
VirtualDevices. Eventually FindPrimitiveTargetOrFail will only be needed by the
PlanDevices pass when it needs to choose targets to match its device assignment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]