Skip to content

Commit c974ddc

Browse files
authored
Build wheels for Python 3.13 and drop support for 3.8 (#1858)
* Build wheels for Python 3.13 and drop support for 3.8 * Sphinx v5.3 * myst-parser v0.18 * ubuntu-20.04 is deprecated * Update libopenmpi3
1 parent 878920e commit c974ddc

File tree

11 files changed

+35
-35
lines changed

11 files changed

+35
-35
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
CT2_VERBOSE: 1
1818
strategy:
1919
matrix:
20-
os: [ubuntu-20.04]
20+
os: [ubuntu-22.04]
2121
backend: [mkl, dnnl]
2222

2323
steps:
@@ -74,7 +74,7 @@ jobs:
7474
7575
7676
build-and-test-cpp-aarch64:
77-
runs-on: ubuntu-20.04
77+
runs-on: ubuntu-22.04
7878
env:
7979
CT2_VERBOSE: 1
8080
strategy:
@@ -132,10 +132,10 @@ jobs:
132132
runs-on: ${{ matrix.os }}
133133
strategy:
134134
matrix:
135-
os: [ubuntu-20.04, windows-2019]
135+
os: [ubuntu-22.04, windows-2019]
136136
arch: [auto64]
137137
include:
138-
- os: ubuntu-20.04
138+
- os: ubuntu-22.04
139139
arch: aarch64
140140
- os: macos-13
141141
arch: arm64
@@ -150,7 +150,7 @@ jobs:
150150
name: Set up QEMU
151151

152152
- name: Build wheels
153-
uses: pypa/cibuildwheel@v2.21.3
153+
uses: pypa/cibuildwheel@v2.22.0
154154
with:
155155
package-dir: python
156156
output-dir: python/wheelhouse
@@ -181,13 +181,13 @@ jobs:
181181
runs-on: ${{ matrix.os }}
182182
strategy:
183183
matrix:
184-
os: [ubuntu-20.04, windows-2019]
184+
os: [ubuntu-22.04, windows-2019]
185185

186186
steps:
187-
- name: Set up Python 3.8
187+
- name: Set up Python 3.9
188188
uses: actions/setup-python@v5
189189
with:
190-
python-version: 3.8
190+
python-version: 3.9
191191

192192
- uses: actions/checkout@v4
193193

@@ -206,13 +206,13 @@ jobs:
206206
- name: Install wheel
207207
if: startsWith(matrix.os, 'ubuntu')
208208
run: |
209-
pip install *cp38*manylinux*x86_64.whl
209+
pip install *cp39*manylinux*x86_64.whl
210210
211211
- name: Install wheel
212212
if: startsWith(matrix.os, 'windows')
213213
shell: bash
214214
run: |
215-
pip install *cp38*win*.whl
215+
pip install *cp39*win*.whl
216216
217217
- name: Run tests
218218
shell: bash
@@ -226,10 +226,10 @@ jobs:
226226
steps:
227227
- uses: actions/checkout@v4
228228

229-
- name: Set up Python 3.8
229+
- name: Set up Python 3.9
230230
uses: actions/setup-python@v5
231231
with:
232-
python-version: 3.8
232+
python-version: 3.9
233233

234234
- name: Install dependencies
235235
run: |
@@ -255,7 +255,7 @@ jobs:
255255
publish-python-wheels-on-pypi:
256256
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
257257
needs: [build-and-test-cpp-x86_64, build-python-wheels, test-python-wheels, check-python-style]
258-
runs-on: ubuntu-20.04
258+
runs-on: ubuntu-22.04
259259

260260
steps:
261261
- name: Download Python wheels
@@ -274,7 +274,7 @@ jobs:
274274

275275

276276
build-and-push-docker-images:
277-
runs-on: ubuntu-20.04
277+
runs-on: ubuntu-22.04
278278
steps:
279279
- uses: actions/checkout@v4
280280
with:
@@ -305,10 +305,10 @@ jobs:
305305
steps:
306306
- uses: actions/checkout@v4
307307

308-
- name: Set up Python 3.8
308+
- name: Set up Python 3.9
309309
uses: actions/setup-python@v5
310310
with:
311-
python-version: 3.8
311+
python-version: 3.9
312312

313313
- name: Download CTranslate2 wheels
314314
uses: actions/download-artifact@v4
@@ -319,7 +319,7 @@ jobs:
319319

320320
- name: Install CTranslate2 wheel
321321
run: |
322-
pip install *cp38*manylinux*x86_64.whl
322+
pip install *cp39*manylinux*x86_64.whl
323323
324324
- name: Install dependencies to build docs
325325
working-directory: docs

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Fixes and improvements
66

77
## [v4.5.0](https://github.com/OpenNMT/CTranslate2/releases/tag/v4.5.0) (2024-10-22)
8-
Note: The Ctranslate2 Python package now supports CUDNN 9 and is no longer compatible with CUDNN 8.
8+
Note: The Ctranslate2 Python package now supports CUDNN 9 and is no longer compatible with CUDNN 8.
99

1010
### New features
1111
* Support Phi3 (#1800)
@@ -18,8 +18,8 @@ Note: The Ctranslate2 Python package now supports CUDNN 9 and is no longer compa
1818
* Update doc AWQ (#1795)
1919

2020
## [v4.4.0](https://github.com/OpenNMT/CTranslate2/releases/tag/v4.4.0) (2024-09-09)
21-
**Removed**: Flash Attention support in the Python package due to significant package size increase with minimal performance gain.
22-
Note: Flash Attention remains supported in the C++ package with the `WITH_FLASH_ATTN` option.
21+
**Removed**: Flash Attention support in the Python package due to significant package size increase with minimal performance gain.
22+
Note: Flash Attention remains supported in the C++ package with the `WITH_FLASH_ATTN` option.
2323
Flash Attention may be re-added in the future if substantial improvements are made.
2424

2525
### New features

docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu20.04 as builder
1+
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04 as builder
22

33
RUN apt-get update && \
44
apt-get install -y --no-install-recommends \
@@ -77,7 +77,7 @@ RUN cd python && \
7777
python3 -m pip --no-cache-dir install -r install_requirements.txt && \
7878
python3 setup.py bdist_wheel --dist-dir $CTRANSLATE2_ROOT
7979

80-
FROM nvidia/cuda:12.2.2-base-ubuntu20.04
80+
FROM nvidia/cuda:12.2.2-base-ubuntu22.04
8181

8282
# We remove the cuda-compat package because it conflicts with the CUDA Enhanced Compatibility.
8383
# See e.g. https://github.com/NVIDIA/nvidia-docker/issues/1515
@@ -86,7 +86,7 @@ RUN apt-get update && \
8686
libcublas-12-2 \
8787
libcudnn8=8.9.7.29-1+cuda12.2 \
8888
libnccl2=2.19.3-1+cuda12.2 \
89-
libopenmpi3=4.0.3-0ubuntu1 \
89+
libopenmpi3=4.1.2-2ubuntu1 \
9090
openmpi-bin \
9191
libgomp1 \
9292
python3-pip \

docker/build_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ build()
4242
fi
4343
}
4444

45-
build Dockerfile ubuntu20.04-cuda12.2
45+
build Dockerfile ubuntu22.04-cuda12.2

docs/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ On Windows [the Visual C++ runtime](https://www.microsoft.com/en-US/download/det
2929
Docker images can be downloaded from the [GitHub Container registry](https://github.com/OpenNMT/CTranslate2/pkgs/container/ctranslate2):
3030

3131
```bash
32-
docker pull ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2
32+
docker pull ghcr.io/opennmt/ctranslate2:latest-ubuntu22.04-cuda11.2
3333
```
3434

3535
The images include:
@@ -40,7 +40,7 @@ The images include:
4040
* the translator executable, which is the image entrypoint:
4141

4242
```bash
43-
docker run --rm ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2 --help
43+
docker run --rm ghcr.io/opennmt/ctranslate2:latest-ubuntu22.04-cuda11.2 --help
4444
```
4545

4646
To update to the new version that supports CUDA 12.

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
myst-parser==0.17.*
1+
myst-parser==0.18.*
22
sphinx-rtd-theme==1.0.*
3-
sphinx==4.5.*
3+
sphinx==5.3.*

docs/translation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The translation client can be used via the Docker image:
4646

4747
```bash
4848
echo "▁H ello ▁world !" | docker run -i --rm -v $PWD:/data \
49-
ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2 --model /data/ende_ctranslate2 --device cpu
49+
ghcr.io/opennmt/ctranslate2:latest-ubuntu22.04-cuda11.2 --model /data/ende_ctranslate2 --device cpu
5050
```
5151

5252
To translate on GPU, use `docker run --gpus all` and set the option `--device cuda`. Use `--help` to see the list of available options.

python/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ def _maybe_add_library_root(lib_name):
8383
"License :: OSI Approved :: MIT License",
8484
"Programming Language :: Python :: 3",
8585
"Programming Language :: Python :: 3 :: Only",
86-
"Programming Language :: Python :: 3.8",
8786
"Programming Language :: Python :: 3.9",
8887
"Programming Language :: Python :: 3.10",
8988
"Programming Language :: Python :: 3.11",
9089
"Programming Language :: Python :: 3.12",
90+
"Programming Language :: Python :: 3.13",
9191
"Topic :: Scientific/Engineering :: Artificial Intelligence",
9292
],
9393
project_urls={
@@ -100,7 +100,7 @@ def _maybe_add_library_root(lib_name):
100100
packages=find_packages(exclude=["bin"]),
101101
package_data=package_data,
102102
ext_modules=[ctranslate2_module],
103-
python_requires=">=3.8",
103+
python_requires=">=3.9",
104104
install_requires=[
105105
"setuptools",
106106
"numpy",

tools/benchmark/opennmt_ende_wmt14/ctranslate2/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM opennmt/ctranslate2:3.6.0-ubuntu20.04-cuda11.2 as model_converter
1+
FROM opennmt/ctranslate2:3.6.0-ubuntu22.04-cuda11.2 as model_converter
22

33
RUN apt-get update && \
44
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
1717
RUN wget -q -P /model https://opennmt-models.s3.amazonaws.com/vmap.txt
1818
RUN cp sentencepiece.model /model
1919

20-
FROM opennmt/ctranslate2:3.6.0-ubuntu20.04-cuda11.2
20+
FROM opennmt/ctranslate2:3.6.0-ubuntu22.04-cuda11.2
2121

2222
COPY --from=model_converter /model /model
2323

tools/benchmark/opus_mt_ende/ctranslate2/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM opennmt/ctranslate2:3.6.0-ubuntu20.04-cuda11.2
1+
FROM opennmt/ctranslate2:3.6.0-ubuntu22.04-cuda11.2
22

33
RUN apt-get update && \
44
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \

0 commit comments

Comments
 (0)