From ca8b3d2eb8756b2d0284a6737368cf1c5fcf756a Mon Sep 17 00:00:00 2001 From: Shengliang Xu Date: Fri, 21 Aug 2026 01:26:45 +0000 Subject: [PATCH] Pin diffusers<0.40 for the tf_min unit test env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tf_min unit matrix pins `transformers~=4.57`, which requires `huggingface_hub<1.0`. A fresh env's unbounded diffusers (`diffusers>=0.32.2`) resolves to diffusers 0.40, which requires `huggingface_hub>=1.23` — an unsatisfiable combination. The env keeps hub 0.36 (for transformers), so diffusers 0.40's pipeline import fails (missing `get_cached_repo_tree`); `is_diffusers_object` then returns False and diffusers models silently misroute to the LLM export path, failing tests/unit/torch/export/test_export_diffusers.py on tf_min (on main and every open PR). Pin `diffusers<0.40` for the tf_min env (resolves to 0.39, which supports `huggingface_hub<1.0`) so the env stays internally consistent. tf_latest is unchanged. Validated locally: with the pin, the four failing diffusers export tests pass under transformers 4.57. Signed-off-by: Shengliang Xu --- noxfile.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/noxfile.py b/noxfile.py index 8fe3df5eb85..5bd7997a90f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -42,9 +42,15 @@ "torch_213": "torchvision~=0.28.0", } +# Extra install pins applied per transformers matrix entry (installed after the base +# ``.[all,dev-test]`` install to constrain that env). TRANSFORMERS_VERSIONS = { - "tf_latest": "transformers~=5.14.0", - "tf_min": "transformers~=4.57.0", + "tf_latest": ("transformers~=5.14.0",), + # transformers 4.57 caps ``huggingface_hub<1.0``, but ``diffusers>=0.40`` requires + # ``huggingface_hub>=1.23``. Bound diffusers to a hub<1.0-compatible release so this env + # stays internally consistent; otherwise diffusers' pipeline import fails and diffusers + # models silently misroute to the LLM path on export. + "tf_min": ("transformers~=4.57.0", "diffusers<0.40"), } @@ -63,9 +69,9 @@ def _cov_args(): def unit(session, torch_ver, tf_ver): """Unit tests — parametrized over torch and transformers versions.""" session.install(TORCH_VERSIONS[torch_ver], "-e", ".[all,dev-test]") - tf_pin = TRANSFORMERS_VERSIONS[tf_ver] - if tf_pin: - session.install(tf_pin) + tf_pins = TRANSFORMERS_VERSIONS[tf_ver] + if tf_pins: + session.install(*tf_pins) session.run("python", "-m", "pytest", "tests/unit", *_cov_args(), env=_CPU_ONLY_ENV)