From 03312a17b722bd1458021d3132cca763660e76aa Mon Sep 17 00:00:00 2001 From: chaofengw-nv Date: Sat, 29 Aug 2026 13:55:07 +0000 Subject: [PATCH 1/3] fix(profiles): complete existing dependency closures Pin the transitive packages imported by existing build and reference profiles, and verify their versions beside each owning family. Keep the redesigned inference-only ELF reference and on-demand PersonaPlex evaluator contracts unchanged. Signed-off-by: chaofengw-nv --- .../python_profile_requirements/chronos.lock.txt | 5 +++++ .../families/chronos_bolt/python_profile_verify.py | 10 ++++++++++ .../python_profile_requirements/elf_flow.lock.txt | 13 +++++++++++++ .../families/elf_flow/python_profile_verify.py | 4 ++++ .../python_profile_requirements/internlm.lock.txt | 1 + .../families/internlm/python_profile_verify.py | 5 +++++ .../phi4_multimodal.lock.txt | 1 + .../phi4_multimodal/python_profile_verify.py | 11 ++++++++++- .../families/sana_wm/MODEL.toml | 1 + .../sana_wm/python_profile_reference_verify.py | 6 ++++++ .../sana_wm_reference.lock.txt | 4 ++++ .../reference_common.lock.txt | 10 ++++++++++ python/tensorrt_model_connect/python_profiles.toml | 13 +++++++++++++ 13 files changed, 83 insertions(+), 1 deletion(-) diff --git a/python/tensorrt_model_connect/families/chronos_bolt/python_profile_requirements/chronos.lock.txt b/python/tensorrt_model_connect/families/chronos_bolt/python_profile_requirements/chronos.lock.txt index f9d381268d..4ed7eb4dda 100644 --- a/python/tensorrt_model_connect/families/chronos_bolt/python_profile_requirements/chronos.lock.txt +++ b/python/tensorrt_model_connect/families/chronos_bolt/python_profile_requirements/chronos.lock.txt @@ -4,3 +4,8 @@ tokenizers==0.22.2 huggingface_hub==0.36.2 accelerate==1.13.0 einops==0.8.1 +numpy==1.26.4 +scipy==1.15.3 +scikit-learn==1.7.2 +joblib==1.5.3 +threadpoolctl==3.6.0 diff --git a/python/tensorrt_model_connect/families/chronos_bolt/python_profile_verify.py b/python/tensorrt_model_connect/families/chronos_bolt/python_profile_verify.py index 07c540c8c6..b954d2627a 100644 --- a/python/tensorrt_model_connect/families/chronos_bolt/python_profile_verify.py +++ b/python/tensorrt_model_connect/families/chronos_bolt/python_profile_verify.py @@ -1,7 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +from importlib.metadata import version + import chronos +import sklearn import transformers config = transformers.T5Config( @@ -25,8 +28,15 @@ "use_reg_token": True, } chronos.chronos_bolt.ChronosBoltModelForForecasting(config).eval() +assert version("numpy") == "1.26.4" +assert version("scipy") == "1.15.3" +assert version("scikit-learn") == "1.7.2" +assert version("joblib") == "1.5.3" +assert version("threadpoolctl") == "3.6.0" +assert sklearn.__version__ == "1.7.2" print( f"chronos={chronos.__version__} " f"transformers={transformers.__version__} " + f"scikit-learn={sklearn.__version__} " "chronos_bolt_ctor=ok" ) diff --git a/python/tensorrt_model_connect/families/elf_flow/python_profile_requirements/elf_flow.lock.txt b/python/tensorrt_model_connect/families/elf_flow/python_profile_requirements/elf_flow.lock.txt index ef575e28ab..52ce3566bb 100644 --- a/python/tensorrt_model_connect/families/elf_flow/python_profile_requirements/elf_flow.lock.txt +++ b/python/tensorrt_model_connect/families/elf_flow/python_profile_requirements/elf_flow.lock.txt @@ -1,14 +1,27 @@ jax==0.4.38 jaxlib==0.4.38 ml_dtypes==0.5.1 +scipy==1.17.1 +absl-py==2.5.0 flax==0.10.2 +msgpack==1.2.1 orbax-checkpoint==0.5.23 +protobuf==7.35.1 opt_einsum==3.4.0 nest_asyncio==1.6.0 etils==1.13.0 +fsspec==2026.7.0 importlib_resources==6.5.2 +zipp==4.1.0 tensorstore==0.1.73 PyYAML==6.0.2 chex==0.1.90 +setuptools==83.0.0 +toolz==1.1.0 numpy==1.26.4 optax==0.2.5 +rich==15.0.0 +markdown-it-py==4.2.0 +mdurl==0.1.2 +pygments==2.20.0 +typing-extensions==4.16.0 diff --git a/python/tensorrt_model_connect/families/elf_flow/python_profile_verify.py b/python/tensorrt_model_connect/families/elf_flow/python_profile_verify.py index c83b8474cd..ed33095f6d 100644 --- a/python/tensorrt_model_connect/families/elf_flow/python_profile_verify.py +++ b/python/tensorrt_model_connect/families/elf_flow/python_profile_verify.py @@ -3,6 +3,8 @@ """Verify the family-owned ELF checkpoint-loading profile.""" +from importlib.metadata import version + import flax import jax import numpy @@ -13,6 +15,8 @@ assert flax.__version__ == "0.10.2" assert jax.__version__ == "0.4.38" +assert version("absl-py") == "2.5.0" +assert version("msgpack") == "1.2.1" assert numpy.__version__ == "1.26.4" assert optax.__version__ == "0.2.5" assert hasattr(orbax.checkpoint, "PyTreeCheckpointer") diff --git a/python/tensorrt_model_connect/families/internlm/python_profile_requirements/internlm.lock.txt b/python/tensorrt_model_connect/families/internlm/python_profile_requirements/internlm.lock.txt index a2a2279e01..56da20fa69 100644 --- a/python/tensorrt_model_connect/families/internlm/python_profile_requirements/internlm.lock.txt +++ b/python/tensorrt_model_connect/families/internlm/python_profile_requirements/internlm.lock.txt @@ -2,3 +2,4 @@ einops==0.8.1 huggingface-hub==0.26.5 tokenizers==0.20.3 transformers==4.46.3 +tiktoken==0.12.0 diff --git a/python/tensorrt_model_connect/families/internlm/python_profile_verify.py b/python/tensorrt_model_connect/families/internlm/python_profile_verify.py index ed891f075a..a3ca271b4f 100644 --- a/python/tensorrt_model_connect/families/internlm/python_profile_verify.py +++ b/python/tensorrt_model_connect/families/internlm/python_profile_verify.py @@ -1,10 +1,15 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +from importlib.metadata import version + import einops +import tiktoken import transformers from transformers.cache_utils import DynamicCache assert hasattr(DynamicCache, "from_legacy_cache") assert hasattr(DynamicCache, "get_max_cache_shape") +assert version("tiktoken") == "0.12.0" +assert callable(tiktoken.get_encoding) print(f"einops={einops.__version__} transformers={transformers.__version__}") diff --git a/python/tensorrt_model_connect/families/phi4_multimodal/python_profile_requirements/phi4_multimodal.lock.txt b/python/tensorrt_model_connect/families/phi4_multimodal/python_profile_requirements/phi4_multimodal.lock.txt index 4ab9051fb7..441d671b1a 100644 --- a/python/tensorrt_model_connect/families/phi4_multimodal/python_profile_requirements/phi4_multimodal.lock.txt +++ b/python/tensorrt_model_connect/families/phi4_multimodal/python_profile_requirements/phi4_multimodal.lock.txt @@ -1,6 +1,7 @@ accelerate==1.3.0 backoff==2.2.1 huggingface-hub==0.28.1 +jinja2==3.1.6 peft==0.13.2 tokenizers==0.21.4 transformers==4.48.2 diff --git a/python/tensorrt_model_connect/families/phi4_multimodal/python_profile_verify.py b/python/tensorrt_model_connect/families/phi4_multimodal/python_profile_verify.py index 411fb1cec3..2773fed36b 100644 --- a/python/tensorrt_model_connect/families/phi4_multimodal/python_profile_verify.py +++ b/python/tensorrt_model_connect/families/phi4_multimodal/python_profile_verify.py @@ -1,10 +1,19 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +from importlib.metadata import version + import backoff +import jinja2 import transformers from transformers.cache_utils import SlidingWindowCache assert transformers.__version__ == "4.48.2" +assert version("jinja2") == "3.1.6" +assert jinja2 is not None assert SlidingWindowCache is not None -print(f"backoff={backoff.__version__} transformers={transformers.__version__}") +print( + f"backoff={backoff.__version__} " + f"jinja2={version('jinja2')} " + f"transformers={transformers.__version__}" +) diff --git a/python/tensorrt_model_connect/families/sana_wm/MODEL.toml b/python/tensorrt_model_connect/families/sana_wm/MODEL.toml index b91f369857..eb64288de5 100644 --- a/python/tensorrt_model_connect/families/sana_wm/MODEL.toml +++ b/python/tensorrt_model_connect/families/sana_wm/MODEL.toml @@ -7,6 +7,7 @@ python_profile_specs = [ "sana_wm_reference|families/sana_wm/python_profile_requirements/sana_wm_reference.lock.txt|families/sana_wm/python_profile_reference_verify.py|true", ] default_execution_profiles = [ + "build|sana_wm_reference", "reference|sana_wm_reference", ] module = "plugin" diff --git a/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py b/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py index 97e4a18036..3f06f8227e 100644 --- a/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py +++ b/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py @@ -6,6 +6,7 @@ from importlib.metadata import version import diffusers +import einops import torch import torchvision import transformers @@ -13,8 +14,13 @@ assert version("PyYAML") == "6.0.3" +assert transformers.__version__ == "5.2.0", transformers.__version__ +assert version("huggingface-hub") == "1.22.0" +assert version("tokenizers") == "0.22.2" +assert version("einops") == "0.8.2" assert callable(torch.cuda.is_available) assert hasattr(torchvision.transforms, "Compose") assert hasattr(diffusers, "DiffusionPipeline") +assert einops is not None assert hasattr(transformers, "AutoTokenizer") assert callable(yaml.safe_load) diff --git a/python/tensorrt_model_connect/families/sana_wm/python_profile_requirements/sana_wm_reference.lock.txt b/python/tensorrt_model_connect/families/sana_wm/python_profile_requirements/sana_wm_reference.lock.txt index f62ce0c56d..1a7f4149dd 100644 --- a/python/tensorrt_model_connect/families/sana_wm/python_profile_requirements/sana_wm_reference.lock.txt +++ b/python/tensorrt_model_connect/families/sana_wm/python_profile_requirements/sana_wm_reference.lock.txt @@ -1 +1,5 @@ PyYAML==6.0.3 +transformers==5.2.0 +huggingface-hub==1.22.0 +tokenizers==0.22.2 +einops==0.8.2 diff --git a/python/tensorrt_model_connect/python_profile_requirements/reference_common.lock.txt b/python/tensorrt_model_connect/python_profile_requirements/reference_common.lock.txt index c90d7ba1d5..575a19beea 100644 --- a/python/tensorrt_model_connect/python_profile_requirements/reference_common.lock.txt +++ b/python/tensorrt_model_connect/python_profile_requirements/reference_common.lock.txt @@ -2,5 +2,15 @@ # SPDX-License-Identifier: Apache-2.0 transformers==5.2.0 +huggingface-hub==1.22.0 +tokenizers==0.22.2 +open-clip-torch==3.3.0 +ftfy==6.3.1 rouge-score==0.1.2 sacrebleu==2.5.1 +colorama==0.4.6 +portalocker==3.2.0 +tabulate==0.10.0 +lxml==6.1.1 +Jinja2==3.1.6 +MarkupSafe==3.0.3 diff --git a/python/tensorrt_model_connect/python_profiles.toml b/python/tensorrt_model_connect/python_profiles.toml index 0d7f5f82f2..b8c2fa8ee8 100644 --- a/python/tensorrt_model_connect/python_profiles.toml +++ b/python/tensorrt_model_connect/python_profiles.toml @@ -12,10 +12,23 @@ requirements = "python_profile_requirements/reference_common.lock.txt" system_site_packages = true verification_script = """ from importlib.metadata import version +import ftfy +import open_clip +import sacrebleu import transformers assert transformers.__version__ == "5.2.0", transformers.__version__ +assert version("huggingface-hub") == "1.22.0" +assert version("tokenizers") == "0.22.2" +assert version("open-clip-torch") == "3.3.0" +assert version("ftfy") == "6.3.1" assert version("rouge-score") == "0.1.2" assert version("sacrebleu") == "2.5.1" +assert version("colorama") == "0.4.6" +assert version("portalocker") == "3.2.0" +assert version("tabulate") == "0.10.0" +assert version("lxml") == "6.1.1" +assert version("Jinja2") == "3.1.6" +assert version("MarkupSafe") == "3.0.3" """ [reference_backend_defaults.golden_snapshot] From d43cb14fa16b5044f17476b12d08cca4196ca044 Mon Sep 17 00:00:00 2001 From: chaofengw-nv Date: Sat, 29 Aug 2026 14:08:15 +0000 Subject: [PATCH 2/3] test(sana-wm): keep version checks under optimization Raise explicit profile errors for the newly pinned reference dependencies so verification remains active when Python assertions are disabled. Signed-off-by: chaofengw-nv --- .../sana_wm/python_profile_reference_verify.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py b/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py index 3f06f8227e..a097245fbe 100644 --- a/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py +++ b/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py @@ -14,10 +14,18 @@ assert version("PyYAML") == "6.0.3" -assert transformers.__version__ == "5.2.0", transformers.__version__ -assert version("huggingface-hub") == "1.22.0" -assert version("tokenizers") == "0.22.2" -assert version("einops") == "0.8.2" +required_versions = { + "transformers": "5.2.0", + "huggingface-hub": "1.22.0", + "tokenizers": "0.22.2", + "einops": "0.8.2", +} +for distribution, expected in required_versions.items(): + actual = version(distribution) + if actual != expected: + raise RuntimeError( + f"Sana-WM profile requires {distribution}=={expected}, found {actual}" + ) assert callable(torch.cuda.is_available) assert hasattr(torchvision.transforms, "Compose") assert hasattr(diffusers, "DiffusionPipeline") From 0bb027bce70484b122941a4f88ae9ff4eada0cdf Mon Sep 17 00:00:00 2001 From: chaofengw Date: Sat, 29 Aug 2026 17:08:28 +0000 Subject: [PATCH 3/3] fix(sana-wm): align Hub pin with diffusers Pin huggingface-hub 1.26.0 so the prepared SANA-WM profile provides the repository-tree API imported by the reviewed runtime's diffusers package. Add a family-owned regression test for that compatibility floor. Signed-off-by: chaofengw --- .../sana_wm/python_profile_reference_verify.py | 2 +- .../sana_wm_reference.lock.txt | 2 +- .../sana_wm/tests/test_python_profile.py | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 python/tensorrt_model_connect/families/sana_wm/tests/test_python_profile.py diff --git a/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py b/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py index a097245fbe..5e0a9441fb 100644 --- a/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py +++ b/python/tensorrt_model_connect/families/sana_wm/python_profile_reference_verify.py @@ -16,7 +16,7 @@ assert version("PyYAML") == "6.0.3" required_versions = { "transformers": "5.2.0", - "huggingface-hub": "1.22.0", + "huggingface-hub": "1.26.0", "tokenizers": "0.22.2", "einops": "0.8.2", } diff --git a/python/tensorrt_model_connect/families/sana_wm/python_profile_requirements/sana_wm_reference.lock.txt b/python/tensorrt_model_connect/families/sana_wm/python_profile_requirements/sana_wm_reference.lock.txt index 1a7f4149dd..50aedb4bfa 100644 --- a/python/tensorrt_model_connect/families/sana_wm/python_profile_requirements/sana_wm_reference.lock.txt +++ b/python/tensorrt_model_connect/families/sana_wm/python_profile_requirements/sana_wm_reference.lock.txt @@ -1,5 +1,5 @@ PyYAML==6.0.3 transformers==5.2.0 -huggingface-hub==1.22.0 +huggingface-hub==1.26.0 tokenizers==0.22.2 einops==0.8.2 diff --git a/python/tensorrt_model_connect/families/sana_wm/tests/test_python_profile.py b/python/tensorrt_model_connect/families/sana_wm/tests/test_python_profile.py new file mode 100644 index 0000000000..83fef17fa2 --- /dev/null +++ b/python/tensorrt_model_connect/families/sana_wm/tests/test_python_profile.py @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""SANA-WM-owned Python profile contracts.""" + +from pathlib import Path + +from packaging.version import Version + + +def test_reference_profile_pins_hub_release_with_diffusers_tree_api() -> None: + lock = ( + Path(__file__).resolve().parents[1] + / "python_profile_requirements/sana_wm_reference.lock.txt" + ).read_text(encoding="utf-8") + pins = dict(line.split("==", maxsplit=1) for line in lock.splitlines() if line) + + assert Version(pins["huggingface-hub"]) >= Version("1.26.0")