Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Misc] Upgrade to pytorch 2.5 #9588

Merged
merged 10 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ set(HIP_SUPPORTED_ARCHS "gfx906;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx11
# requirements.txt files and should be kept consistent. The ROCm torch
# versions are derived from Dockerfile.rocm
#
set(TORCH_SUPPORTED_VERSION_CUDA "2.4.0")
set(TORCH_SUPPORTED_VERSION_CUDA "2.5.0")
set(TORCH_SUPPORTED_VERSION_ROCM "2.5.0")

#
Expand Down
6 changes: 1 addition & 5 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,7 @@ function (define_gpu_extension_target GPU_MOD_NAME)
# Don't use `TORCH_LIBRARIES` for CUDA since it pulls in a bunch of
# dependencies that are not necessary and may not be installed.
if (GPU_LANGUAGE STREQUAL "CUDA")
if ("${CUDA_CUDA_LIB}" STREQUAL "")
set(CUDA_CUDA_LIB "${CUDA_CUDA_LIBRARY}")
endif()
target_link_libraries(${GPU_MOD_NAME} PRIVATE ${CUDA_CUDA_LIB}
${CUDA_LIBRARIES})
target_link_libraries(${GPU_MOD_NAME} PRIVATE CUDA::cudart CUDA::cuda_driver)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

else()
target_link_libraries(${GPU_MOD_NAME} PRIVATE ${TORCH_LIBRARIES})
endif()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requires = [
"packaging",
"setuptools>=61",
"setuptools-scm>=8.0",
"torch == 2.4.0",
"torch == 2.5.0 --extra-index-url https://download.pytorch.org/whl/cu121",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given @youkaichao's comment:

the cuda version should not matter that much. I think our current pipeline should still work even if pytorch itself is built against cuda 12.4 .

We should consider ditching the --extra-index-url. Perhaps this should be configurable, but one thing to note is that 2:4 sparse fp8 will require the Pytorch version that's built with 12.4

"wheel",
"jinja2",
]
Expand Down
2 changes: 1 addition & 1 deletion requirements-build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ ninja
packaging
setuptools>=61
setuptools-scm>=8
torch==2.4.0
torch==2.5.0 --extra-index-url https://download.pytorch.org/whl/cu121
wheel
jinja2
4 changes: 2 additions & 2 deletions requirements-cpu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
-r requirements-common.txt

# Dependencies for x86_64 CPUs
torch == 2.4.0+cpu; platform_machine != "ppc64le"
torchvision; platform_machine != "ppc64le" # required for the image processor of phi3v, this must be updated alongside torch
torch == 2.5.0+cpu --extra-index-url https://download.pytorch.org/whl/cu121; platform_machine != "ppc64le"
torchvision --extra-index-url https://download.pytorch.org/whl/cu121; platform_machine != "ppc64le" # required for the image processor of phi3v, this must be updated alongside torch
8 changes: 5 additions & 3 deletions requirements-cuda.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
# Dependencies for NVIDIA GPUs
ray >= 2.9
nvidia-ml-py # for pynvml package
torch == 2.4.0
torch == 2.5.0 --extra-index-url https://download.pytorch.org/whl/cu121
# These must be updated alongside torch
torchvision == 0.19 # Required for phi3v processor. See https://github.com/pytorch/vision?tab=readme-ov-file#installation for corresponding version
xformers == 0.0.27.post2; platform_system == 'Linux' and platform_machine == 'x86_64' # Requires PyTorch 2.4.0
# Required for phi3v processor. See https://github.com/pytorch/vision?tab=readme-ov-file#installation for corresponding version
torchvision == 0.20 --extra-index-url https://download.pytorch.org/whl/cu121
# Requires PyTorch 2.5.0
xformers == 0.0.28.post2 --extra-index-url https://download.pytorch.org/whl/cu121; platform_system == 'Linux' and platform_machine == 'x86_64'
2 changes: 1 addition & 1 deletion requirements-openvino.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Common dependencies
-r requirements-common.txt

torch == 2.4.0 # should be aligned with "common" vLLM torch version
torch == 2.5.0 --extra-index-url https://download.pytorch.org/whl/cu121 # should be aligned with "common" vLLM torch version
openvino >= 2024.4.0 # since 2024.4.0 both CPU and GPU support Paged Attention

optimum @ git+https://github.com/huggingface/optimum.git@main # latest optimum is used to support latest transformers version
Expand Down