diff --git a/.ci/docker/build.sh b/.ci/docker/build.sh index 6e94dc51d98d..fddeb0d0f85b 100755 --- a/.ci/docker/build.sh +++ b/.ci/docker/build.sh @@ -50,6 +50,8 @@ if [[ "$image" == *-focal* ]]; then UBUNTU_VERSION=20.04 elif [[ "$image" == *-jammy* ]]; then UBUNTU_VERSION=22.04 +elif [[ "$image" == *-noble* ]]; then + UBUNTU_VERSION=24.04 elif [[ "$image" == *ubuntu* ]]; then extract_version_from_image_name ubuntu UBUNTU_VERSION elif [[ "$image" == *centos* ]]; then diff --git a/.ci/docker/common/install_base.sh b/.ci/docker/common/install_base.sh index 3da6fa9e53df..856fef82987d 100755 --- a/.ci/docker/common/install_base.sh +++ b/.ci/docker/common/install_base.sh @@ -15,6 +15,9 @@ install_ubuntu() { elif [[ "$UBUNTU_VERSION" == "22.04"* ]]; then cmake3="cmake=3.22*" maybe_libiomp_dev="" + elif [[ "$UBUNTU_VERSION" == "24.04"* ]]; then + cmake3="cmake=3.28*" + maybe_libiomp_dev="" else cmake3="cmake=3.5*" maybe_libiomp_dev="libiomp-dev" diff --git a/.ci/docker/common/install_conda.sh b/.ci/docker/common/install_conda.sh index 0d2267c0a975..86ccd589bde6 100755 --- a/.ci/docker/common/install_conda.sh +++ b/.ci/docker/common/install_conda.sh @@ -123,6 +123,10 @@ fi conda_install_through_forge libstdcxx-ng=12 fi + if [ "$ANACONDA_PYTHON_VERSION" = "3.12" ] || [ "$UBUNTU_VERSION" == "24.04"* ] ; then + conda_install_through_forge libstdcxx-ng=14 + fi + # Install some other packages, including those needed for Python test reporting pip_install -r /opt/conda/requirements-ci.txt diff --git a/.ci/docker/common/install_rocm.sh b/.ci/docker/common/install_rocm.sh index 0f8d6e0df749..db19079ad7c1 100644 --- a/.ci/docker/common/install_rocm.sh +++ b/.ci/docker/common/install_rocm.sh @@ -16,6 +16,11 @@ install_ubuntu() { # gpg-agent is not available by default on 20.04 apt-get install -y --no-install-recommends gpg-agent fi + if [[ $UBUNTU_VERSION == 24.04 ]]; then + apt-get install -y --no-install-recommends gpg-agent + echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \ + | sudo tee /etc/apt/preferences.d/rocm-pin-600 + fi apt-get install -y kmod apt-get install -y wget diff --git a/.ci/docker/common/install_user.sh b/.ci/docker/common/install_user.sh index 29d69edd3c43..ab9eece2c63d 100755 --- a/.ci/docker/common/install_user.sh +++ b/.ci/docker/common/install_user.sh @@ -2,6 +2,13 @@ set -ex +# Since version 24 the system ships with user 'ubuntu' that has id 1000 +# We need a work-around to enable id 1000 usage for this script +if [[ $UBUNTU_VERSION == 24.04 ]]; then + # touch is used to disable harmless error message + touch /var/mail/ubuntu && chown ubuntu /var/mail/ubuntu && userdel -r ubuntu +fi + # Mirror jenkins user in container # jenkins user as ec2-user should have the same user-id echo "jenkins:x:1000:1000::/var/lib/jenkins:" >> /etc/passwd diff --git a/.ci/docker/requirements-ci.txt b/.ci/docker/requirements-ci.txt index f65ab1e605a3..a3b59fcda303 100644 --- a/.ci/docker/requirements-ci.txt +++ b/.ci/docker/requirements-ci.txt @@ -22,6 +22,7 @@ sympy==1.12.1 #test that import: coremltools==5.0b5 ; python_version < "3.12" +coremltools==7.2 ; python_version == "3.12" #Description: Apple framework for ML integration #Pinned versions: 5.0b5 #test that import: @@ -64,6 +65,7 @@ lark==0.12.0 #test that import: librosa>=0.6.2 ; python_version < "3.11" +librosa==0.10.2 ; python_version == "3.12" #Description: A python package for music and audio analysis #Pinned versions: >=0.6.2 #test that import: test_spectral_ops.py @@ -112,6 +114,7 @@ networkx==2.8.8 numba==0.49.0 ; python_version < "3.9" numba==0.54.1 ; python_version == "3.9" numba==0.55.2 ; python_version == "3.10" +numba==0.60.0 ; python_version == "3.12" #Description: Just-In-Time Compiler for Numerical Functions #Pinned versions: 0.54.1, 0.49.0, <=0.49.1 #test that import: test_numba_integration.py diff --git a/c10/hip/CMakeLists.txt b/c10/hip/CMakeLists.txt index a6442e01d2e2..e1a8bbe9d66a 100644 --- a/c10/hip/CMakeLists.txt +++ b/c10/hip/CMakeLists.txt @@ -50,7 +50,7 @@ if(NOT BUILD_LIBTORCHLESS) # ---[ Dependency of c10_hip target_link_libraries(c10_hip PUBLIC c10) - target_link_libraries(c10_hip PUBLIC ${PYTORCH_HIP_LIBRARIES}) + target_link_libraries(c10_hip PUBLIC ${PYTORCH_HIP_LIBRARIES} ${ROCM_HSART_LIB}) target_include_directories( c10_hip PUBLIC diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt index 5115944b3894..f5db067fce2a 100644 --- a/caffe2/CMakeLists.txt +++ b/caffe2/CMakeLists.txt @@ -606,7 +606,7 @@ if(USE_ROCM) # caffe2_nvrtc's stubs to driver APIs are useful for HIP. # See NOTE [ ATen NVRTC Stub and HIP ] add_library(caffe2_nvrtc SHARED ${ATen_NVRTC_STUB_SRCS}) - target_link_libraries(caffe2_nvrtc ${PYTORCH_HIP_LIBRARIES} ${ROCM_HIPRTC_LIB}) + target_link_libraries(caffe2_nvrtc ${PYTORCH_HIP_LIBRARIES} ${ROCM_HIPRTC_LIB} ${ROCM_HSART_LIB}) target_include_directories(caffe2_nvrtc PRIVATE ${CMAKE_BINARY_DIR}) target_compile_definitions(caffe2_nvrtc PRIVATE USE_ROCM __HIP_PLATFORM_AMD__) install(TARGETS caffe2_nvrtc DESTINATION "${TORCH_INSTALL_LIB_DIR}") @@ -1417,6 +1417,7 @@ target_link_libraries(torch_cpu PUBLIC c10) target_link_libraries(torch_cpu PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS}) target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_LIBS}) target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_WHOLE_LINK_LIBS}) +target_link_libraries(torch_cpu PUBLIC ${ROCM_HSART_LIB}) if(USE_MPI) target_link_libraries(torch_cpu PRIVATE MPI::MPI_CXX) endif() diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 677ab926e686..d0a6fb81dc75 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -1081,7 +1081,7 @@ if(USE_ROCM) hip_include_directories(${Caffe2_HIP_INCLUDE}) set(Caffe2_PUBLIC_HIP_DEPENDENCY_LIBS - ${PYTORCH_HIP_LIBRARIES} ${PYTORCH_MIOPEN_LIBRARIES} ${hipcub_LIBRARIES} ${ROCM_HIPRTC_LIB} ${ROCM_ROCTX_LIB}) + ${PYTORCH_HIP_LIBRARIES} ${PYTORCH_MIOPEN_LIBRARIES} ${hipcub_LIBRARIES} ${ROCM_HIPRTC_LIB} ${ROCM_ROCTX_LIB} ${ROCM_HSART_LIB}) list(APPEND Caffe2_PUBLIC_HIP_DEPENDENCY_LIBS ${hipblaslt_LIBRARIES}) list(APPEND Caffe2_PUBLIC_HIP_DEPENDENCY_LIBS diff --git a/cmake/public/LoadHIP.cmake b/cmake/public/LoadHIP.cmake index bbe258b60cdf..9f74f1db7da3 100644 --- a/cmake/public/LoadHIP.cmake +++ b/cmake/public/LoadHIP.cmake @@ -186,6 +186,8 @@ if(HIP_FOUND) find_library(ROCM_HIPRTC_LIB hiprtc HINTS ${ROCM_PATH}/lib) # roctx is part of roctracer find_library(ROCM_ROCTX_LIB roctx64 HINTS ${ROCM_PATH}/lib) + # HSA runtime lib + find_library(ROCM_HSART_LIB hsa-runtime64 HINTS ${ROCM_PATH}/lib) # check whether HIP declares new types set(file "${PROJECT_BINARY_DIR}/hip_new_types.cc") diff --git a/torch/lib/libshm/CMakeLists.txt b/torch/lib/libshm/CMakeLists.txt index 8a7329ddab77..ad97b944be33 100644 --- a/torch/lib/libshm/CMakeLists.txt +++ b/torch/lib/libshm/CMakeLists.txt @@ -64,7 +64,7 @@ if(BUILD_LIBTORCHLESS) target_link_libraries(torch_shm_manager PRIVATE shm ${C10_LIB}) else() # we need to link directly to c10 here otherwise we miss symbols - target_link_libraries(torch_shm_manager PRIVATE shm c10) + target_link_libraries(torch_shm_manager PRIVATE shm c10 ${ROCM_HSART_LIB}) endif() set_target_properties(torch_shm_manager PROPERTIES INSTALL_RPATH "${_rpath_portable_origin}/../lib")