tlopex opened a new pull request, #19658: URL: https://github.com/apache/tvm/pull/19658
### Motivation `tvm.testing` imports `pytest` at module load (`tvm/testing/utils.py`). `tvm.rpc.server` imports `tvm.rpc.testing` (to register the `rpc.test.*` helpers), and `tvm.rpc.testing` imported `tvm.testing` at the top level, so a plain `import tvm` / `import tvm.relax` pulls `pytest` in through: ``` tvm.relax -> tvm.runtime.vm -> tvm.rpc -> rpc.server -> rpc.testing -> tvm.testing -> pytest ``` As a result `pytest` is effectively a runtime dependency: a user who installs TVM without `pytest` hits `ModuleNotFoundError: No module named 'pytest'` on import. This is easy to miss because test environments install `pytest`. ### Change `tvm.rpc.testing` only uses `tvm.testing.object_use_count` in a single test helper, so import it lazily at the call site instead of at module top level. This keeps the `rpc.test.*` registration and the helper behavior intact while removing `tvm.testing` (and `pytest`) from the `import tvm` path, so `pytest` can remain a test-only dependency. No functional change; `rpc.testing` is still imported by `rpc.server` and still registers the same global functions. -- 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]
