Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/wngt2020/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions python/tools/prepare_build_environment_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
34 changes: 30 additions & 4 deletions python/tools/prepare_build_environment_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=.
Expand All @@ -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/
2 changes: 1 addition & 1 deletion third_party/cpu_features
Submodule cpu_features updated 86 files
+35 −0 .bazelrc
+9 −4 .dockerignore
+13 −0 .github/dependabot.yml
+1 −0 .github/workflows/Dockerfile
+20 −0 .github/workflows/aarch64_linux_bazel.yml
+7 −7 .github/workflows/aarch64_linux_cmake.yml
+5 −5 .github/workflows/amd64_freebsd_cmake.yml_disabled
+0 −31 .github/workflows/amd64_linux.yml
+26 −0 .github/workflows/amd64_linux_bazel.yml
+31 −0 .github/workflows/amd64_linux_cmake.yml
+36 −0 .github/workflows/amd64_macos_bazel.yml
+6 −5 .github/workflows/amd64_macos_cmake.yml
+33 −0 .github/workflows/amd64_windows_bazel.yml
+2 −2 .github/workflows/amd64_windows_cmake.yml
+36 −0 .github/workflows/arm64_macos_bazel.yml
+44 −0 .github/workflows/arm64_macos_cmake.yml
+7 −10 .github/workflows/arm_linux_cmake.yml
+1 −1 .github/workflows/clang_format.yml
+5 −5 .github/workflows/mips_linux_cmake.yml
+29 −0 .github/workflows/power_linux_cmake.yml
+28 −0 .github/workflows/riscv_linux_cmake.yml
+27 −0 .github/workflows/s390x_linux_cmake.yml
+1 −0 .gitignore
+21 −0 .grenrc.yml
+126 −45 BUILD.bazel
+104 −54 CMakeLists.txt
+18 −0 MODULE.bazel
+86 −32 README.md
+3 −22 WORKSPACE
+122 −0 bazel/ci/Makefile
+5 −0 bazel/ci/README.md
+31 −0 bazel/ci/docker/Dockerfile
+0 −11 bazel/platforms.bzl
+0 −66 ci/README.md
+1 −1 cmake/README.md
+22 −12 cmake/ci/Makefile
+40 −0 cmake/ci/README.md
+0 −0 cmake/ci/doc/docker.dot
+0 −0 cmake/ci/doc/docker.svg
+0 −0 cmake/ci/doc/generate_image.sh
+2 −2 cmake/ci/docker/amd64/Dockerfile
+6 −9 cmake/ci/docker/toolchain/Dockerfile
+0 −0 cmake/ci/sample/CMakeLists.txt
+0 −0 cmake/ci/sample/main.cpp
+10 −5 cmake/ci/vagrant/freebsd/Vagrantfile
+148 −3 include/cpu_features_macros.h
+194 −4 include/cpuinfo_aarch64.h
+78 −0 include/cpuinfo_loongarch.h
+19 −5 include/cpuinfo_mips.h
+2 −2 include/cpuinfo_ppc.h
+72 −0 include/cpuinfo_riscv.h
+109 −0 include/cpuinfo_s390x.h
+84 −52 include/cpuinfo_x86.h
+28 −0 include/internal/cpuid_aarch64.h
+107 −0 include/internal/hwcaps.h
+70 −0 include/internal/windows_utils.h
+1 −1 ndk_compat/cpu-features.h
+180 −0 scripts/generate_badges.d
+16 −4 scripts/make_release.sh
+157 −54 scripts/run_integration.sh
+1 −142 src/hwcaps.c
+54 −0 src/hwcaps_freebsd_or_openbsd.c
+157 −0 src/hwcaps_linux_or_android.c
+143 −0 src/impl_aarch64__base_implementation.inl
+40 −0 src/impl_aarch64_cpuid.c
+46 −0 src/impl_aarch64_freebsd_or_openbsd.c
+1 −72 src/impl_aarch64_linux_or_android.c
+90 −0 src/impl_aarch64_macos_or_iphone.c
+137 −0 src/impl_aarch64_windows.c
+90 −0 src/impl_loongarch_linux.c
+9 −4 src/impl_mips_linux_or_android.c
+2 −1 src/impl_ppc_linux.c
+111 −0 src/impl_riscv_linux.c
+121 −0 src/impl_s390x_linux.c
+284 −23 src/impl_x86__base_implementation.inl
+10 −10 src/impl_x86_windows.c
+45 −10 src/utils/list_cpu_features.c
+58 −2 test/CMakeLists.txt
+281 −4 test/cpuinfo_aarch64_test.cc
+12 −0 test/cpuinfo_arm_test.cc
+179 −0 test/cpuinfo_loongarch_test.cc
+53 −1 test/cpuinfo_mips_test.cc
+12 −0 test/cpuinfo_ppc_test.cc
+180 −0 test/cpuinfo_riscv_test.cc
+82 −0 test/cpuinfo_s390x_test.cc
+759 −120 test/cpuinfo_x86_test.cc
2 changes: 1 addition & 1 deletion third_party/cutlass
Submodule cutlass updated 2705 files
2 changes: 1 addition & 1 deletion third_party/googletest
Submodule googletest updated 100 files
2 changes: 1 addition & 1 deletion third_party/spdlog
Submodule spdlog updated 173 files
2 changes: 1 addition & 1 deletion third_party/thrust
Submodule thrust updated 459 files
Loading