Skip to content

Commit

Permalink
tool: Adding support for the uv system
Browse files Browse the repository at this point in the history
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
  • Loading branch information
narendasan committed Sep 17, 2024
1 parent bc93437 commit ab14920
Show file tree
Hide file tree
Showing 5 changed files with 1,877 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cpp/include/torch_tensorrt/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define STR(x) XSTR(x)

#define TORCH_TENSORRT_MAJOR_VERSION 2
#define TORCH_TENSORRT_MINOR_VERSION 5
#define TORCH_TENSORRT_MINOR_VERSION 6
#define TORCH_TENSORRT_PATCH_VERSION 0
#define TORCH_TENSORRT_VERSION \
STR(TORCH_TENSORRT_MAJOR_VERSION) \
Expand Down
10 changes: 9 additions & 1 deletion docsrc/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ Once the WORKSPACE has been configured properly, all that is required to build t
python -m pip install --pre . --extra-index-url https://download.pytorch.org/whl/nightly/cu124
If you use the ``uv`` (`https://docs.astral.sh/uv/ <https://docs.astral.sh/uv/>`_) tool to manage python and your projects, the command is slightly simpler


.. code-block:: sh
uv pip install -e .
To build the wheel file

.. code-block:: sh
Expand Down Expand Up @@ -379,4 +387,4 @@ Compile the Python API using the following command from the ``//py`` directory:
If you have a build of PyTorch that uses Pre-CXX11 ABI drop the ``--use-cxx11-abi`` flag

If you are building for Jetpack 4.5 add the ``--jetpack-version 5.0`` flag
If you are building for Jetpack 4.5 add the ``--jetpack-version 5.0`` flag
40 changes: 33 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ requires = [
"typing-extensions>=4.7.0",
"future>=0.18.3",
"tensorrt-cu12==10.3.0",
"torch >=2.5.0.dev,<2.6.0",
"torch>=2.6.0.dev,<2.7.0",
"pybind11==2.6.2",
"numpy",
]
Expand All @@ -36,7 +36,7 @@ classifiers = [
"Topic :: Software Development :: Libraries",
]
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.8"
requires-python = ">=3.9"
keywords = [
"pytorch",
"torch",
Expand All @@ -54,7 +54,7 @@ keywords = [
"inference",
]
dependencies = [
"torch >=2.5.0.dev,<2.6.0",
"torch>=2.6.0.dev,<2.7.0",
"tensorrt-cu12==10.3.0",
"tensorrt-cu12-bindings==10.3.0",
"tensorrt-cu12-libs==10.3.0",
Expand All @@ -65,10 +65,10 @@ dependencies = [
dynamic = ["version"]

[project.optional-dependencies]
torchvision = ["torchvision >=0.20.dev,<0.21.0"]
#torchvision = ["torchvision>=0.21.dev,<0.22.0"] # Reenable once torchvision bumps to 2.6.0
quantization = ["nvidia-modelopt[deploy,hf,torch]~=0.17.0"]
monitoring-tools = ["rich >= 13.7.1"]
jupyter = ["rich[jupyter] >= 13.7.1"]
monitoring-tools = ["rich>=13.7.1"]
jupyter = ["rich[jupyter]>=13.7.1"]

[project.urls]
Homepage = "https://pytorch.org/tensorrt"
Expand All @@ -80,6 +80,32 @@ Changelog = "https://github.com/pytorch/tensorrt/releases"
package-dir = { "" = "py" }
include-package-data = false

[tool.uv]
dev-dependencies = [
"pre-commit>=2.20.0",
"black>=22.6.0",
"clang-format==14.0.6",
"mypy",
"isort",
"ruff",
"pytest",
"parameterized",
"expecttest==0.1.6",
"pyyaml",
]

environments = [
"sys_platform == 'linux'",
"sys_platform == 'windows'",
]

extra-index-url = [
"https://download.pytorch.org/whl/nightly/cu124" # We are going to define the dev enviorment as latest supported CUDA, and allow CI to handle the others, change as needed
]

prerelease = "if-necessary-or-explicit"
index-strategy = "unsafe-best-match"

[tool.ruff]
# NOTE: Synchoronize the ignores with .flake8
lint.ignore = [
Expand Down Expand Up @@ -144,7 +170,6 @@ lint.select = [

# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
target-version = "py311"

# Allow autofix for all enabled rules (when `--fix`) is provided.
lint.fixable = [
Expand Down Expand Up @@ -194,6 +219,7 @@ lint.fixable = [
"YTT",
]
lint.unfixable = []
target-version = "py311"

# Exclude a variety of commonly ignored directories.
exclude = [
Expand Down
Loading

0 comments on commit ab14920

Please sign in to comment.