From dacad6b6c31746eed70b25ab334059c86eb6c8da Mon Sep 17 00:00:00 2001 From: "Zewen (Evan) Li" Date: Mon, 6 Jul 2026 14:23:29 -0700 Subject: [PATCH 1/5] fix: high vulnerabilities (#4371) --- pyproject.toml | 6 +++--- uv.lock | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c9c262e797..c13a6d2e3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,7 +80,7 @@ test = [ "networkx", "numpy", "parameterized>=0.2.0", - "pytest>=8.2.1", + "pytest>=9.0.3", "pytest-forked>=1.6.0", "pytest-xdist>=3.6.1", "pyyaml", @@ -89,8 +89,8 @@ test = [ test-ext = [ "timm>=1.0.3", - "transformers>=5.0.0", - "torchvision>=0.27.0,<0.28.0", + "transformers>=5.3.0", + "torchvision>=0.29.0.dev,<0.30.0", "flashinfer-python; python_version >'3.9' and python_version <'3.13'", ] diff --git a/uv.lock b/uv.lock index 6971342432..3d1bdcb90e 100644 --- a/uv.lock +++ b/uv.lock @@ -3207,7 +3207,7 @@ wheels = [ [[package]] name = "pytest" -version = "8.4.2" +version = "9.1.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama", marker = "sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, @@ -3218,9 +3218,9 @@ dependencies = [ { name = "pygments", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "tomli", marker = "(python_full_version < '3.11' and sys_platform == 'linux') or (python_full_version < '3.11' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618, upload-time = "2025-09-04T14:34:22.711Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750, upload-time = "2025-09-04T14:34:20.226Z" }, + { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" }, ] [[package]] @@ -4445,7 +4445,7 @@ dev = [ { name = "numpy" }, { name = "parameterized", specifier = ">=0.2.0" }, { name = "pre-commit", specifier = ">=2.20.0" }, - { name = "pytest", specifier = ">=8.2.1" }, + { name = "pytest", specifier = ">=9.0.3" }, { name = "pytest-forked", specifier = ">=1.6.0" }, { name = "pytest-xdist", specifier = ">=3.6.1" }, { name = "pyyaml" }, @@ -4474,7 +4474,7 @@ test = [ { name = "networkx" }, { name = "numpy" }, { name = "parameterized", specifier = ">=0.2.0" }, - { name = "pytest", specifier = ">=8.2.1" }, + { name = "pytest", specifier = ">=9.0.3" }, { name = "pytest-forked", specifier = ">=1.6.0" }, { name = "pytest-xdist", specifier = ">=3.6.1" }, { name = "pyyaml" }, @@ -4483,8 +4483,8 @@ test = [ test-ext = [ { name = "flashinfer-python", marker = "python_full_version >= '3.10' and python_full_version < '3.13'" }, { name = "timm", specifier = ">=1.0.3" }, - { name = "torchvision", specifier = ">=0.27.0.dev0,<0.28.0", index = "https://download.pytorch.org/whl/nightly/cu130" }, - { name = "transformers", specifier = ">=5.0.0" }, + { name = "torchvision", specifier = ">=0.29.0.dev0,<0.30.0", index = "https://download.pytorch.org/whl/nightly/cu130" }, + { name = "transformers", specifier = ">=5.3.0" }, ] [[package]] @@ -4745,11 +4745,11 @@ wheels = [ [[package]] name = "urllib3" -version = "2.6.3" +version = "2.7.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c7/24/5f1b3bdffd70275f6661c76461e25f024d5a38a46f04aaca912426a2b1d3/urllib3-2.6.3.tar.gz", hash = "sha256:1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed", size = 435556, upload-time = "2026-01-07T16:24:43.925Z" } +sdist = { url = "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c", size = 433602, upload-time = "2026-05-07T16:13:18.596Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/39/08/aaaad47bc4e9dc8c725e68f9d04865dbcb2052843ff09c97b08904852d84/urllib3-2.6.3-py3-none-any.whl", hash = "sha256:bf272323e553dfb2e87d9bfd225ca7b0f467b919d7bbd355436d3fd37cb0acd4", size = 131584, upload-time = "2026-01-07T16:24:42.685Z" }, + { url = "https://files.pythonhosted.org/packages/7f/3e/5db95bcf282c52709639744ca2a8b149baccf648e39c8cc87553df9eae0c/urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897", size = 131087, upload-time = "2026-05-07T16:13:17.151Z" }, ] [[package]] From 4b5a9293c90bbce4c2378092c9000017ab105e06 Mon Sep 17 00:00:00 2001 From: "Zewen (Evan) Li" Date: Tue, 7 Jul 2026 13:35:42 -0700 Subject: [PATCH 2/5] chore: upgrade some lib versions due to vulnerabilities (#4387) --- docker/ngc_test/requirements.txt | 4 +- examples/dynamo/requirements.txt | 2 +- pyproject.toml | 7 +- requirements-dev.txt | 2 +- tests/modules/requirements.txt | 2 +- .../jp_workspaces/test_requirements.txt | 4 +- tools/perf/requirements.txt | 2 +- uv.lock | 206 +++++++----------- 8 files changed, 86 insertions(+), 143 deletions(-) diff --git a/docker/ngc_test/requirements.txt b/docker/ngc_test/requirements.txt index 08e90b6a9e..104a0b40d4 100644 --- a/docker/ngc_test/requirements.txt +++ b/docker/ngc_test/requirements.txt @@ -5,9 +5,9 @@ networkx numpy setuptools parameterized>=0.2.0 -pytest>=8.2.1 +pytest>=9.0.3 pytest-xdist>=3.6.1 pyyaml -transformers==5.0.0rc3 +transformers>=5.3.0 timm # torchvision nvidia-modelopt should use the one already installed inside the dlfw docker container \ No newline at end of file diff --git a/examples/dynamo/requirements.txt b/examples/dynamo/requirements.txt index 887139f48b..e89dc2dc80 100644 --- a/examples/dynamo/requirements.txt +++ b/examples/dynamo/requirements.txt @@ -1,7 +1,7 @@ cupy==13.1.0 triton==2.3.0 diffusers==0.30.3 -transformers==5.0.0rc3 +transformers>=5.3.0 matplotlib pandas huggingface_hub diff --git a/pyproject.toml b/pyproject.toml index c13a6d2e3a..d42932c6d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ test = [ test-ext = [ "timm>=1.0.3", - "transformers>=5.3.0", + "transformers", "torchvision>=0.29.0.dev,<0.30.0", "flashinfer-python; python_version >'3.9' and python_version <'3.13'", ] @@ -106,7 +106,7 @@ docs = [ ] quantization = [ - "nvidia-modelopt[hf]>=0.43.0; python_version > '3.9' and python_version < '3.13'", + "nvidia-modelopt[hf]>=0.44.0; python_version > '3.9' and python_version < '3.13'", ] # Optional runtime deps for the torch_tensorrt.kernels QDP-plugin layer, @@ -158,6 +158,9 @@ conflicts = [ { group = "quantization" }, ], ] +constraint-dependencies = [ + "transformers>=5.3.0", +] [tool.uv.sources] torch = [ diff --git a/requirements-dev.txt b/requirements-dev.txt index 9846bee299..6244174272 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ clang-format==14.0.6 mypy isort ruff -pytest +pytest>=9.0.3 parameterized expecttest==0.1.6 pyyaml diff --git a/tests/modules/requirements.txt b/tests/modules/requirements.txt index 8608dc88a4..a0ec827ee9 100644 --- a/tests/modules/requirements.txt +++ b/tests/modules/requirements.txt @@ -1,2 +1,2 @@ timm==0.9.12 -transformers==5.0.0rc3 +transformers>=5.3.0 diff --git a/toolchains/jp_workspaces/test_requirements.txt b/toolchains/jp_workspaces/test_requirements.txt index 1d8a5eb97d..d52deefbbc 100644 --- a/toolchains/jp_workspaces/test_requirements.txt +++ b/toolchains/jp_workspaces/test_requirements.txt @@ -2,8 +2,8 @@ expecttest==0.1.6 networkx==2.8.8 numpy<2.0.0 parameterized>=0.2.0 -pytest>=8.2.1 +pytest>=9.0.3 pytest-xdist>=3.6.1 pyyaml -transformers +transformers>=5.3.0 # TODO: currently timm torchvision nvidia-modelopt does not have distributions for jetson \ No newline at end of file diff --git a/tools/perf/requirements.txt b/tools/perf/requirements.txt index 24d882770c..893313eecd 100644 --- a/tools/perf/requirements.txt +++ b/tools/perf/requirements.txt @@ -3,7 +3,7 @@ argparse pyyaml onnx pandas -transformers==5.0.0rc3 +transformers>=5.3.0 diffusers==0.34.0 timm==0.9.8 monai==1.5.2rc1 diff --git a/uv.lock b/uv.lock index 3d1bdcb90e..0ca3ebbb6e 100644 --- a/uv.lock +++ b/uv.lock @@ -29,15 +29,15 @@ conflicts = [[ { package = "torch-tensorrt", group = "test-ext" }, ]] -[options] -prerelease-mode = "allow" +[manifest] +constraints = [{ name = "transformers", specifier = ">=5.3.0" }] [[package]] name = "accelerate" version = "1.13.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "huggingface-hub", version = "0.36.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, + { name = "huggingface-hub", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "numpy", version = "2.2.6", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "numpy", version = "2.4.4", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "packaging", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, @@ -717,7 +717,7 @@ dependencies = [ { name = "filelock", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "fsspec", version = "2026.2.0", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, extra = ["http"], marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "httpx", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "huggingface-hub", version = "0.36.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, + { name = "huggingface-hub", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "multiprocess", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "numpy", version = "2.2.6", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "numpy", version = "2.4.4", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, @@ -771,7 +771,7 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "filelock", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "httpx", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "huggingface-hub", version = "0.36.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, + { name = "huggingface-hub", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "importlib-metadata", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "numpy", version = "2.2.6", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "numpy", version = "2.4.4", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, @@ -1234,65 +1234,20 @@ wheels = [ { url = "https://download.pytorch.org/whl/nightly/httpx-0.28.1-py3-none-any.whl", upload-time = "2025-09-17T03:11:10Z" }, ] -[[package]] -name = "huggingface-hub" -version = "0.36.2" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'aarch64' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'x86_64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine == 'aarch64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine == 'x86_64' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine != 'AMD64' and sys_platform == 'win32'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'AMD64' and sys_platform == 'win32'", - "python_full_version < '3.11' and platform_machine != 'AMD64' and sys_platform == 'win32'", - "python_full_version < '3.11' and platform_machine == 'AMD64' and sys_platform == 'win32'", -] -dependencies = [ - { name = "filelock", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "fsspec", version = "2026.2.0", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "hf-xet", marker = "(python_full_version < '3.14' and platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and platform_machine == 'amd64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and platform_machine == 'aarch64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and platform_machine == 'amd64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and platform_machine == 'x86_64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (platform_machine != 'aarch64' and platform_machine != 'amd64' and platform_machine != 'arm64' and platform_machine != 'x86_64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine != 'aarch64' and platform_machine != 'amd64' and platform_machine != 'arm64' and platform_machine != 'x86_64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'amd64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'arm64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'aarch64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'amd64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'arm64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'x86_64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "packaging", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "pyyaml", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "requests", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "tqdm", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "typing-extensions", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/7c/b7/8cb61d2eece5fb05a83271da168186721c450eb74e3c31f7ef3169fa475b/huggingface_hub-0.36.2.tar.gz", hash = "sha256:1934304d2fb224f8afa3b87007d58501acfda9215b334eed53072dd5e815ff7a", size = 649782, upload-time = "2026-02-06T09:24:13.098Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/a8/af/48ac8483240de756d2438c380746e7130d1c6f75802ef22f3c6d49982787/huggingface_hub-0.36.2-py3-none-any.whl", hash = "sha256:48f0c8eac16145dfce371e9d2d7772854a4f591bcb56c9cf548accf531d54270", size = 566395, upload-time = "2026-02-06T09:24:11.133Z" }, -] - [[package]] name = "huggingface-hub" version = "1.11.0" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.14' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'aarch64' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'x86_64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine == 'aarch64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine == 'x86_64' and sys_platform == 'linux'", - "python_full_version >= '3.14' and sys_platform == 'win32'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine != 'AMD64' and sys_platform == 'win32'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'AMD64' and sys_platform == 'win32'", - "python_full_version < '3.11' and platform_machine != 'AMD64' and sys_platform == 'win32'", - "python_full_version < '3.11' and platform_machine == 'AMD64' and sys_platform == 'win32'", -] dependencies = [ - { name = "filelock", marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "fsspec", version = "2026.3.0", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "hf-xet", marker = "(python_full_version >= '3.14' and platform_machine == 'AMD64' and sys_platform == 'linux') or (python_full_version >= '3.14' and platform_machine == 'aarch64' and sys_platform == 'linux') or (python_full_version >= '3.14' and platform_machine == 'amd64' and sys_platform == 'linux') or (python_full_version >= '3.14' and platform_machine == 'arm64' and sys_platform == 'linux') or (python_full_version >= '3.14' and platform_machine == 'x86_64' and sys_platform == 'linux') or (python_full_version >= '3.14' and platform_machine == 'AMD64' and sys_platform == 'win32') or (python_full_version >= '3.14' and platform_machine == 'aarch64' and sys_platform == 'win32') or (python_full_version >= '3.14' and platform_machine == 'amd64' and sys_platform == 'win32') or (python_full_version >= '3.14' and platform_machine == 'arm64' and sys_platform == 'win32') or (python_full_version >= '3.14' and platform_machine == 'x86_64' and sys_platform == 'win32') or (platform_machine != 'AMD64' and platform_machine != 'aarch64' and platform_machine != 'amd64' and platform_machine != 'arm64' and platform_machine != 'x86_64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine != 'AMD64' and platform_machine != 'aarch64' and platform_machine != 'amd64' and platform_machine != 'arm64' and platform_machine != 'x86_64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'AMD64' and sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (platform_machine == 'aarch64' and sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (platform_machine == 'amd64' and sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (platform_machine == 'arm64' and sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (platform_machine == 'AMD64' and sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (platform_machine == 'aarch64' and sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (platform_machine == 'amd64' and sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (platform_machine == 'arm64' and sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (platform_machine == 'x86_64' and sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (platform_machine == 'AMD64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'amd64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'arm64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'AMD64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'aarch64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'amd64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'arm64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (platform_machine == 'x86_64' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "httpx", marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "packaging", marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "pyyaml", marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "tqdm", marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "typer", marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "typing-extensions", marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "filelock", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "fsspec", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "hf-xet", marker = "(platform_machine == 'AMD64' and sys_platform == 'linux') or (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'amd64' and sys_platform == 'linux') or (platform_machine == 'arm64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux') or (platform_machine == 'AMD64' and sys_platform == 'win32') or (platform_machine == 'aarch64' and sys_platform == 'win32') or (platform_machine == 'amd64' and sys_platform == 'win32') or (platform_machine == 'arm64' and sys_platform == 'win32') or (platform_machine == 'x86_64' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "httpx", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "packaging", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "pyyaml", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "tqdm", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "typer", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "typing-extensions", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/dc/89/e7aa12d8a6b9259bed10671abb25ae6fa437c0f88a86ecbf59617bae7759/huggingface_hub-1.11.0.tar.gz", hash = "sha256:15fb3713c7f9cdff7b808a94fd91664f661ab142796bb48c9cd9493e8d166278", size = 761749, upload-time = "2026-04-16T13:07:39.73Z" } wheels = [ @@ -2439,7 +2394,7 @@ wheels = [ [[package]] name = "nvidia-modelopt" -version = "0.43.0" +version = "0.45.0" source = { registry = "https://pypi.nvidia.com/" } dependencies = [ { name = "ninja", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, @@ -2461,7 +2416,7 @@ dependencies = [ { name = "tqdm", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, ] wheels = [ - { url = "https://pypi.nvidia.com/nvidia-modelopt/nvidia_modelopt-0.43.0-py3-none-any.whl", hash = "sha256:fe11a49e16230435b3a17153bcdb5717b2859a61544cdbe9dcb3f062ba2c203a" }, + { url = "https://pypi.nvidia.com/nvidia-modelopt/nvidia_modelopt-0.45.0-py3-none-any.whl", hash = "sha256:04e1d787898e44e7281022f4772ee57bf59d1224cbcdd10d9487c2a110687a30" }, ] [package.optional-dependencies] @@ -2470,11 +2425,12 @@ hf = [ { name = "datasets", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "deepspeed", marker = "python_full_version < '3.14' and sys_platform == 'linux'" }, { name = "diffusers", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "huggingface-hub", version = "0.36.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, + { name = "huggingface-hub", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "nltk", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "peft", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "sentencepiece", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "transformers", version = "4.57.6", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, + { name = "tiktoken", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, + { name = "transformers", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "wonderwords", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, ] @@ -2681,7 +2637,7 @@ version = "0.19.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "accelerate", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "huggingface-hub", version = "0.36.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, + { name = "huggingface-hub", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "numpy", version = "2.2.6", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "numpy", version = "2.4.4", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "packaging", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, @@ -2690,7 +2646,7 @@ dependencies = [ { name = "safetensors", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "torch", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, { name = "tqdm", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "transformers", version = "4.57.6", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, + { name = "transformers", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/86/cf/037f1e3d5186496c05513a6754639e2dab3038a05f384284d49a9bd06a2d/peft-0.19.1.tar.gz", hash = "sha256:0d97542fe96dcdaa20d3b81c06f26f988618f416a73544ab23c3618ccb674a40", size = 763738, upload-time = "2026-04-16T15:46:45.105Z" } wheels = [ @@ -3236,6 +3192,31 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f4/af/9c0bda43e486a3c9bf1e0f876d0f241bc3f229d7d65d09331a0868db9629/pytest_forked-1.6.0-py3-none-any.whl", hash = "sha256:810958f66a91afb1a1e2ae83089d8dc1cd2437ac96b12963042fbb9fb4d16af0", size = 4897, upload-time = "2023-02-12T23:22:26.022Z" }, ] +[[package]] +name = "pytest-github-actions-annotate-failures" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/00/a0/bdb91581b03c41016c78e16b8ec36c34d8508206fcb30f1951c9cdff2e97/pytest_github_actions_annotate_failures-0.4.2.tar.gz", hash = "sha256:5dd18304512361788bc7b5c5c805db853f03f4950c6be09b088de6bab8e2e6c9", size = 12158, upload-time = "2026-06-19T15:59:17.445Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3c/09/c44e658f3a27c588c2017d858c8b0fa962612af9b74326beabbf010c839c/pytest_github_actions_annotate_failures-0.4.2-py3-none-any.whl", hash = "sha256:02911cd3b55f235328a334f8ca6037a89944398b8e8b028c82de97111eff4071", size = 6151, upload-time = "2026-06-19T15:59:16.486Z" }, +] + +[[package]] +name = "pytest-rerunfailures" +version = "16.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "pytest", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/47/60/a90ca1cc6cffcb97b4260ed0ad2b7934b999d7c48abe4ea0840344862a3b/pytest_rerunfailures-16.4.tar.gz", hash = "sha256:8222d17c37eb7b9e4d6fc96a3c724ff4e1a5c97a5cc7cbb2c19e9282cfd21a11", size = 36635, upload-time = "2026-07-01T06:30:56.813Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ce/93/3cdcc4033444e822e01b573414b03fd37fd5533070c750477b8f5fa5224b/pytest_rerunfailures-16.4-py3-none-any.whl", hash = "sha256:f69b5beb39622c90d1e44bd945d826eff6db545dcf0b68f52b7e4ad15eaf6d6c", size = 16955, upload-time = "2026-07-01T06:30:55.333Z" }, +] + [[package]] name = "pytest-xdist" version = "3.8.0" @@ -4184,7 +4165,7 @@ name = "timm" version = "1.0.26" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "huggingface-hub", version = "1.11.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, + { name = "huggingface-hub", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, { name = "pyyaml", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, { name = "safetensors", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, { name = "torch", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, @@ -4212,8 +4193,7 @@ name = "tokenizers" version = "0.22.2" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "huggingface-hub", version = "0.36.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "huggingface-hub", version = "1.11.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "huggingface-hub", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/73/6f/f80cfef4a312e1fb34baf7d85c72d4411afde10978d4657f8cdd811d3ccc/tokenizers-0.22.2.tar.gz", hash = "sha256:473b83b915e547aa366d1eee11806deaf419e17be16310ac0a14077f1e28f917", size = 372115, upload-time = "2026-01-05T10:45:15.988Z" } wheels = [ @@ -4366,6 +4346,8 @@ dev = [ { name = "pre-commit", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "pytest", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "pytest-forked", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "pytest-github-actions-annotate-failures", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "pytest-rerunfailures", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "pytest-xdist", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "pyyaml", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "ruff", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, @@ -4401,6 +4383,8 @@ test = [ { name = "parameterized", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "pytest", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "pytest-forked", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "pytest-github-actions-annotate-failures", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "pytest-rerunfailures", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "pytest-xdist", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "pyyaml", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "setuptools", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, @@ -4410,7 +4394,7 @@ test-ext = [ { name = "flashinfer-python", version = "0.6.8.post1", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.13' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.13' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, { name = "timm", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, { name = "torchvision", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, - { name = "transformers", version = "5.5.4", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, + { name = "transformers", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, ] [package.metadata] @@ -4447,6 +4431,8 @@ dev = [ { name = "pre-commit", specifier = ">=2.20.0" }, { name = "pytest", specifier = ">=9.0.3" }, { name = "pytest-forked", specifier = ">=1.6.0" }, + { name = "pytest-github-actions-annotate-failures", specifier = ">=0.2.0" }, + { name = "pytest-rerunfailures", specifier = ">=14.0" }, { name = "pytest-xdist", specifier = ">=3.6.1" }, { name = "pyyaml" }, { name = "ruff" }, @@ -4468,7 +4454,7 @@ lint = [ { name = "black", specifier = ">=24.0.0" }, { name = "clang-format", specifier = "==14.0.6" }, ] -quantization = [{ name = "nvidia-modelopt", extras = ["hf"], marker = "python_full_version >= '3.10' and python_full_version < '3.13'", specifier = ">=0.43.0" }] +quantization = [{ name = "nvidia-modelopt", extras = ["hf"], marker = "python_full_version >= '3.10' and python_full_version < '3.13'", specifier = ">=0.44.0" }] test = [ { name = "expecttest", specifier = "==0.1.6" }, { name = "networkx" }, @@ -4476,6 +4462,8 @@ test = [ { name = "parameterized", specifier = ">=0.2.0" }, { name = "pytest", specifier = ">=9.0.3" }, { name = "pytest-forked", specifier = ">=1.6.0" }, + { name = "pytest-github-actions-annotate-failures", specifier = ">=0.2.0" }, + { name = "pytest-rerunfailures", specifier = ">=14.0" }, { name = "pytest-xdist", specifier = ">=3.6.1" }, { name = "pyyaml" }, { name = "setuptools" }, @@ -4484,7 +4472,7 @@ test-ext = [ { name = "flashinfer-python", marker = "python_full_version >= '3.10' and python_full_version < '3.13'" }, { name = "timm", specifier = ">=1.0.3" }, { name = "torchvision", specifier = ">=0.29.0.dev0,<0.30.0", index = "https://download.pytorch.org/whl/nightly/cu130" }, - { name = "transformers", specifier = ">=5.3.0" }, + { name = "transformers" }, ] [[package]] @@ -4590,69 +4578,21 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl", hash = "sha256:b74e89e397b1ed28cc831db7aea759ba6640cb3de13090ca145426688ff1ac4f", size = 85359, upload-time = "2024-04-19T11:11:46.763Z" }, ] -[[package]] -name = "transformers" -version = "4.57.6" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'aarch64' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'x86_64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine == 'aarch64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine == 'x86_64' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine != 'AMD64' and sys_platform == 'win32'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'AMD64' and sys_platform == 'win32'", - "python_full_version < '3.11' and platform_machine != 'AMD64' and sys_platform == 'win32'", - "python_full_version < '3.11' and platform_machine == 'AMD64' and sys_platform == 'win32'", -] -dependencies = [ - { name = "filelock", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "huggingface-hub", version = "0.36.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "numpy", version = "2.2.6", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "numpy", version = "2.4.4", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "packaging", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "pyyaml", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "regex", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "requests", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "safetensors", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "tokenizers", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, - { name = "tqdm", marker = "(python_full_version < '3.14' and sys_platform == 'linux') or (python_full_version < '3.14' and sys_platform == 'win32')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/c4/35/67252acc1b929dc88b6602e8c4a982e64f31e733b804c14bc24b47da35e6/transformers-4.57.6.tar.gz", hash = "sha256:55e44126ece9dc0a291521b7e5492b572e6ef2766338a610b9ab5afbb70689d3", size = 10134912, upload-time = "2026-01-16T10:38:39.284Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/03/b8/e484ef633af3887baeeb4b6ad12743363af7cce68ae51e938e00aaa0529d/transformers-4.57.6-py3-none-any.whl", hash = "sha256:4c9e9de11333ddfe5114bc872c9f370509198acf0b87a832a0ab9458e2bd0550", size = 11993498, upload-time = "2026-01-16T10:38:31.289Z" }, -] - [[package]] name = "transformers" version = "5.5.4" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.14' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'aarch64' and sys_platform == 'linux'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'x86_64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine == 'aarch64' and sys_platform == 'linux'", - "python_full_version < '3.11' and platform_machine == 'x86_64' and sys_platform == 'linux'", - "python_full_version >= '3.14' and sys_platform == 'win32'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine != 'AMD64' and sys_platform == 'win32'", - "python_full_version >= '3.11' and python_full_version < '3.14' and platform_machine == 'AMD64' and sys_platform == 'win32'", - "python_full_version < '3.11' and platform_machine != 'AMD64' and sys_platform == 'win32'", - "python_full_version < '3.11' and platform_machine == 'AMD64' and sys_platform == 'win32'", -] dependencies = [ - { name = "huggingface-hub", version = "1.11.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, - { name = "numpy", version = "2.2.6", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "numpy", version = "2.4.4", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version >= '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "packaging", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, - { name = "pyyaml", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, - { name = "regex", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, - { name = "safetensors", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, - { name = "tokenizers", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, - { name = "tqdm", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, - { name = "typer", marker = "sys_platform == 'linux' or sys_platform == 'win32'" }, + { name = "huggingface-hub", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "numpy", version = "2.2.6", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "numpy", version = "2.4.4", source = { registry = "https://download.pytorch.org/whl/nightly/cu130" }, marker = "(python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.11' and python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.11' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.11' and sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.11' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version >= '3.11' and sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "packaging", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "pyyaml", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "regex", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "safetensors", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "tokenizers", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "tqdm", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "typer", marker = "(python_full_version < '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-test-ext') or (python_full_version < '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization') or (python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/a5/1e/1e244ab2ab50a863e6b52cc55761910567fa532b69a6740f6e99c5fdbd98/transformers-5.5.4.tar.gz", hash = "sha256:2e67cadba81fc7608cc07c4dd54f524820bc3d95b1cabd0ef3db7733c4f8b82e", size = 8227649, upload-time = "2026-04-13T16:55:55.181Z" } wheels = [ @@ -4689,10 +4629,10 @@ name = "typer" version = "0.24.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "annotated-doc", marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "click", marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "rich", marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, - { name = "shellingham", marker = "(python_full_version >= '3.14' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'linux' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'win32' and extra != 'group-14-torch-tensorrt-quantization') or (sys_platform == 'linux' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext') or (sys_platform == 'win32' and extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "annotated-doc", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "click", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "rich", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, + { name = "shellingham", marker = "sys_platform == 'linux' or sys_platform == 'win32' or (extra == 'group-14-torch-tensorrt-quantization' and extra == 'group-14-torch-tensorrt-test-ext')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/f5/24/cb09efec5cc954f7f9b930bf8279447d24618bb6758d4f6adf2574c41780/typer-0.24.1.tar.gz", hash = "sha256:e39b4732d65fbdcde189ae76cf7cd48aeae72919dea1fdfc16593be016256b45", size = 118613, upload-time = "2026-02-21T16:54:40.609Z" } wheels = [ From 199bb1c206bf359917736e4ce3d0e282fdcbf91d Mon Sep 17 00:00:00 2001 From: Evan Li Date: Tue, 7 Jul 2026 16:31:47 -0700 Subject: [PATCH 3/5] upgrade transformers>=5.3.0 to fix vuln --- pyproject.toml | 2 +- uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d42932c6d4..ca765616b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ test = [ test-ext = [ "timm>=1.0.3", - "transformers", + "transformers>=5.3.0", "torchvision>=0.29.0.dev,<0.30.0", "flashinfer-python; python_version >'3.9' and python_version <'3.13'", ] diff --git a/uv.lock b/uv.lock index 0ca3ebbb6e..372dbba2cf 100644 --- a/uv.lock +++ b/uv.lock @@ -4472,7 +4472,7 @@ test-ext = [ { name = "flashinfer-python", marker = "python_full_version >= '3.10' and python_full_version < '3.13'" }, { name = "timm", specifier = ">=1.0.3" }, { name = "torchvision", specifier = ">=0.29.0.dev0,<0.30.0", index = "https://download.pytorch.org/whl/nightly/cu130" }, - { name = "transformers" }, + { name = "transformers", specifier = ">=5.3.0" }, ] [[package]] From 32592aab83782e8f1308dc66ac650623c6fac089 Mon Sep 17 00:00:00 2001 From: Evan Li Date: Tue, 7 Jul 2026 22:24:18 -0700 Subject: [PATCH 4/5] test transformers>=5.4.0 --- docker/ngc_test/requirements.txt | 2 +- examples/dynamo/requirements.txt | 2 +- pyproject.toml | 4 ++-- tests/modules/requirements.txt | 2 +- toolchains/jp_workspaces/test_requirements.txt | 2 +- tools/perf/requirements.txt | 2 +- uv.lock | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/ngc_test/requirements.txt b/docker/ngc_test/requirements.txt index 104a0b40d4..8faf6da40a 100644 --- a/docker/ngc_test/requirements.txt +++ b/docker/ngc_test/requirements.txt @@ -8,6 +8,6 @@ parameterized>=0.2.0 pytest>=9.0.3 pytest-xdist>=3.6.1 pyyaml -transformers>=5.3.0 +transformers>=5.4.0 timm # torchvision nvidia-modelopt should use the one already installed inside the dlfw docker container \ No newline at end of file diff --git a/examples/dynamo/requirements.txt b/examples/dynamo/requirements.txt index e89dc2dc80..09f1438780 100644 --- a/examples/dynamo/requirements.txt +++ b/examples/dynamo/requirements.txt @@ -1,7 +1,7 @@ cupy==13.1.0 triton==2.3.0 diffusers==0.30.3 -transformers>=5.3.0 +transformers>=5.4.0 matplotlib pandas huggingface_hub diff --git a/pyproject.toml b/pyproject.toml index ca765616b3..b1a594ab75 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ test = [ test-ext = [ "timm>=1.0.3", - "transformers>=5.3.0", + "transformers>=5.4.0", "torchvision>=0.29.0.dev,<0.30.0", "flashinfer-python; python_version >'3.9' and python_version <'3.13'", ] @@ -159,7 +159,7 @@ conflicts = [ ], ] constraint-dependencies = [ - "transformers>=5.3.0", + "transformers>=5.4.0", ] [tool.uv.sources] diff --git a/tests/modules/requirements.txt b/tests/modules/requirements.txt index a0ec827ee9..fa5f3ed3e7 100644 --- a/tests/modules/requirements.txt +++ b/tests/modules/requirements.txt @@ -1,2 +1,2 @@ timm==0.9.12 -transformers>=5.3.0 +transformers>=5.4.0 diff --git a/toolchains/jp_workspaces/test_requirements.txt b/toolchains/jp_workspaces/test_requirements.txt index d52deefbbc..c1f077557e 100644 --- a/toolchains/jp_workspaces/test_requirements.txt +++ b/toolchains/jp_workspaces/test_requirements.txt @@ -5,5 +5,5 @@ parameterized>=0.2.0 pytest>=9.0.3 pytest-xdist>=3.6.1 pyyaml -transformers>=5.3.0 +transformers>=5.4.0 # TODO: currently timm torchvision nvidia-modelopt does not have distributions for jetson \ No newline at end of file diff --git a/tools/perf/requirements.txt b/tools/perf/requirements.txt index 893313eecd..9c1bf24b06 100644 --- a/tools/perf/requirements.txt +++ b/tools/perf/requirements.txt @@ -3,7 +3,7 @@ argparse pyyaml onnx pandas -transformers>=5.3.0 +transformers>=5.4.0 diffusers==0.34.0 timm==0.9.8 monai==1.5.2rc1 diff --git a/uv.lock b/uv.lock index 372dbba2cf..4f94aa1c2b 100644 --- a/uv.lock +++ b/uv.lock @@ -30,7 +30,7 @@ conflicts = [[ ]] [manifest] -constraints = [{ name = "transformers", specifier = ">=5.3.0" }] +constraints = [{ name = "transformers", specifier = ">=5.4.0" }] [[package]] name = "accelerate" @@ -4472,7 +4472,7 @@ test-ext = [ { name = "flashinfer-python", marker = "python_full_version >= '3.10' and python_full_version < '3.13'" }, { name = "timm", specifier = ">=1.0.3" }, { name = "torchvision", specifier = ">=0.29.0.dev0,<0.30.0", index = "https://download.pytorch.org/whl/nightly/cu130" }, - { name = "transformers", specifier = ">=5.3.0" }, + { name = "transformers", specifier = ">=5.4.0" }, ] [[package]] From f305082702e4edebd605c142a0195bd7efaf125b Mon Sep 17 00:00:00 2001 From: Naren Dasan <1790613+narendasan@users.noreply.github.com> Date: Wed, 8 Jul 2026 12:52:16 -0600 Subject: [PATCH 5/5] IAttention FP8 (#4209) Co-authored-by: Evan Li --- docsrc/user_guide/shapes_precision/index.rst | 1 + examples/dynamo/quantize_vit_fp8.py | 291 ++++++++++++++++++ .../dynamo/conversion/_ConversionContext.py | 4 + .../dynamo/conversion/_TRTInterpreter.py | 1 + .../dynamo/conversion/impl/attention.py | 73 ++++- .../lowering/passes/_aten_lowering_pass.py | 2 + .../lowering/passes/annotate_fp8_sdpa.py | 76 +++++ tests/py/dynamo/models/test_models_export.py | 200 ++++++++++++ 8 files changed, 645 insertions(+), 3 deletions(-) create mode 100644 examples/dynamo/quantize_vit_fp8.py create mode 100644 py/torch_tensorrt/dynamo/lowering/passes/annotate_fp8_sdpa.py diff --git a/docsrc/user_guide/shapes_precision/index.rst b/docsrc/user_guide/shapes_precision/index.rst index 22e46c100c..de0883e6e8 100644 --- a/docsrc/user_guide/shapes_precision/index.rst +++ b/docsrc/user_guide/shapes_precision/index.rst @@ -11,3 +11,4 @@ and reduce model size with INT8/FP8/FP4 quantization via ModelOpt. ../../tutorials/_rendered_examples/dynamo/autocast_example quantization ../../tutorials/_rendered_examples/dynamo/vgg16_ptq + Example: ViT FP8 Quantization <../../tutorials/_rendered_examples/dynamo/quantize_vit_fp8> diff --git a/examples/dynamo/quantize_vit_fp8.py b/examples/dynamo/quantize_vit_fp8.py new file mode 100644 index 0000000000..a633889c18 --- /dev/null +++ b/examples/dynamo/quantize_vit_fp8.py @@ -0,0 +1,291 @@ +""" +.. _quantize_vit_fp8: + +Quantize and Compile ViT with FP8 +================================== + +This example demonstrates post-training FP8 quantization of a Hugging Face ViT +model with NVIDIA ModelOpt, then compilation with the Torch-TensorRT Dynamo +backend. There are two methods to compile the model with Torch-TensorRT: +1. IAttention path: converts attention to TRT IAttention Layer +2. Decomposed path: uses original attention implementation, which decomposes attention into multiple layers. + +Requirements: + +* NVIDIA GPU with FP8 support (Hopper or newer) +* ``nvidia-modelopt>=0.45.0`` that supports the Hugging Face quantization recipes +* ``transformers`` to load the ViT model +* ``torch-tensorrt>=2.13.0`` which converts attention to TRT IAttention Layer + +""" + +# %% +# Imports +# ^^^^^^^ + +import tempfile +from collections import OrderedDict + +import modelopt.torch.quantization as mtq +import numpy as np +import tensorrt as trt +import torch +import torch_tensorrt +from modelopt.recipe import load_recipe +from modelopt.torch.quantization.utils import export_torch_mode +from transformers import ViTForImageClassification + +# %% +# Optional layer profiler and benchmark function (Python TensorRT runtime) +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +def _format_report(timings: OrderedDict[str, list[float]], n_iters: int) -> str: + """Format layer timings into a trtexec-style profiling summary.""" + if not timings: + return "(no profiling data collected)" + + total_time = sum(sum(ts) for ts in timings.values()) + + lines: list[str] = [] + lines.append(f"=== Profile ({n_iters} iterations) ===") + lines.append( + f"{'Time(ms)':>12s} {'Avg.(ms)':>12s} {'Median(ms)':>12s} {'Time(%)':>9s} Layer" + ) + + for layer_name, ts in timings.items(): + arr = np.array(ts) + t_sum = arr.sum() + t_avg = arr.mean() + t_med = float(np.median(arr)) + t_pct = 100.0 * t_sum / total_time if total_time > 0 else 0.0 + lines.append( + f"{t_sum:12.2f} {t_avg:12.4f} {t_med:12.4f} {t_pct:8.1f} {layer_name}" + ) + + return "\n".join(lines) + + +class TorchTRTLayerProfiler(trt.IProfiler): + """Collect per-layer timings across many runs via ``trt.IProfiler``.""" + + def __init__(self): + super().__init__() + self._timings: OrderedDict[str, list[float]] = OrderedDict() + self._iterations: int = 0 + self._last_layer: str | None = None + + def report_layer_time(self, layer_name: str, ms: float) -> None: + if layer_name not in self._timings: + self._timings[layer_name] = [] + self._timings[layer_name].append(ms) + + if self._last_layer is None or layer_name == next(iter(self._timings)): + if self._last_layer is not None: + self._iterations += 1 + self._last_layer = layer_name + + def reset(self) -> None: + self._timings.clear() + self._iterations = 0 + self._last_layer = None + + def report(self) -> str: + n_iters = self._iterations + first_layer_count = len(next(iter(self._timings.values()), [])) + if first_layer_count > n_iters: + n_iters = first_layer_count + text = _format_report(self._timings, n_iters) + print(text) + return text + + +def benchmark_tensorrt( + trt_compiled, + input_tensor: torch.Tensor, + *, + enable_profiling: bool = False, + num_warmup: int = 10, + num_runs: int = 50, +): + with torch.no_grad(): + for _ in range(num_warmup): + trt_compiled(input_tensor) + torch.cuda.synchronize() + + with torch_tensorrt.runtime.enable_cudagraphs(trt_compiled) as cg_model: + start_events = [ + torch.cuda.Event(enable_timing=True) for _ in range(num_runs) + ] + end_events = [torch.cuda.Event(enable_timing=True) for _ in range(num_runs)] + results = [] + for i in range(num_runs): + start_events[i].record() + result = cg_model(input_tensor) + results.append(result.logits.sum().item()) + end_events[i].record() + torch.cuda.synchronize() + latencies = [s.elapsed_time(e) for s, e in zip(start_events, end_events)] + + latencies = np.array(latencies) + print(f"\nLatency over {num_runs} runs (ms):") + print(f" Mean: {np.mean(latencies):.2f}") + print(f" Median: {np.median(latencies):.2f}") + print(f" Min: {np.min(latencies):.2f}") + print(f" Max: {np.max(latencies):.2f}") + print(f" P90: {np.percentile(latencies, 90):.2f}") + print(f" P95: {np.percentile(latencies, 95):.2f}") + print(f" P99: {np.percentile(latencies, 99):.2f}") + print(f" Avg logits sum: {np.mean(results):.2f}") + + if enable_profiling and hasattr(trt_compiled, "engine"): + profiler = TorchTRTLayerProfiler() + trt_compiled.engine.context.profiler = profiler + torch_results = [] + for _ in range(num_runs): + result = trt_compiled(input_tensor) + torch_results.append(result.logits.sum().item()) + torch.cuda.synchronize() + print(f" Avg logits sum (no cudagraphs): {np.mean(torch_results):.2f}") + profiler.report() + + +# %% +# Configuration and calibration data +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +BATCH_SIZE = 128 +input_tensor = torch.rand((BATCH_SIZE, 3, 224, 224), dtype=torch.float16).cuda() + +calibration_dataloader = [ + torch.rand((BATCH_SIZE, 3, 224, 224), dtype=torch.float16) for _ in range(2) +] + +# %% +# Define function to quantize ViT to FP8 using ModelOpt +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +def quantize_model(model: torch.nn.Module) -> torch.nn.Module: + # ModelOpt's HF plugin expects attention modules to expose ``config``. + for mod in model.modules(): + if mod.__class__.__name__ == "ViTAttention": + mod.config = model.config + + def calibration_loop(model): + for batch in calibration_dataloader: + model(batch.cuda()) + + recipe = load_recipe("huggingface/vit/ptq/fp8") + quant_cfg = recipe.quantize.model_dump() + # You can also define your own quant_cfg to specify which layers to quantize, like this: + # quant_cfg = { + # "quant_cfg": { + # "*": {"enable": False}, + # "*weight_quantizer": {"num_bits": (4, 3), "axis": None}, + # "*input_quantizer": {"num_bits": (4, 3), "axis": None}, + # "*output_quantizer": {"enable": False}, + # "*[qkv]_bmm_quantizer": {"num_bits": (4, 3), "axis": None}, + # "*softmax_quantizer": {"num_bits": (4, 3), "axis": None}, + # "*bmm2_output_quantizer": {"num_bits": (4, 3), "axis": None}, + # }, + # "algorithm": "max", + # } + + mtq.quantize(model, quant_cfg, forward_loop=calibration_loop) + return model + + +# %% +# Define function to compile with Torch-TensorRT +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +def compile_tensorrt( + model: torch.nn.Module, dynamic: bool = False, decompose_attention: bool = False +): + if dynamic: + inputs = [ + torch_tensorrt.Input( + min_shape=(1, 3, 224, 224), + opt_shape=(BATCH_SIZE, 3, 224, 224), + max_shape=(1024, 3, 224, 224), + dtype=torch.float16, + ) + ] + else: + inputs = [torch.rand((BATCH_SIZE, 3, 224, 224), dtype=torch.float16).cuda()] + + with tempfile.TemporaryDirectory() as debug_dir: + with export_torch_mode(), torch_tensorrt.dynamo.Debugger( + log_level="info", + save_layer_info=True, + logging_dir=debug_dir, + ): + trt_compiled = torch_tensorrt.compile( + model, + ir="dynamo", + inputs=inputs, + use_explicit_typing=True, + truncate_double=True, + use_python_runtime=True, + decompose_attention=decompose_attention, + ) + + return trt_compiled + + +# %% +# Instantiate ViT model and quantize it +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# Both "eager" and "sdpa" attn_implementation work for IAttention path, but only "eager" works for decomposed path. +# For demonstration purposes, we use "eager" attn_implementation here so that both paths can share the same model. + + +model = ( + ViTForImageClassification.from_pretrained( + "google/vit-large-patch16-224", + hidden_act="gelu_fast", + attn_implementation="eager", + ) + .eval() + .half() + .cuda() +) + +quantized_model = quantize_model(model) + + +# %% +# Compile quantized model with Torch-TensorRT: IAttention path +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +trt_compiled_iattention = compile_tensorrt( + quantized_model, + decompose_attention=False, # False for IAttention path +) + +# %% +# IAttention path benchmark inference +benchmark_tensorrt( + trt_compiled_iattention, + input_tensor, +) + + +# %% +# Compile quantized model with Torch-TensorRT: Decomposed path +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +trt_compiled_decomposed = compile_tensorrt( + quantized_model, + decompose_attention=True, # True for decomposed path +) + +# %% +# Decomposed path benchmark inference +benchmark_tensorrt( + trt_compiled_decomposed, + input_tensor, +) diff --git a/py/torch_tensorrt/dynamo/conversion/_ConversionContext.py b/py/torch_tensorrt/dynamo/conversion/_ConversionContext.py index f5ffdafda2..e22b8798eb 100644 --- a/py/torch_tensorrt/dynamo/conversion/_ConversionContext.py +++ b/py/torch_tensorrt/dynamo/conversion/_ConversionContext.py @@ -1,6 +1,8 @@ from dataclasses import dataclass, field +from typing import Optional import torch +import torch.fx from torch_tensorrt.dynamo._settings import CompilationSettings from torch_tensorrt.dynamo.types import TRTNetwork @@ -15,6 +17,7 @@ class ConversionContext: requires_output_allocator: Boolean flag indicating if the converter creates operators which require an Output Allocator to run (e.g. data dependent operators) weight_refit_map: Dictionary mapping weight names to their corresponding np.array cpu_weights_reference_holder: Dictionary mapping weight names to their corresponding torch.Tensor + current_node: The FX node currently being converted, used by converters that need access to graph-level metadata (e.g. annotations set by lowering passes) """ net: TRTNetwork @@ -25,6 +28,7 @@ class ConversionContext: requires_native_multidevice: bool = False weight_refit_map: dict[str, torch.Tensor] = field(default_factory=dict) cpu_weights_reference_holder: list[torch.Tensor] = field(default_factory=list) + current_node: Optional[torch.fx.Node] = field(default=None) def record_weight(self, name: str, weight: torch.Tensor) -> None: """ diff --git a/py/torch_tensorrt/dynamo/conversion/_TRTInterpreter.py b/py/torch_tensorrt/dynamo/conversion/_TRTInterpreter.py index db14041756..c785935aa1 100644 --- a/py/torch_tensorrt/dynamo/conversion/_TRTInterpreter.py +++ b/py/torch_tensorrt/dynamo/conversion/_TRTInterpreter.py @@ -803,6 +803,7 @@ def call_function(self, target: str, args: Any, kwargs: Any) -> Any: self.ctx.requires_native_multidevice = True _LOGGER.debug(f"{target} requires native multi-device support") + self.ctx.current_node = self._cur_node if calling_convention is CallingConvention.LEGACY: return converter(self.ctx.net, target, args, kwargs, self._cur_node_name) else: diff --git a/py/torch_tensorrt/dynamo/conversion/impl/attention.py b/py/torch_tensorrt/dynamo/conversion/impl/attention.py index af9c2c7519..40ef5ff4db 100644 --- a/py/torch_tensorrt/dynamo/conversion/impl/attention.py +++ b/py/torch_tensorrt/dynamo/conversion/impl/attention.py @@ -1,10 +1,13 @@ import logging +import math from typing import Optional, Tuple, Union import tensorrt as trt from tensorrt import ITensor as TRTTensor +import torch from torch.fx.node import Target from torch_tensorrt._utils import is_tensorrt_version_supported +from torch_tensorrt import _enums from torch_tensorrt.dynamo._SourceIR import SourceIR from torch_tensorrt.dynamo.conversion import impl from torch_tensorrt.dynamo.conversion._ConversionContext import ConversionContext @@ -16,6 +19,41 @@ _LOGGER: logging.Logger = logging.getLogger(__name__) +# FP8 E4M3 max representable magnitude. Softmax output is bounded to [0, 1], +# so 1/448 saturates exactly at 1.0 and is data-independent (no calibration needed). +_FP8_E4M3_MAX = 448.0 + + +def _maybe_set_fp8_softmax( + ctx: ConversionContext, + name: str, + attention_layer: trt.IAttention, +) -> bool: + """Set FP8 softmax normalization quantization on the IAttention layer if the current + node was annotated with a softmax FP8 scale by the fp8_attention_softmax lowering pass. + + Returns True if FP8 normalization was configured (caller must set decomposable=False). + """ + if ctx.current_node is None: + return False + scale_val = ctx.current_node.meta.get("_fp8_softmax_scale") + if scale_val is None: + return False + # Scale dtype must match the IAttention output (= pre-quant Q/K/V) dtype; + # using float32 unconditionally fails TRT compilation on some platforms. + output_dtype = _enums.dtype._from(attention_layer.get_output(0).dtype).to( + torch.dtype + ) + scale_tensor = get_trt_tensor( + ctx, + torch.tensor(scale_val, dtype=output_dtype), + name + "_softmax_fp8_scale", + dtype=output_dtype, + ) + attention_layer.normalization_quantize_to_type = trt.DataType.FP8 + attention_layer.normalization_quantize_scale = scale_tensor + return True + def _normalize_attention_mask_rank( ctx: ConversionContext, @@ -178,6 +216,18 @@ def scaled_dot_product_attention( Returns: TRTTensor: Attention output tensor with shape [batch, heads, seq_len, head_dim] """ + # When FP8 softmax normalization is active (modelopt FP8 MHA pattern) TRT's + # FP8 MHA fusion requires the Q/DQ output to feed IAttention via a single + # same-dtype Mul; any HALF<->FLOAT cast inserted by the default dynamic + # 1/sqrt(D) computation breaks the fusion. Use a static same-dtype scalar + # scale computed from the concrete head_dim. + fp8_norm_active = ( + ctx.current_node is not None + and ctx.current_node.meta.get("_fp8_softmax_scale") is not None + ) + if fp8_norm_active and scale is None and isinstance(query.shape[-1], int): + scale = 1.0 / math.sqrt(query.shape[-1]) + if scale is None: # 1 / math.sqrt(query.size(-1)) q_dim = impl.shape.shape(ctx, target, source_ir, f"{name}_shape_q", query, -1) @@ -291,7 +341,8 @@ def scaled_dot_product_attention( if mask_tensor is not None: attention_layer.mask = mask_tensor - attention_layer.decomposable = True + fp8_norm = _maybe_set_fp8_softmax(ctx, name, attention_layer) + attention_layer.decomposable = not fp8_norm attention_output = attention_layer.get_output(0) return attention_output @@ -319,6 +370,13 @@ def scaled_dot_product_flash_attention( Optional[TRTTensor], Optional[TRTTensor], ]: + fp8_norm_active = ( + ctx.current_node is not None + and ctx.current_node.meta.get("_fp8_softmax_scale") is not None + ) + if fp8_norm_active and scale is None and isinstance(query.shape[-1], int): + scale = 1.0 / math.sqrt(query.shape[-1]) + if scale is None: # 1 / math.sqrt(query.size(-1)) q_dim = impl.shape.shape(ctx, target, source_ir, f"{name}_shape_q", query, -1) @@ -367,7 +425,8 @@ def scaled_dot_product_flash_attention( ) assert attention_layer is not None, "attention layer is None" - attention_layer.decomposable = True + fp8_norm = _maybe_set_fp8_softmax(ctx, name, attention_layer) + attention_layer.decomposable = not fp8_norm attention_output = attention_layer.get_output(0) return attention_output, None, None, None, 0.0, 0.0, None, None, None @@ -387,6 +446,13 @@ def scaled_dot_product_efficient_attention( is_causal: bool = False, scale: Optional[float] = None, ) -> Tuple[TRTTensor, Optional[TRTTensor], Optional[TRTTensor], Optional[TRTTensor]]: + fp8_norm_active = ( + ctx.current_node is not None + and ctx.current_node.meta.get("_fp8_softmax_scale") is not None + ) + if fp8_norm_active and scale is None and isinstance(query.shape[-1], int): + scale = 1.0 / math.sqrt(query.shape[-1]) + if scale is None: # 1 / math.sqrt(query.size(-1)) q_dim = impl.shape.shape(ctx, target, source_ir, f"{name}_shape_q", query, -1) @@ -523,7 +589,8 @@ def scaled_dot_product_efficient_attention( if mask_tensor is not None: attention_layer.mask = mask_tensor - attention_layer.decomposable = True + fp8_norm = _maybe_set_fp8_softmax(ctx, name, attention_layer) + attention_layer.decomposable = not fp8_norm attention_output = attention_layer.get_output(0) return attention_output, None, None, None diff --git a/py/torch_tensorrt/dynamo/lowering/passes/_aten_lowering_pass.py b/py/torch_tensorrt/dynamo/lowering/passes/_aten_lowering_pass.py index 7b770ab68b..271f7c98b7 100644 --- a/py/torch_tensorrt/dynamo/lowering/passes/_aten_lowering_pass.py +++ b/py/torch_tensorrt/dynamo/lowering/passes/_aten_lowering_pass.py @@ -10,6 +10,7 @@ trace_intermediate_node_outputs, ) +from .annotate_fp8_sdpa import annotate_fp8_sdpa from .complex_graph_rewrite import complex_graph_detection from .constant_folding import constant_fold from .force_causal_efficient_attention import force_causal_efficient_attention @@ -41,6 +42,7 @@ remove_num_users_is_0_nodes, complex_graph_detection, force_causal_efficient_attention, + annotate_fp8_sdpa, ] if not is_tegra_platform(): diff --git a/py/torch_tensorrt/dynamo/lowering/passes/annotate_fp8_sdpa.py b/py/torch_tensorrt/dynamo/lowering/passes/annotate_fp8_sdpa.py new file mode 100644 index 0000000000..257c47974c --- /dev/null +++ b/py/torch_tensorrt/dynamo/lowering/passes/annotate_fp8_sdpa.py @@ -0,0 +1,76 @@ +import logging + +import torch +from torch_tensorrt.dynamo._settings import CompilationSettings + +logger = logging.getLogger(__name__) + +# FP8 E4M3 max. Softmax output is bounded to [0, 1], so 1/448 saturates at 1.0 exactly +# and is data-independent (no calibration required for the softmax output scale). +_FP8_E4M3_SOFTMAX_SCALE = 1.0 / 448.0 + +_SDPA_TARGETS = { + torch.ops.aten.scaled_dot_product_attention.default, + torch.ops.aten._scaled_dot_product_flash_attention.default, + torch.ops.aten._scaled_dot_product_efficient_attention.default, + torch.ops.aten._scaled_dot_product_cudnn_attention.default, +} + + +def _is_fp8_quantize_op(node: torch.fx.Node) -> bool: + """Return True when node is a tensorrt.quantize_op with FP8 dtype (exponent_bits=4).""" + if node.op != "call_function": + return False + try: + if node.target != torch.ops.tensorrt.quantize_op.default: + return False + except AttributeError: + return False + # args: (input, amax, num_bits, exponent_bits, ...) + args = node.args + return len(args) >= 4 and args[2] == 8 and args[3] == 4 + + +def annotate_fp8_sdpa( + gm: torch.fx.GraphModule, settings: CompilationSettings +) -> torch.fx.GraphModule: + """Annotate SDPA nodes whose Q, K, V inputs are all FP8-quantized. + + Detects the pattern emitted by modelopt when an attention module is + registered via ``register_attention_for_kv_quant``, which wraps the + Q, K, V arguments to ``F.scaled_dot_product_attention`` with + ``q_bmm_quantizer``, ``k_bmm_quantizer``, ``v_bmm_quantizer``: + + q_fp8 = quantize_op(q, amax_q, num_bits=8, exponent_bits=4, ...) + k_fp8 = quantize_op(k, amax_k, num_bits=8, exponent_bits=4, ...) + v_fp8 = quantize_op(v, amax_v, num_bits=8, exponent_bits=4, ...) + out = scaled_dot_product_attention(q_fp8, k_fp8, v_fp8, ...) + + When all three inputs match this pattern the pass sets + ``node.meta["_fp8_softmax_scale"] = 1/448`` on the SDPA node so the + attention converter can set ``IAttention.normalization_quantize_to_type + = FP8`` and ``IAttention.normalization_quantize_scale``, which TRT + requires to fuse into the ``_gemm_mha_v2`` FP8 MHA kernel. + """ + changed = False + for node in gm.graph.nodes: + if node.op != "call_function" or node.target not in _SDPA_TARGETS: + continue + if len(node.args) < 3: + continue + q_node, k_node, v_node = node.args[0], node.args[1], node.args[2] + if not all( + isinstance(n, torch.fx.Node) and _is_fp8_quantize_op(n) + for n in (q_node, k_node, v_node) + ): + continue + node.meta["_fp8_softmax_scale"] = _FP8_E4M3_SOFTMAX_SCALE + changed = True + logger.debug( + f"Annotated SDPA node {node.name} with FP8 softmax scale " + f"{_FP8_E4M3_SOFTMAX_SCALE} (Q/K/V inputs are FP8-quantized)" + ) + + if changed: + logger.debug("FP8 SDPA softmax annotation complete") + return gm diff --git a/tests/py/dynamo/models/test_models_export.py b/tests/py/dynamo/models/test_models_export.py index ec625a59f2..e86b707141 100644 --- a/tests/py/dynamo/models/test_models_export.py +++ b/tests/py/dynamo/models/test_models_export.py @@ -636,3 +636,203 @@ def calibrate_loop(model): ) outputs_trt = trt_model(input_tensor) assert torch.allclose(output_pyt, outputs_trt, rtol=5e-2, atol=5e-2) + + +@unittest.skipIf( + not importlib.util.find_spec("modelopt"), + "ModelOpt is required to run this test", +) +@pytest.mark.unit +def test_fp8_mha_softmax_quantizer_annotation(ir): + """Regression test for #4200: annotate_fp8_sdpa must tag an SDPA node whose + Q, K, V inputs are all FP8-quantized via ``tensorrt.quantize_op``. + + This matches the FX pattern emitted by modelopt's + ``register_attention_for_kv_quant`` when ``NVFP4_FP8_MHA_CONFIG`` is applied: + the attention module's ``F.scaled_dot_product_attention`` call has its Q, + K, V arguments wrapped by ``q_bmm_quantizer``, ``k_bmm_quantizer``, + ``v_bmm_quantizer`` (all FP8). + + The annotated ``_fp8_softmax_scale = 1/448`` on the SDPA node lets the + attention converter set ``IAttention.normalization_quantize_to_type = FP8`` + and ``IAttention.normalization_quantize_scale`` so TRT can fuse the full + ``_gemm_mha_v2`` FP8 MHA kernel. + + Also verifies that INT8 Q/K/V (exponent_bits=0) or a partially-FP8 input + (one of Q/K/V not quantized) do NOT trigger the annotation. + """ + import torch.fx as fx + from torch_tensorrt.dynamo._settings import CompilationSettings + from torch_tensorrt.dynamo.lowering.passes.annotate_fp8_sdpa import ( + _SDPA_TARGETS, + annotate_fp8_sdpa, + ) + + def _build_sdpa_input_quant_graph( + exponent_bits: int, quantize_v: bool = True + ) -> fx.GraphModule: + """Build FX graph where Q, K, V flow into SDPA through quantize_op nodes.""" + graph = fx.Graph() + q = graph.placeholder("q") + k = graph.placeholder("k") + v = graph.placeholder("v") + amax = graph.placeholder("amax") + q_q = graph.call_function( + torch.ops.tensorrt.quantize_op.default, + args=(q, amax, 8, exponent_bits, False, False), + ) + k_q = graph.call_function( + torch.ops.tensorrt.quantize_op.default, + args=(k, amax, 8, exponent_bits, False, False), + ) + v_q = ( + graph.call_function( + torch.ops.tensorrt.quantize_op.default, + args=(v, amax, 8, exponent_bits, False, False), + ) + if quantize_v + else v + ) + out = graph.call_function( + torch.ops.aten.scaled_dot_product_attention.default, args=(q_q, k_q, v_q) + ) + graph.output(out) + return fx.GraphModule({}, graph) + + settings = CompilationSettings() + + # FP8 Q/K/V inputs (exponent_bits=4): SDPA node must be annotated with 1/448. + gm_fp8 = _build_sdpa_input_quant_graph(exponent_bits=4) + annotate_fp8_sdpa(gm_fp8, settings) + sdpa_nodes = [n for n in gm_fp8.graph.nodes if n.target in _SDPA_TARGETS] + assert sdpa_nodes, "No SDPA node found in graph" + assert all( + "_fp8_softmax_scale" in n.meta for n in sdpa_nodes + ), "annotate_fp8_sdpa did not annotate SDPA when Q/K/V inputs are FP8" + expected_scale = 1.0 / 448.0 + for n in sdpa_nodes: + assert ( + abs(n.meta["_fp8_softmax_scale"] - expected_scale) < 1e-12 + ), f"Wrong softmax scale: {n.meta['_fp8_softmax_scale']}" + + # INT8 Q/K/V inputs (exponent_bits=0): SDPA node must NOT be annotated. + gm_int8 = _build_sdpa_input_quant_graph(exponent_bits=0) + annotate_fp8_sdpa(gm_int8, settings) + sdpa_int8 = [n for n in gm_int8.graph.nodes if n.target in _SDPA_TARGETS] + assert all( + "_fp8_softmax_scale" not in n.meta for n in sdpa_int8 + ), "annotate_fp8_sdpa incorrectly annotated SDPA when Q/K/V are INT8" + + # Only Q and K are FP8-quantized, V is raw: SDPA must NOT be annotated. + gm_partial = _build_sdpa_input_quant_graph(exponent_bits=4, quantize_v=False) + annotate_fp8_sdpa(gm_partial, settings) + sdpa_partial = [n for n in gm_partial.graph.nodes if n.target in _SDPA_TARGETS] + assert all( + "_fp8_softmax_scale" not in n.meta for n in sdpa_partial + ), "annotate_fp8_sdpa incorrectly annotated SDPA when V input is not FP8" + + +@unittest.skipIf( + torch.cuda.get_device_capability() < (8, 9), + "FP8 quantization requires compute capability 8.9 or later", +) +@pytest.mark.unit +def test_fp8_mha_fused_kernel(ir): + """Regression test for #4200: FP8 MHA with FP8 Q/K/V inputs must produce a + fused ``_gemm_mha_v2`` MHA kernel with normalization_quantize_to_type set. + + Hand-constructs the FX pattern that a future modelopt PyTorch-backend + version will emit for FP8 MHA (mirrors PR NVIDIA/Model-Optimizer#1289): + + quantize_op(Q) ─┐ + quantize_op(K) ─┤─ scaled_dot_product_attention + quantize_op(V) ─┘ + + Built directly via ``torch.ops.tensorrt.quantize_op`` so we do not depend + on modelopt actually supporting this pattern in its PyTorch backend today — + if/when it does, torch-tensorrt will compile that graph to the fused kernel. + + Verifies: + 1. Engine inspector shows a layer name containing ``mha`` (i.e. + ``_gemm_mha_v2``), confirming the FP8 MHA fusion triggered. + 2. Numerics match PyTorch reference SDPA within FP8 tolerance + (cosine_similarity > 0.99). + + D=64 meets TRT's head_dim >= 32 requirement for the + normalization_quantize FP8 kernel. + """ + import json + + import tensorrt as trt + import torch_tensorrt + + B, H, S, D = 1, 2, 32, 64 + torch.manual_seed(0) + + class FP8MHAModel(torch.nn.Module): + """Mirror of what a modelopt FP8 MHA PyTorch export will look like: + tensorrt.quantize_op on Q, K, V feeding F.scaled_dot_product_attention.""" + + def __init__(self, amax_val: float = 6.0): + super().__init__() + self.register_buffer("amax_q", torch.tensor(amax_val, dtype=torch.float32)) + self.register_buffer("amax_k", torch.tensor(amax_val, dtype=torch.float32)) + self.register_buffer("amax_v", torch.tensor(amax_val, dtype=torch.float32)) + + def forward(self, q, k, v): + q_fp8 = torch.ops.tensorrt.quantize_op(q, self.amax_q, 8, 4, False, False) + k_fp8 = torch.ops.tensorrt.quantize_op(k, self.amax_k, 8, 4, False, False) + v_fp8 = torch.ops.tensorrt.quantize_op(v, self.amax_v, 8, 4, False, False) + return torch.nn.functional.scaled_dot_product_attention(q_fp8, k_fp8, v_fp8) + + q = torch.randn(B, H, S, D, dtype=torch.float16).cuda() + k = torch.randn(B, H, S, D, dtype=torch.float16).cuda() + v = torch.randn(B, H, S, D, dtype=torch.float16).cuda() + + model = FP8MHAModel().eval().cuda() + ref_out = torch.nn.functional.scaled_dot_product_attention(q, k, v) + + exp_program = torch.export.export(model, (q, k, v), strict=False) + serialized_engine = ( + torch_tensorrt.dynamo.convert_exported_program_to_serialized_trt_engine( + exp_program, + inputs=[q, k, v], + use_explicit_typing=True, + min_block_size=1, + ) + ) + + runtime = trt.Runtime(trt.Logger(trt.Logger.WARNING)) + engine = runtime.deserialize_cuda_engine(serialized_engine) + inspector = engine.create_engine_inspector() + engine_json = json.loads( + inspector.get_engine_information(trt.LayerInformationFormat.JSON) + ) + layers = engine_json.get("Layers", []) + layer_names = [ + layer if isinstance(layer, str) else layer.get("Name", "") for layer in layers + ] + assert any("mha" in name.lower() for name in layer_names), ( + f"No fused MHA kernel found in compiled engine. Expected a layer " + f"containing 'mha' (e.g. _gemm_mha_v2) — TRT fuses FP8 Q/K/V + " + f"normalization_quantize_to_type into a single MHA kernel. " + f"Layer names present: {layer_names}" + ) + + # Numerical sanity: FP8-quantized MHA should agree with PyTorch SDPA. + compiled = torch_tensorrt.compile( + model, + ir="dynamo", + inputs=[q, k, v], + use_explicit_typing=True, + min_block_size=1, + ) + with torch.no_grad(): + trt_out = compiled(q, k, v) + cos = torch.nn.functional.cosine_similarity( + ref_out.flatten().float().unsqueeze(0), + trt_out.flatten().float().unsqueeze(0), + ).item() + assert ( + cos > 0.99 + ), f"FP8 MHA output deviates from PyTorch reference: cosine_similarity={cos}"