yelite commented on PR #13012: URL: https://github.com/apache/tvm/pull/13012#issuecomment-1333255539
> One shortcut this PR takes is to explicitly avoid TVM script (at least for source reporting) and use the TIR text printer so it can be run at any point in the compilation pipeline. I think the eventual plan would be to have true source line numbers from the actual written TVM script rather than the generated TIR The new TVMScript printer is able to print IR fragments (not constraining to print IRModule and PrimFunc only). And it's able to record span of an IR node based on printed result (https://github.com/apache/tvm/blob/main/src/script/printer/base_doc_printer.cc#L331, used for diagnostic marker printing) and distinguish the same node in different places (for example, the same VarNode can be found in different places of the IR graph). The implementation of TIR printing is finished. But we need to sort out the detail on how to track ObjectPath in a more ergonomic and readable way before finally upstreaming this part. The plan of migrating to TVMScript printer sounds good to me. If we are interested in tracing back to the TVMScript code of Var or Buffer, we need to be aware of that such nodes can appear multiple times in the graph (which means multiple spans in the TVMScript code), and the 1-1 mapping between node and span in TVM will cause some trouble. -- 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]
