@@ -210,6 +210,8 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
210
210
auto storage_and_device = it.second ;
211
211
ICHECK_EQ (storage_and_device.size (), 2u );
212
212
auto device_type = storage_and_device[1 ];
213
+ std::cout << PrettyPrint (expr) << std::endl;
214
+ std::cout << device_type << std::endl;
213
215
tvm::Device dev;
214
216
dev.device_id = 0 ;
215
217
dev.device_type = static_cast <DLDeviceType>(device_type[0 ]->value );
@@ -226,6 +228,7 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
226
228
});
227
229
228
230
auto main_module = lowered_module.main_module ;
231
+ std::cout << " MainModule: " << main_module << std::endl;
229
232
main_module = relay::transform::InferType ()(main_module);
230
233
relay::Function main_func = Downcast<relay::Function>(main_module->Lookup (" main" ));
231
234
@@ -388,33 +391,6 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
388
391
if (auto global_node = call->op .as <GlobalVarNode>()) {
389
392
auto prim_fn_name = global_node->name_hint ;
390
393
391
- Target target;
392
-
393
- ICHECK_GE (storage_device_map_.count (call), 0 )
394
- << " Could not find a storage device for " << prim_fn_name
395
- << " The memory planning was either not performed for this precise node, or there is bug "
396
- " in the memory planner." ;
397
-
398
- auto & device_type = storage_device_map_[call][1 ];
399
- auto call_dev_type = device_type[0 ]->value ;
400
- // Normal Relay Function
401
- if (targets_.size () == 1 ) {
402
- // homogeneous execution.
403
- const auto & it = targets_.begin ();
404
- target = (*it).second ;
405
- } else {
406
- // heterogeneous execution.
407
- std::string call_dev_name;
408
- if (call_dev_type == 0 ) {
409
- call_dev_name = " llvm" ;
410
- } else {
411
- call_dev_name = runtime::DeviceName (call_dev_type);
412
- }
413
- if (targets_.count (call_dev_type) == 0 ) {
414
- LOG (FATAL) << " No target is provided for device " << call_dev_name;
415
- }
416
- target = targets_[call_dev_type];
417
- }
418
394
419
395
return GraphAddCallNode (call_node, _GetUniqueName (prim_fn_name), prim_fn_name);
420
396
} else {
0 commit comments