From 4e9fcad4a45987ea939615ac096159c874a03f1e Mon Sep 17 00:00:00 2001 From: Fabien Dupont Date: Tue, 9 Jul 2024 03:20:26 -0400 Subject: [PATCH] Relax the torch version dependency The PyTorch project has released the patch version 2.3.1 with a number of fixes. This change relaxes the version in the requirements files for build and CUDA, in order to allow picking fixes, while not bumping to the next minor version. Signed-off-by: Fabien Dupont --- pyproject.toml | 2 +- requirements-build.txt | 14 +++++++------- requirements-cpu.txt | 2 +- requirements-cuda.txt | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 790e01362028..07bd42384889 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ requires = [ "ninja", "packaging", "setuptools >= 49.4.0", - "torch == 2.3.0", + "torch >=2.3.0, <2.4.0", "wheel", ] build-backend = "setuptools.build_meta" diff --git a/requirements-build.txt b/requirements-build.txt index 1a07a94e82e0..6f394e009301 100644 --- a/requirements-build.txt +++ b/requirements-build.txt @@ -1,7 +1,7 @@ -# Should be mirrored in pyproject.toml -cmake>=3.21 -ninja -packaging -setuptools>=49.4.0 -torch==2.3.0 -wheel +# Should be mirrored in pyproject.toml +cmake>=3.21 +ninja +packaging +setuptools>=49.4.0 +torch >=2.3.0, <2.4.0 +wheel diff --git a/requirements-cpu.txt b/requirements-cpu.txt index 754070df21c0..5953b41dad4d 100644 --- a/requirements-cpu.txt +++ b/requirements-cpu.txt @@ -2,6 +2,6 @@ -r requirements-common.txt # Dependencies for x86_64 CPUs -torch == 2.3.1+cpu; platform_machine != "ppc64le" +torch >= 2.3.1+cpu, <2.4.0+cpu; platform_machine != "ppc64le" torchvision == 0.18.1+cpu; platform_machine != "ppc64le" # required for the image processor of phi3v, this must be updated alongside torch triton >= 2.2.0 # FIXME(woosuk): This is a hack to avoid import error. diff --git a/requirements-cuda.txt b/requirements-cuda.txt index 10596ed85d60..652eec47deb1 100644 --- a/requirements-cuda.txt +++ b/requirements-cuda.txt @@ -4,7 +4,7 @@ # Dependencies for NVIDIA GPUs ray >= 2.9 nvidia-ml-py # for pynvml package -torch == 2.3.0 +torch >= 2.3.0, <2.4.0 # These must be updated alongside torch torchvision == 0.18.0 # Required for phi3v processor, also see https://github.com/pytorch/vision?tab=readme-ov-file#installation for corresponding version xformers == 0.0.26.post1 # Requires PyTorch 2.3.0