junrushao commented on PR #14233:
URL: https://github.com/apache/tvm/pull/14233#issuecomment-1461261642

   Hey sorry for the long delay!
   
   Sure I agree there might be usecases specific to ONNX importer, and I fully 
support a solution if the design is fully confined to the importer itself. 
Right now the primary issue with the current design is that it's been leaked to 
global IR structure, which is something we've made significant amount of effort 
last year to move away from.
   
   To provide some more context: why is `span` considered non-ideal in TVM 
stack? This is because 1) preserving `span` across transformation could be 
notoriously challenging. For example, after some TIR scheduling transformation, 
eventually the `span`s left are non-existent or meaningless; 2) the IR is 
effectively not a tree but a DAG - for example, the very same `relax.Var` or 
`tir.Buffer`/`tir.Var` may appear multiple times in different parts of the IR, 
and so they do not have a single deterministic `span`.
   
   One potential approach we might think of is to save some node-to-span 
information as a context or IR attributes, which are defined specific to ONNX. 
I'm not thinking a lot about details, but please let me know if we could 
discuss a bit further


-- 
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]

Reply via email to