tkonolige commented on a change in pull request #8802:
URL: https://github.com/apache/tvm/pull/8802#discussion_r692529259
##########
File path: src/relay/backend/te_compiler.cc
##########
@@ -875,6 +878,121 @@ LoweredModule LowerTE(const IRModule& module, TargetMap
targets, DeviceMap devic
return lowered_module;
}
+IRModule LoweredModuleToIRModule(LoweredModule mod) {
+ Map<GlobalVar, BaseFunc> unified_funcs;
+ Map<GlobalTypeVar, TypeData> unified_type_defs;
+
+ // copy main module funcs to unified funcs (what target do we need to
annotate with here?)
Review comment:
Is the `(what target do we need to annotate with here?)` a todo?
##########
File path: src/relay/backend/te_compiler.cc
##########
@@ -593,6 +593,14 @@ Pass LowerTensorExpr(TargetMap targets, DeviceMap
device_context_map,
return CreateFunctionPass(pass_func, 0, "LowerTensorExpr", {});
}
+/*!
+ * \brief Obtain the Target from the device type.
+ * If homogenous compilation, this will return the only target.
+ * If heteregenous compilation, this will select associated using the targets_
Map.
Review comment:
```suggestion
* If heteregenous compilation, this will select the associated target using
the targets_ Map.
```
##########
File path: python/tvm/relay/backend/graph_executor_codegen.py
##########
@@ -53,7 +53,7 @@ def __init__(self, mod, target):
self._get_irmodule = self._mod["get_irmodule"]
self._setup(mod, target)
- def _setup(self, mod, target):
+ def _setup(self, mod, target: Dict[int, Target]):
Review comment:
Can you annotate mod too? (Though this kinda seems like a change that
accidentally slipped into this PR).
##########
File path: src/relay/backend/te_compiler.h
##########
@@ -184,12 +206,15 @@ Target GetTargetFromInteger(DLDeviceType dev_type,
TargetMap targets);
* \param device_map An analysis result mapping each sub-expression to a
device.
* \return The lowered module, see above.
*/
-// TODO(@electriclilies): Not sure if this default initialization is correct...
LoweredModule LowerTE(
const IRModule& module, TargetMap targets, DeviceMap device_map,
backend::StaticMemoryPlan memory_plan, const String& module_name,
ProcessFn process_fn = [](Function f) {});
+using namespace transform;
+Pass LowerTEPass(TargetMap targets, DeviceMap device_context_map,
Review comment:
Can you document this?
--
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]