tqchen opened a new pull request, #19630: URL: https://github.com/apache/tvm/pull/19630
## Summary `derived_object` was duplicated byte-for-byte across `python/tvm/runtime/support.py` and `python/tvm/s_tir/meta_schedule/utils.py`. The function is not a runtime feature and is used outside meta_schedule (tvm.relax, tvm.tirx), so neither location was the right home. Move the single canonical definition into a new `python/tvm/s_tir/utils.py` and rewrite all caller imports. Keep the better-typed `cls: type[T]) -> type[T]` signature from the runtime-side copy. After this change `runtime/support.py` is empty and is removed; `meta_schedule/__init__.py` drops its now-dead re-export. No alias shims are left behind — callers update imports directly. `tvm.tirx.functor` uses a lazy import via module `__getattr__` for `visitor`/`mutator` to avoid a circular-import: `tvm.tirx` is initialized before `tvm.s_tir`, so a top-level `from tvm.s_tir.utils import derived_object` in `tirx/functor.py` would trigger `tvm.s_tir.__init__` mid-flight and hit a `tvm.target` circular dependency. The lazy load resolves on first access after full package init. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
