Skip to content

Commit 41eccad

Browse files
authored
Merge branch 'master' into rtx5000_fix
2 parents 45a15c8 + 617405f commit 41eccad

17 files changed

Lines changed: 230 additions & 47 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 19 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,13 +132,15 @@ 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
142+
- os: macos-13
143+
arch: x86_64
142144

143145
steps:
144146
- uses: actions/checkout@v4
@@ -150,14 +152,14 @@ jobs:
150152
name: Set up QEMU
151153

152154
- name: Build wheels
153-
uses: pypa/cibuildwheel@v2.21.3
155+
uses: pypa/cibuildwheel@v2.22.0
154156
with:
155157
package-dir: python
156158
output-dir: python/wheelhouse
157159
env:
158160
CIBW_ENVIRONMENT_PASS_LINUX: CIBW_ARCHS
159161
CIBW_ENVIRONMENT_WINDOWS: CTRANSLATE2_ROOT='${{ github.workspace }}\install'
160-
CIBW_ENVIRONMENT_MACOS: CTRANSLATE2_ROOT='/usr/local'
162+
CIBW_ENVIRONMENT_MACOS: "CTRANSLATE2_ROOT='/usr/local' MACOSX_DEPLOYMENT_TARGET=10.13"
161163
CIBW_BEFORE_ALL_LINUX: python/tools/prepare_build_environment_linux.sh
162164
CIBW_BEFORE_ALL_MACOS: python/tools/prepare_build_environment_macos.sh
163165
CIBW_BEFORE_ALL_WINDOWS: bash python/tools/prepare_build_environment_windows.sh
@@ -181,13 +183,13 @@ jobs:
181183
runs-on: ${{ matrix.os }}
182184
strategy:
183185
matrix:
184-
os: [ubuntu-20.04, windows-2019]
186+
os: [ubuntu-22.04, windows-2019]
185187

186188
steps:
187-
- name: Set up Python 3.8
189+
- name: Set up Python 3.9
188190
uses: actions/setup-python@v5
189191
with:
190-
python-version: 3.8
192+
python-version: 3.9
191193

192194
- uses: actions/checkout@v4
193195

@@ -206,18 +208,18 @@ jobs:
206208
- name: Install wheel
207209
if: startsWith(matrix.os, 'ubuntu')
208210
run: |
209-
pip install *cp38*manylinux*x86_64.whl
211+
pip install *cp39*manylinux*x86_64.whl
210212
211213
- name: Install wheel
212214
if: startsWith(matrix.os, 'windows')
213215
shell: bash
214216
run: |
215-
pip install *cp38*win*.whl
217+
pip install *cp39*win*.whl
216218
217219
- name: Run tests
218220
shell: bash
219221
run: |
220-
pytest -v python/tests/
222+
pytest -v python/tests/ --ignore=python/tests/test_opennmt_tf.py
221223
222224
223225
check-python-style:
@@ -226,10 +228,10 @@ jobs:
226228
steps:
227229
- uses: actions/checkout@v4
228230

229-
- name: Set up Python 3.8
231+
- name: Set up Python 3.9
230232
uses: actions/setup-python@v5
231233
with:
232-
python-version: 3.8
234+
python-version: 3.9
233235

234236
- name: Install dependencies
235237
run: |
@@ -255,7 +257,7 @@ jobs:
255257
publish-python-wheels-on-pypi:
256258
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
257259
needs: [build-and-test-cpp-x86_64, build-python-wheels, test-python-wheels, check-python-style]
258-
runs-on: ubuntu-20.04
260+
runs-on: ubuntu-22.04
259261

260262
steps:
261263
- name: Download Python wheels
@@ -274,7 +276,7 @@ jobs:
274276

275277

276278
build-and-push-docker-images:
277-
runs-on: ubuntu-20.04
279+
runs-on: ubuntu-22.04
278280
steps:
279281
- uses: actions/checkout@v4
280282
with:
@@ -305,10 +307,10 @@ jobs:
305307
steps:
306308
- uses: actions/checkout@v4
307309

308-
- name: Set up Python 3.8
310+
- name: Set up Python 3.9
309311
uses: actions/setup-python@v5
310312
with:
311-
python-version: 3.8
313+
python-version: 3.9
312314

313315
- name: Download CTranslate2 wheels
314316
uses: actions/download-artifact@v4
@@ -319,7 +321,7 @@ jobs:
319321

320322
- name: Install CTranslate2 wheel
321323
run: |
322-
pip install *cp38*manylinux*x86_64.whl
324+
pip install *cp39*manylinux*x86_64.whl
323325
324326
- name: Install dependencies to build docs
325327
working-directory: docs

CHANGELOG.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,23 @@
44

55
### Fixes and improvements
66

7+
## [v4.6.0](https://github.com/OpenNMT/CTranslate2/releases/tag/v4.6.0) (2025-04-08)
8+
Note: The Ctranslate2 Python package now supports python 3.13, drop the support for python 3.8.
9+
10+
### New features
11+
* Pyhton 3.13 support (#1858)
12+
* Support returning hidden vector in Wav2Vec2 and Wav2Vec2Bert Models (#1867)
13+
* Add noexecstack linker flags (#1852 + #1861)
14+
* Support Qwen2 (#1820)
15+
* Eoleconv (#1832)
16+
* Add support RobertModel (#1864)
17+
18+
### Fixes and improvements
19+
* Fix github action (#1871)
20+
* Prevent double library def (#1818)
21+
722
## [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.
23+
Note: The Ctranslate2 Python package now supports CUDNN 9 and is no longer compatible with CUDNN 8.
924

1025
### New features
1126
* Support Phi3 (#1800)
@@ -18,8 +33,8 @@ Note: The Ctranslate2 Python package now supports CUDNN 9 and is no longer compa
1833
* Update doc AWQ (#1795)
1934

2035
## [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.
36+
**Removed**: Flash Attention support in the Python package due to significant package size increase with minimal performance gain.
37+
Note: Flash Attention remains supported in the C++ package with the `WITH_FLASH_ATTN` option.
2338
Flash Attention may be re-added in the future if substantial improvements are made.
2439

2540
### 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/ctranslate2/converters/opennmt_tf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,11 @@ def set_multi_head_attention(self, spec, module, self_attention=False):
291291
def set_layer_norm_from_wrapper(self, spec, module):
292292
self.set_layer_norm(
293293
spec,
294-
module.output_layer_norm
295-
if module.input_layer_norm is None
296-
else module.input_layer_norm,
294+
(
295+
module.output_layer_norm
296+
if module.input_layer_norm is None
297+
else module.input_layer_norm
298+
),
297299
)
298300

299301
def set_layer_norm(self, spec, module):

0 commit comments

Comments
 (0)