From 2fc7d1301881e4c7211bb9b31ce4f99dcb077457 Mon Sep 17 00:00:00 2001 From: Rin Arakaki Date: Mon, 24 Feb 2025 12:52:31 +0900 Subject: [PATCH 1/5] Build wheels for Python 3.13 and drop support for 3.8 --- .github/workflows/ci.yml | 20 ++++++++++---------- python/setup.py | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82fcfe6d2..8e6dbb85b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,7 +150,7 @@ jobs: name: Set up QEMU - name: Build wheels - uses: pypa/cibuildwheel@v2.21.3 + uses: pypa/cibuildwheel@v2.22.0 with: package-dir: python output-dir: python/wheelhouse @@ -184,10 +184,10 @@ jobs: os: [ubuntu-20.04, windows-2019] steps: - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - uses: actions/checkout@v4 @@ -206,13 +206,13 @@ jobs: - name: Install wheel if: startsWith(matrix.os, 'ubuntu') run: | - pip install *cp38*manylinux*x86_64.whl + pip install *cp39*manylinux*x86_64.whl - name: Install wheel if: startsWith(matrix.os, 'windows') shell: bash run: | - pip install *cp38*win*.whl + pip install *cp39*win*.whl - name: Run tests shell: bash @@ -226,10 +226,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | @@ -305,10 +305,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Download CTranslate2 wheels uses: actions/download-artifact@v4 @@ -319,7 +319,7 @@ jobs: - name: Install CTranslate2 wheel run: | - pip install *cp38*manylinux*x86_64.whl + pip install *cp39*manylinux*x86_64.whl - name: Install dependencies to build docs working-directory: docs diff --git a/python/setup.py b/python/setup.py index 7f56d6074..92d07fa08 100644 --- a/python/setup.py +++ b/python/setup.py @@ -83,11 +83,11 @@ def _maybe_add_library_root(lib_name): "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering :: Artificial Intelligence", ], project_urls={ @@ -100,7 +100,7 @@ def _maybe_add_library_root(lib_name): packages=find_packages(exclude=["bin"]), package_data=package_data, ext_modules=[ctranslate2_module], - python_requires=">=3.8", + python_requires=">=3.9", install_requires=[ "setuptools", "numpy", From bb2d2ee6bb6115096c229a7be7c7605d7e4925d3 Mon Sep 17 00:00:00 2001 From: Rin Arakaki Date: Mon, 24 Feb 2025 17:25:44 +0900 Subject: [PATCH 2/5] Sphinx v5.3 --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index be87cb592..4803345c0 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ myst-parser==0.17.* sphinx-rtd-theme==1.0.* -sphinx==4.5.* +sphinx==5.3.* From 688282de07ddc7edf6f6ec611473ee3632270666 Mon Sep 17 00:00:00 2001 From: rinarakaki Date: Tue, 25 Feb 2025 12:38:17 +0000 Subject: [PATCH 3/5] myst-parser v0.18 --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 4803345c0..7ba5cafef 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ -myst-parser==0.17.* +myst-parser==0.18.* sphinx-rtd-theme==1.0.* sphinx==5.3.* From 9be1ce1c98a4bc571fbc39bb86474649d3056b81 Mon Sep 17 00:00:00 2001 From: Rin Arakaki Date: Mon, 24 Feb 2025 12:59:12 +0900 Subject: [PATCH 4/5] ubuntu-20.04 is deprecated --- .github/workflows/ci.yml | 14 +++++++------- CHANGELOG.md | 6 +++--- docker/Dockerfile | 4 ++-- docker/build_all.sh | 2 +- docs/installation.md | 4 ++-- docs/translation.md | 2 +- .../opennmt_ende_wmt14/ctranslate2/Dockerfile | 4 ++-- .../benchmark/opus_mt_ende/ctranslate2/Dockerfile | 2 +- tools/benchmark/opus_mt_ende/marian/Dockerfile | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e6dbb85b..558348db9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: CT2_VERBOSE: 1 strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-22.04] backend: [mkl, dnnl] steps: @@ -74,7 +74,7 @@ jobs: build-and-test-cpp-aarch64: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: CT2_VERBOSE: 1 strategy: @@ -132,10 +132,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, windows-2019] + os: [ubuntu-22.04, windows-2019] arch: [auto64] include: - - os: ubuntu-20.04 + - os: ubuntu-22.04 arch: aarch64 - os: macos-13 arch: arm64 @@ -181,7 +181,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, windows-2019] + os: [ubuntu-22.04, windows-2019] steps: - name: Set up Python 3.9 @@ -255,7 +255,7 @@ jobs: publish-python-wheels-on-pypi: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') needs: [build-and-test-cpp-x86_64, build-python-wheels, test-python-wheels, check-python-style] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Download Python wheels @@ -274,7 +274,7 @@ jobs: build-and-push-docker-images: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index af6f2b7f8..cc8b72b18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ ### Fixes and improvements ## [v4.5.0](https://github.com/OpenNMT/CTranslate2/releases/tag/v4.5.0) (2024-10-22) -Note: The Ctranslate2 Python package now supports CUDNN 9 and is no longer compatible with CUDNN 8. +Note: The Ctranslate2 Python package now supports CUDNN 9 and is no longer compatible with CUDNN 8. ### New features * Support Phi3 (#1800) @@ -18,8 +18,8 @@ Note: The Ctranslate2 Python package now supports CUDNN 9 and is no longer compa * Update doc AWQ (#1795) ## [v4.4.0](https://github.com/OpenNMT/CTranslate2/releases/tag/v4.4.0) (2024-09-09) -**Removed**: Flash Attention support in the Python package due to significant package size increase with minimal performance gain. -Note: Flash Attention remains supported in the C++ package with the `WITH_FLASH_ATTN` option. +**Removed**: Flash Attention support in the Python package due to significant package size increase with minimal performance gain. +Note: Flash Attention remains supported in the C++ package with the `WITH_FLASH_ATTN` option. Flash Attention may be re-added in the future if substantial improvements are made. ### New features diff --git a/docker/Dockerfile b/docker/Dockerfile index c1d5a47fb..d2a60715f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu20.04 as builder +FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04 as builder RUN apt-get update && \ apt-get install -y --no-install-recommends \ @@ -77,7 +77,7 @@ RUN cd python && \ python3 -m pip --no-cache-dir install -r install_requirements.txt && \ python3 setup.py bdist_wheel --dist-dir $CTRANSLATE2_ROOT -FROM nvidia/cuda:12.2.2-base-ubuntu20.04 +FROM nvidia/cuda:12.2.2-base-ubuntu22.04 # We remove the cuda-compat package because it conflicts with the CUDA Enhanced Compatibility. # See e.g. https://github.com/NVIDIA/nvidia-docker/issues/1515 diff --git a/docker/build_all.sh b/docker/build_all.sh index a84faac9e..7d39189f2 100755 --- a/docker/build_all.sh +++ b/docker/build_all.sh @@ -42,4 +42,4 @@ build() fi } -build Dockerfile ubuntu20.04-cuda12.2 +build Dockerfile ubuntu22.04-cuda12.2 diff --git a/docs/installation.md b/docs/installation.md index 792f9f8bd..2efa0fc39 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -29,7 +29,7 @@ On Windows [the Visual C++ runtime](https://www.microsoft.com/en-US/download/det Docker images can be downloaded from the [GitHub Container registry](https://github.com/OpenNMT/CTranslate2/pkgs/container/ctranslate2): ```bash -docker pull ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2 +docker pull ghcr.io/opennmt/ctranslate2:latest-ubuntu22.04-cuda11.2 ``` The images include: @@ -40,7 +40,7 @@ The images include: * the translator executable, which is the image entrypoint: ```bash -docker run --rm ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2 --help +docker run --rm ghcr.io/opennmt/ctranslate2:latest-ubuntu22.04-cuda11.2 --help ``` To update to the new version that supports CUDA 12. diff --git a/docs/translation.md b/docs/translation.md index f662f46ce..9ff8e8d1d 100644 --- a/docs/translation.md +++ b/docs/translation.md @@ -46,7 +46,7 @@ The translation client can be used via the Docker image: ```bash echo "▁H ello ▁world !" | docker run -i --rm -v $PWD:/data \ - ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2 --model /data/ende_ctranslate2 --device cpu + ghcr.io/opennmt/ctranslate2:latest-ubuntu22.04-cuda11.2 --model /data/ende_ctranslate2 --device cpu ``` To translate on GPU, use `docker run --gpus all` and set the option `--device cuda`. Use `--help` to see the list of available options. diff --git a/tools/benchmark/opennmt_ende_wmt14/ctranslate2/Dockerfile b/tools/benchmark/opennmt_ende_wmt14/ctranslate2/Dockerfile index 09ce5ab69..193cdb442 100644 --- a/tools/benchmark/opennmt_ende_wmt14/ctranslate2/Dockerfile +++ b/tools/benchmark/opennmt_ende_wmt14/ctranslate2/Dockerfile @@ -1,4 +1,4 @@ -FROM opennmt/ctranslate2:3.6.0-ubuntu20.04-cuda11.2 as model_converter +FROM opennmt/ctranslate2:3.6.0-ubuntu22.04-cuda11.2 as model_converter RUN apt-get update && \ apt-get install -y --no-install-recommends \ @@ -17,7 +17,7 @@ RUN ct2-opennmt-py-converter --model_path averaged-10-epoch.pt --output_dir /mod RUN wget -q -P /model https://opennmt-models.s3.amazonaws.com/vmap.txt RUN cp sentencepiece.model /model -FROM opennmt/ctranslate2:3.6.0-ubuntu20.04-cuda11.2 +FROM opennmt/ctranslate2:3.6.0-ubuntu22.04-cuda11.2 COPY --from=model_converter /model /model diff --git a/tools/benchmark/opus_mt_ende/ctranslate2/Dockerfile b/tools/benchmark/opus_mt_ende/ctranslate2/Dockerfile index 5e90a1224..e9d4dcd20 100644 --- a/tools/benchmark/opus_mt_ende/ctranslate2/Dockerfile +++ b/tools/benchmark/opus_mt_ende/ctranslate2/Dockerfile @@ -1,4 +1,4 @@ -FROM opennmt/ctranslate2:3.6.0-ubuntu20.04-cuda11.2 +FROM opennmt/ctranslate2:3.6.0-ubuntu22.04-cuda11.2 RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ diff --git a/tools/benchmark/opus_mt_ende/marian/Dockerfile b/tools/benchmark/opus_mt_ende/marian/Dockerfile index a4a543912..a5e5e0a20 100644 --- a/tools/benchmark/opus_mt_ende/marian/Dockerfile +++ b/tools/benchmark/opus_mt_ende/marian/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:12.2.2-devel-ubuntu20.04 as builder +FROM nvidia/cuda:12.2.2-devel-ubuntu22.04 as builder RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ From 73b5070fcd29b961673339e9c9eef3c3195c6613 Mon Sep 17 00:00:00 2001 From: rinarakaki Date: Tue, 25 Feb 2025 07:36:29 +0000 Subject: [PATCH 5/5] Update libopenmpi3 --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index d2a60715f..1edcdc4ae 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -86,7 +86,7 @@ RUN apt-get update && \ libcublas-12-2 \ libcudnn8=8.9.7.29-1+cuda12.2 \ libnccl2=2.19.3-1+cuda12.2 \ - libopenmpi3=4.0.3-0ubuntu1 \ + libopenmpi3=4.1.2-2ubuntu1 \ openmpi-bin \ libgomp1 \ python3-pip \