Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: document the intentional torch and torchcodec floor gap (#10635)

Rudra Bhaskar135dca33cd7b
diff --git a/install.sh b/install.sh
index 0be845cae6e..a2b99f9688a 100755
--- a/install.sh
+++ b/install.sh
@@ -4489,6 +4489,7 @@ _TORCH_CEILING="2.12.0"
_TORCHVISION_CEILING="0.27.0"
_TORCHAUDIO_CEILING="2.12.0"
# Default torch constraint; tightened for Python 3.13+ on arm64 macOS (no cp313 wheels below 2.6).
+# torch 2.4 is supported without torchcodec: install_python_stack.py's codec table starts at 2.5 (#10598).
TORCH_CONSTRAINT="torch>=2.4,<${_TORCH_CEILING}"
if [ "$SKIP_TORCH" = false ] && [ "$OS" = "macos" ] && [ "$_ARCH" = "arm64" ]; then
_PY_MINOR=$("$VENV_DIR/bin/python" -c \
diff --git a/studio/install_python_stack.py b/studio/install_python_stack.py
index e63cafbc2f9..af6cedf54e1 100644
--- a/studio/install_python_stack.py
+++ b/studio/install_python_stack.py
@@ -840,6 +840,7 @@ def _select_torchao_spec(torch_version: str | None) -> str:
# torchcodec 0.11 and older target one torch minor; 0.12 is ABI-stable with torch 2.11+.
_TORCHCODEC_DEFAULT_SPEC = "torchcodec>=0.10.0,<0.11.0"
_TORCHCODEC_ABI_STABLE_SPEC = "torchcodec>=0.12.0"
+# install.sh still accepts torch 2.4: deliberately no row, so it ships without torchcodec rather than 0.0.3 (#10598).
_TORCHCODEC_TORCH_SPECS: dict[int, str] = {
12: _TORCHCODEC_ABI_STABLE_SPEC,
11: "torchcodec>=0.11.0,<0.12.0",
diff --git a/tests/python/test_torchcodec_torch_compat.py b/tests/python/test_torchcodec_torch_compat.py
index 2448c7fbd70..f69da528bd3 100644
--- a/tests/python/test_torchcodec_torch_compat.py
+++ b/tests/python/test_torchcodec_torch_compat.py
@@ -280,6 +280,19 @@ def test_select_torchcodec_spec_falls_back_on_unknown_torch():
assert ips._select_torchcodec_spec(value) == ips._TORCHCODEC_DEFAULT_SPEC
+def test_shell_torch_floors_below_codec_table_skip_torchcodec():
+ ips = _load_install_python_stack()
+ source = (REPO_ROOT / "install.sh").read_text(encoding = "utf-8")
+ floors = {int(m) for m in re.findall(r'TORCH_CONSTRAINT="torch>=2\.(\d+)', source)}
+ assert floors, "install.sh torch constraints were not found"
+ codec_floor = min(ips._TORCHCODEC_TORCH_SPECS)
+ # Moving either floor means the torch 2.4 notes in both files are stale (#10598).
+ assert (min(floors), codec_floor) == (4, 5)
+ for minor in floors:
+ spec = ips._select_torchcodec_spec(f"2.{minor}.0")
+ assert (spec is None) == (minor < codec_floor), (minor, spec)
+
+
def test_select_torchcodec_spec_skips_older_torch():
ips = _load_install_python_stack()
for minor in range(min(ips._TORCHCODEC_TORCH_SPECS)):