mbs-octoml opened a new pull request #8788:
URL: https://github.com/apache/tvm/pull/8788


   Very rough sketch -- all I can say is it compiles...
   
   We continue the work sketched in 
https://discuss.tvm.apache.org/t/rfc-relay-tecompiler-rewrite-existing-compile-engine-to-match-updated-compiler-flow/9233
 by removing the DeviceMap as a side input to LowerTE. This helps both i) bring 
LowerTE closer to being an ordinary IRModule->IRModule pass, and ii) also 
removes the fragility of the Map<Expr, Device> side table representation which 
must be recomputed after any transformation.
   
   - We retire DeviceInfo from device_annotation.cc in favor of the newer and 
more general implementation from context_analysis.cc.
   - We rejig context_analysis.cc to be a stand-alone Pass, calling it 
MakeDevicesExplicit in make_devices_explicit.cc and move it out of analysis/ 
into transforms/.
   - Instead of returning a Map<Expr, Device>, MakeDevicesExplicit rewrites to 
insert "on_device" CallNodes at all the points where the device is not obvious 
by lexical scope of an existing "on_device" CallNode. Functions are also 
annotated with the devices of parameters.
   - All transformations which previously directly built and used the device 
map now use a helper mixin LexicalOnDeviceMixin, which recovers the equivalent 
map on-the-fly assuming the MakeDevicesExplicit pass has run. That includes:
       - graph_plan_memory.cc
       - memory_alloc.cc
       - aot_executor_codegen.cc
   - The VM, Interpreter, GraphExecutor and AOT backends include 
MakeDevicesExplicit pass.
   - Some fiddling with the 'homogenous' vs 'hetrogeneous' devices handling, 
which is probably broken and needs more cleanup.
   
   NOTE:  This PR also includes new 'VLOG' and 'VLOG_CONTEXT' logging macros. 
I'm going to use this PR to try those out since I expect this is going to need 
a lot of debug output to get working again. Obviously I'll hoist that out into 
a separate PR if I find it useful.
   


-- 
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: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to