Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions .github/scripts/install-torch-tensorrt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
set -x

TORCH=$(grep "^torch>" ${PWD}/py/requirements.txt)
TORCHVISION=$(grep "^torchvision>" ${PWD}/tests/py/requirements.txt)
INDEX_URL=https://download.pytorch.org/whl/${CHANNEL}/${CU_VERSION}
PLATFORM=$(python -c "import sys; print(sys.platform)")

Expand All @@ -13,10 +12,34 @@ if [[ $(uname -m) == "aarch64" ]]; then
fi

# Install all the dependencies required for Torch-TensorRT
pip install --pre -r ${PWD}/tests/py/requirements.txt
# dependencies in the tests/py/requirements.txt might install a different version of torch or torchvision
pip install --upgrade "pip>=25.1" "tomli>=1.1.0; python_version < '3.11'"
pip install \
--pre \
--extra-index-url https://pypi.nvidia.com \
--extra-index-url https://download.pytorch.org/whl/nightly/cu130 \
--group test \
--group test-ext \
--group quantization
TORCHVISION=$(python - <<'PY'
try:
import tomllib
except ModuleNotFoundError:
import tomli as tomllib

with open("pyproject.toml", "rb") as f:
deps = tomllib.load(f)["dependency-groups"]["test-ext"]

for dep in deps:
if dep.startswith("torchvision"):
print(dep)
break
else:
raise SystemExit("torchvision was not found in dependency group test-ext")
PY
)
# test dependencies might install a different version of torch or torchvision
# eg. timm will install the latest torchvision, however we want to use the torchvision from nightly
# reinstall torch torchvisionto make sure we have the correct version
# reinstall torch torchvision to make sure we have the correct version
pip uninstall -y torch torchvision
pip install --force-reinstall --pre ${TORCHVISION} --index-url ${INDEX_URL} --extra-index-url https://pypi.org/simple
pip install --force-reinstall --pre ${TORCH} --index-url ${INDEX_URL} --extra-index-url https://pypi.org/simple
Expand Down
2 changes: 1 addition & 1 deletion docsrc/RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ will result in a minor version bump and significant bug fixes will result in a p
4. Version bump PR
- There should be a PR which will be the PR that bumps the actual version of the library, this PR should contain the following
- Bump version in `py/setup.py`
- Make sure dependency versions are updated in `py/requirements.txt`, `tests/py/requirements.txt` and `py/setup.py`
- Make sure dependency versions are updated in `py/requirements.txt`, `pyproject.toml` dependency groups, and `py/setup.py`
- Bump version in `cpp/include/macros.h`
- Add new link to doc versions in `docsrc/conf.py`
- Generate frozen docs for new version
Expand Down
18 changes: 17 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,23 @@
def install_deps(session):
print("Installing deps")
session.install("-r", os.path.join(TOP_DIR, "py", "requirements.txt"))
session.install("-r", os.path.join(TOP_DIR, "tests", "py", "requirements.txt"))
session.install(
"--upgrade",
"pip>=25.1",
)
session.install(
"--pre",
"--extra-index-url",
"https://pypi.nvidia.com",
"--extra-index-url",
"https://download.pytorch.org/whl/nightly/cu130",
"--group",
"test",
"--group",
"test-ext",
"--group",
"quantization",
)


def download_models(session):
Expand Down
17 changes: 11 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,22 @@ debug = [
]

test = [
"pytest",
"pytest-xdist",
"pytest-forked>=1.6.0",
"parameterized>=0.2.0",
"expecttest==0.1.6",
"networkx",
"numpy",
"parameterized>=0.2.0",
"pytest>=8.2.1",
"pytest-forked>=1.6.0",
"pytest-xdist>=3.6.1",
"pyyaml",
"setuptools",
]

test-ext = [
"timm>=1.0.3",
"transformers>=5.0.0",
"torchvision>=0.27.0.dev,<0.28.0",
"flashinfer-python; python_version >'3.9' and python_version <'3.13'",
#"nvidia-modelopt[hf]@git+https://github.com/NVIDIA/Model-Optimizer.git; python_version >'3.10' and python_version <'3.14'"
]

docs = [
Expand All @@ -102,7 +105,9 @@ docs = [
"pillow",
]

quantization = ["nvidia-modelopt[hf]>=0.43.0"]
quantization = [
"nvidia-modelopt[hf]>=0.43.0; python_version > '3.9' and python_version < '3.13'",
]

[project.urls]
Homepage = "https://pytorch.org/tensorrt"
Expand Down
21 changes: 2 additions & 19 deletions tests/py/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
# This file is specifically to install correct version of libraries during CI testing.
# networkx library issue: https://discuss.pytorch.org/t/installing-pytorch-under-python-3-8-question-about-networkx-version/196740
expecttest
networkx
numpy
setuptools
parameterized>=0.2.0
pytest>=8.2.1
pytest-xdist>=3.6.1
pyyaml
transformers==4.53.1
nvidia-modelopt[all]; python_version >'3.9' and python_version <'3.13'
--extra-index-url https://pypi.nvidia.com
# flashinfer-python is not supported for python version 3.13 or higher
# flashinfer-python is broken on python 3.9 at the moment, so skip it for now
flashinfer-python; python_version >'3.9' and python_version <'3.13'
--extra-index-url https://download.pytorch.org/whl/nightly/cu130
torchvision>=0.27.0.dev,<0.28.0
timm>=1.0.3
# Compatibility stub for tooling that still expects this file to exist.
# Shared test dependencies live in pyproject.toml dependency groups.
Loading