diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 197117ef2..8537c6a9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,7 +132,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, windows-2019] + os: [ubuntu-22.04, windows-2022] arch: [auto64] include: - os: ubuntu-22.04 @@ -183,7 +183,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, windows-2019] + os: [ubuntu-22.04, windows-2022] steps: - name: Set up Python 3.9 diff --git a/CMakeLists.txt b/CMakeLists.txt index 62b99d136..9d75878e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.10) # Set policy for setting the MSVC runtime library for static MSVC builds if(POLICY CMP0091) @@ -23,6 +23,9 @@ option(BUILD_SHARED_LIBS "Build shared libraries" ON) option(WITH_TENSOR_PARALLEL "Compile with NCCL and MPI backend" OFF) option(WITH_FLASH_ATTN "Compile with Flash Attention 2" OFF) +MESSAGE(STATUS "Compiler Id: ${CMAKE_CXX_COMPILER_ID}") +MESSAGE(STATUS "Compiler Version: ${CMAKE_CXX_COMPILER_VERSION}") + if(ENABLE_PROFILING) message(STATUS "Enable profiling support") add_definitions(-DCT2_ENABLE_PROFILING) diff --git a/docs/quickstart.md b/docs/quickstart.md index 4b10a04c6..8720c0b9d 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -79,7 +79,7 @@ See the [installation guide](installation.md) for more information. **2\. Add CTranslate2 to your CMakeLists.txt** ```cmake -cmake_minimum_required (VERSION 2.8.11) +cmake_minimum_required (VERSION 3.10) project (CTRANSLATE2_DEMO) find_package(ctranslate2) diff --git a/examples/wngt2020/CMakeLists.txt b/examples/wngt2020/CMakeLists.txt index d0a527dc2..da1e57d12 100644 --- a/examples/wngt2020/CMakeLists.txt +++ b/examples/wngt2020/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.10) project(wngt2020) set(CMAKE_CXX_STANDARD 11) set(CMAKE_BUILD_TYPE Release) diff --git a/python/tools/prepare_build_environment_linux.sh b/python/tools/prepare_build_environment_linux.sh index 61ac171a3..c92ef4b58 100755 --- a/python/tools/prepare_build_environment_linux.sh +++ b/python/tools/prepare_build_environment_linux.sh @@ -20,7 +20,7 @@ if [ "$CIBW_ARCHS" == "aarch64" ]; then else # Install CUDA 12.2: - yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo + yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo # error mirrorlist.centos.org doesn't exists anymore. sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo @@ -29,7 +29,7 @@ else cuda-nvcc-12-2-12.2.140-1 \ cuda-cudart-devel-12-2-12.2.140-1 \ libcurand-devel-12-2-10.3.3.141-1 \ - libcudnn9-devel-cuda-12-9.1.0.70-1 \ + libcudnn9-devel-cuda-12-9.0.0.312-1 \ libcublas-devel-12-2-12.2.5.6-1 \ libnccl-devel-2.19.3-1+cuda12.2 ln -s cuda-12.2 /usr/local/cuda diff --git a/python/tools/prepare_build_environment_windows.sh b/python/tools/prepare_build_environment_windows.sh index 8b55abf56..57a093938 100755 --- a/python/tools/prepare_build_environment_windows.sh +++ b/python/tools/prepare_build_environment_windows.sh @@ -29,8 +29,26 @@ rmdir "$CUDNN_ROOT/include/12.4" cp -r "$CUDNN_ROOT"/* "$CUDA_ROOT" rm cudnn.exe +# Install MSVC 14.29.30133 +curl -L -o vs_buildtools.exe "https://aka.ms/vs/16/release/vs_buildtools.exe" +./vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.VCTools \ + --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ + --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 \ + --add Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64 \ + --add Microsoft.VisualStudio.Component.Windows10SDK.19041 \ + --add Microsoft.VisualStudio.Component.VC.CMake.Project \ + --includeRecommended + +# Verify installation +if [ -f "/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" ]; then + echo "MSVC 14.29.30133 installed successfully!" +else + echo "Installation verification failed. Checking available versions..." + exit 1 +fi + # See https://github.com/oneapi-src/oneapi-ci for installer URLs -curl --netrc-optional -L -nv -o webimage.exe https://registrationcenter-download.intel.com/akdlm/irc_nas/19078/w_BaseKit_p_2023.0.0.25940_offline.exe +curl --netrc-optional -L -nv -o webimage.exe https://registrationcenter-download.intel.com/akdlm/IRC_NAS/2cbb02eb-dd4c-4058-a4ac-2e38729a8409/intel-oneapi-base-toolkit-2025.1.2.7_offline.exe ./webimage.exe -s -x -f webimage_extracted --log extract.log rm webimage.exe ./webimage_extracted/bootstrapper.exe -s --action install --components="intel.oneapi.win.mkl.devel" --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 --log-dir=. @@ -39,19 +57,27 @@ ONEDNN_VERSION=3.1.1 curl --netrc-optional -L -O https://github.com/oneapi-src/oneDNN/archive/refs/tags/v${ONEDNN_VERSION}.tar.gz tar xf *.tar.gz && rm *.tar.gz cd oneDNN-* -cmake -DCMAKE_BUILD_TYPE=Release -DONEDNN_LIBRARY_TYPE=STATIC -DONEDNN_BUILD_EXAMPLES=OFF -DONEDNN_BUILD_TESTS=OFF -DONEDNN_ENABLE_WORKLOAD=INFERENCE -DONEDNN_ENABLE_PRIMITIVE="CONVOLUTION;REORDER" -DONEDNN_BUILD_GRAPH=OFF . +cmake -G "Visual Studio 16 2019" -DCMAKE_CXX_COMPILER="/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_C_COMPILER="/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_BUILD_TYPE=Release -DONEDNN_LIBRARY_TYPE=STATIC -DONEDNN_BUILD_EXAMPLES=OFF -DONEDNN_BUILD_TESTS=OFF -DONEDNN_ENABLE_WORKLOAD=INFERENCE -DONEDNN_ENABLE_PRIMITIVE="CONVOLUTION;REORDER" -DONEDNN_BUILD_GRAPH=OFF . cmake --build . --config Release --target install --parallel 6 cd .. rm -r oneDNN-* mkdir build cd build -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$CTRANSLATE2_ROOT -DCMAKE_PREFIX_PATH="C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/compiler/lib/intel64_win;C:/Program Files (x86)/oneDNN" -DBUILD_CLI=OFF -DWITH_DNNL=ON -DWITH_CUDA=ON -DWITH_CUDNN=ON -DCUDA_TOOLKIT_ROOT_DIR="$CUDA_ROOT" -DCUDA_DYNAMIC_LOADING=ON -DCUDA_NVCC_FLAGS="-Xfatbin=-compress-all" -DCUDA_ARCH_LIST="Common" .. +cmake -G "Visual Studio 16 2019" -DCMAKE_CXX_COMPILER="/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_C_COMPILER="/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$CTRANSLATE2_ROOT -DCMAKE_PREFIX_PATH="C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/compiler/lib/intel64_win;C:/Program Files (x86)/oneDNN" -DBUILD_CLI=OFF -DWITH_DNNL=ON -DWITH_CUDA=ON -DWITH_CUDNN=ON -DCUDA_TOOLKIT_ROOT_DIR="$CUDA_ROOT" -DCUDA_DYNAMIC_LOADING=ON -DCUDA_NVCC_FLAGS="-Xfatbin=-compress-all" -DCUDA_ARCH_LIST="Common" .. cmake --build . --config Release --target install --parallel 6 --verbose cd .. rm -r build cp README.md python/ cp $CTRANSLATE2_ROOT/bin/ctranslate2.dll python/ctranslate2/ -cp "C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/redist/intel64_win/compiler/libiomp5md.dll" python/ctranslate2/ + +LIBIOMP5_PATH=$(find "C:/Program Files (x86)/Intel/oneAPI" -name "libiomp5md.dll" -type f 2>/dev/null | head -1) +if [ -z "$LIBIOMP5_PATH" ]; then + echo "Error: libiomp5md.dll not found in Intel oneAPI installation." + exit 1 +fi +echo "Found libiomp5md.dll at: $LIBIOMP5_PATH" + +cp "$LIBIOMP5_PATH" python/ctranslate2/ cp "$CUDA_ROOT/bin/cudnn64_9.dll" python/ctranslate2/ diff --git a/third_party/cpu_features b/third_party/cpu_features index 8a494eb1e..d3b2440fc 160000 --- a/third_party/cpu_features +++ b/third_party/cpu_features @@ -1 +1 @@ -Subproject commit 8a494eb1e158ec2050e5f699a504fbc9b896a43b +Subproject commit d3b2440fcfc25fe8e6d0d4a85f06d68e98312f5b diff --git a/third_party/cutlass b/third_party/cutlass index bbe579a9e..9baa06dd5 160000 --- a/third_party/cutlass +++ b/third_party/cutlass @@ -1 +1 @@ -Subproject commit bbe579a9e3beb6ea6626d9227ec32d0dae119a49 +Subproject commit 9baa06dd57804ce8fb5efe9e471b3451341522c6 diff --git a/third_party/cxxopts b/third_party/cxxopts index c74846a89..5e6d1e29f 160000 --- a/third_party/cxxopts +++ b/third_party/cxxopts @@ -1 +1 @@ -Subproject commit c74846a891b3cc3bfa992d588b1295f528d43039 +Subproject commit 5e6d1e29f7546d9d94fe3d193b788b280bf1f37d diff --git a/third_party/googletest b/third_party/googletest index f8d7d77c0..7e17b15f1 160000 --- a/third_party/googletest +++ b/third_party/googletest @@ -1 +1 @@ -Subproject commit f8d7d77c06936315286eb55f8de22cd23c188571 +Subproject commit 7e17b15f1547bb8dd9c2fed91043b7af3437387f diff --git a/third_party/ruy b/third_party/ruy index 363f25228..9940fbf1e 160000 --- a/third_party/ruy +++ b/third_party/ruy @@ -1 +1 @@ -Subproject commit 363f252289fb7a1fba1703d99196524698cb884d +Subproject commit 9940fbf1e0c0863907e77e0600b99bb3e2bc2b9f diff --git a/third_party/spdlog b/third_party/spdlog index 76fb40d95..9ecdf5c8a 160000 --- a/third_party/spdlog +++ b/third_party/spdlog @@ -1 +1 @@ -Subproject commit 76fb40d95455f249bd70824ecfcae7a8f0930fa3 +Subproject commit 9ecdf5c8a1a3ace5673f9fd1857da1b6375b5114 diff --git a/third_party/thrust b/third_party/thrust index d997cd37a..756c5afc0 160000 --- a/third_party/thrust +++ b/third_party/thrust @@ -1 +1 @@ -Subproject commit d997cd37a95b0fa2f1a0cd4697fd1188a842fbc8 +Subproject commit 756c5afc0750f1413da05bd2b6505180e84c53d4