@@ -210,6 +210,8 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
210210 auto storage_and_device = it.second ;
211211 ICHECK_EQ (storage_and_device.size (), 2u );
212212 auto device_type = storage_and_device[1 ];
213+ std::cout << PrettyPrint (expr) << std::endl;
214+ std::cout << device_type << std::endl;
213215 tvm::Device dev;
214216 dev.device_id = 0 ;
215217 dev.device_type = static_cast <DLDeviceType>(device_type[0 ]->value );
@@ -226,6 +228,7 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
226228 });
227229
228230 auto main_module = lowered_module.main_module ;
231+ std::cout << " MainModule: " << main_module << std::endl;
229232 main_module = relay::transform::InferType ()(main_module);
230233 relay::Function main_func = Downcast<relay::Function>(main_module->Lookup (" main" ));
231234
@@ -388,33 +391,6 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
388391 if (auto global_node = call->op .as <GlobalVarNode>()) {
389392 auto prim_fn_name = global_node->name_hint ;
390393
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- }
418394
419395 return GraphAddCallNode (call_node, _GetUniqueName (prim_fn_name), prim_fn_name);
420396 } else {
0 commit comments