Skip to content

Commit ca8b3d2

Browse files
committed
Pin diffusers<0.40 for the tf_min unit test env
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 <shengliangx@nvidia.com>
1 parent 913f5e2 commit ca8b3d2

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

noxfile.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,15 @@
4242
"torch_213": "torchvision~=0.28.0",
4343
}
4444

45+
# Extra install pins applied per transformers matrix entry (installed after the base
46+
# ``.[all,dev-test]`` install to constrain that env).
4547
TRANSFORMERS_VERSIONS = {
46-
"tf_latest": "transformers~=5.14.0",
47-
"tf_min": "transformers~=4.57.0",
48+
"tf_latest": ("transformers~=5.14.0",),
49+
# transformers 4.57 caps ``huggingface_hub<1.0``, but ``diffusers>=0.40`` requires
50+
# ``huggingface_hub>=1.23``. Bound diffusers to a hub<1.0-compatible release so this env
51+
# stays internally consistent; otherwise diffusers' pipeline import fails and diffusers
52+
# models silently misroute to the LLM path on export.
53+
"tf_min": ("transformers~=4.57.0", "diffusers<0.40"),
4854
}
4955

5056

@@ -63,9 +69,9 @@ def _cov_args():
6369
def unit(session, torch_ver, tf_ver):
6470
"""Unit tests — parametrized over torch and transformers versions."""
6571
session.install(TORCH_VERSIONS[torch_ver], "-e", ".[all,dev-test]")
66-
tf_pin = TRANSFORMERS_VERSIONS[tf_ver]
67-
if tf_pin:
68-
session.install(tf_pin)
72+
tf_pins = TRANSFORMERS_VERSIONS[tf_ver]
73+
if tf_pins:
74+
session.install(*tf_pins)
6975
session.run("python", "-m", "pytest", "tests/unit", *_cov_args(), env=_CPU_ONLY_ENV)
7076

7177

0 commit comments

Comments
 (0)