junrushao commented on code in PR #13596: URL: https://github.com/apache/tvm/pull/13596#discussion_r1046337792
########## python/tvm/meta_schedule/relay_integration.py: ########## @@ -45,8 +45,7 @@ from .tune_context import TuneContext from .utils import fork_seed -if TYPE_CHECKING: - from tvm import relay +from tvm import relay Review Comment: > Meta-scheduler potentially can depend on relay if TYPE_CHECKING=True This is a python's type checking mechanism, so you may assume "TYPE_CHECKING" is always "False" when the program is executed: https://docs.python.org/3/library/typing.html#typing.TYPE_CHECKING > due to topi depends on relay It is a sad fact and potentially a design issue. Ideally, TOPI should never depend on Relay in the first place, because it does not need to: TOPI + TE + TIR could do code generation without much problem at all. Let's start do things in a right way from new modules like MetaSchedule or Relax. > Of course I can use from `tvm.topi.x86.utils import target_has_vnni`, but it does not change anything We could import locally in a method in `relay_integration.py`, so that the importing won't happen until users are sure that they want to import Relay. -- 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]
