junrushao commented on PR #14233: URL: https://github.com/apache/tvm/pull/14233#issuecomment-1465089393
Some further comments: One thing that we need to consider here is the overall engineering overhead and execution time in maintaining the tracking. I agree such tracking would be useful, however, relying solely on it for error reporting would be problematic since inaccurate tracking results in garbage-in-garbage-out situation. Such information also becomes less useful (and harder to accurately track) as we goes further deeper into the pipeline. As a reference, solutions like Torch FX do not come with span information as there is 1-1 correspondence with the current state of transformation (when they turn back into python). In our case, having TVMScript at the current point, together with ObjectPath and use object itself, for error reporting. See [how](https://github.com/apache/tvm/blob/unity/src/relax/op/op_common.h#L107) existing error reporting leverages this mechanism that will provide something that always works even when span is not available. Note that it is always possible to recover `obj->span` if it is available, and there can be helpful scenarios in frontend that tracks span and early transformations. So my recommendation would be: - Encourage all error reporting to report object which leverages ObjectPath, which by default provide good amount of error mechanisms regardless how accurate span get tracked. - The span information remains optional and can be used when available. -- 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]
