You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "tlopex (via GitHub)" <gi...@apache.org> on 2026/06/10 19:59:06 UTC
[PR] [Python] Refactor pyproject.toml dependencies [tvm]
tlopex opened a new pull request, #19723:
URL: https://github.com/apache/tvm/pull/19723
This pr refactors `pyproject.toml` and deletes redundant dependencies
--
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: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [Python] Refactor pyproject.toml dependencies [tvm]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #19723:
URL: https://github.com/apache/tvm/pull/19723#discussion_r3391154479
##########
python/tvm/s_tir/meta_schedule/utils.py:
##########
@@ -56,6 +55,8 @@ def _cpu_count_impl(logical: bool = True) -> int:
Setting these variables may interfere the host-side search with profiling of generated kernels
when measuring locally.
"""
+ import psutil # type: ignore # pylint: disable=import-outside-toplevel
+
return psutil.cpu_count(logical=logical) or 1
Review Comment:

Since `psutil` has been removed from the main dependencies and made optional, importing it directly will raise a `ModuleNotFoundError` if the `meta-schedule` extra is not installed. To make this utility robust, we should catch `ImportError` and fall back to the standard library's `os.cpu_count()`.
```suggestion
try:
import psutil # type: ignore # pylint: disable=import-outside-toplevel
return psutil.cpu_count(logical=logical) or 1
except ImportError:
return os.cpu_count() or 1
```
##########
pyproject.toml:
##########
@@ -48,18 +48,19 @@ dependencies = [
"apache-tvm-ffi>=0.1.12",
"ml_dtypes",
"numpy",
- "psutil",
"typing_extensions",
]
[project.optional-dependencies]
-torch = ["torch"]
importer-onnx = ["onnx", "onnxoptimizer", "onnxruntime"]
-importer-pytorch = ["torch", "torchvision"]
+importer-torch = ["torch", "torchvision"]
Review Comment:

Renaming the optional dependency group from `importer-pytorch` to `importer-torch` is a breaking change for users and automated scripts that install TVM using `pip install "apache-tvm[importer-pytorch]"`. To prevent breaking backward compatibility, please keep `importer-pytorch` as an alias.
```suggestion
importer-torch = ["torch", "torchvision"]
importer-pytorch = ["torch", "torchvision"]
```
--
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: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [Python] Refactor pyproject.toml dependencies [tvm]
Posted by "tlopex (via GitHub)" <gi...@apache.org>.
tlopex merged PR #19723:
URL: https://github.com/apache/tvm/pull/19723
--
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: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org