Package Details: ctranslate2 4.5.0-1

Git Clone URL: https://aur.archlinux.org/ctranslate2.git (read-only, click to copy)
Package Base: ctranslate2
Description: A C++ library for efficient inference with Transformer models.
Upstream URL: https://opennmt.net/CTranslate2
Licenses: MIT
Provides: libctranslate2.so
Submitter: yochananmarqos
Maintainer: yochananmarqos
Last Packager: yochananmarqos
Votes: 3
Popularity: 0.99
First Submitted: 2023-12-10 15:32 (UTC)
Last Updated: 2024-10-24 19:00 (UTC)

Pinned Comments

yochananmarqos commented on 2024-10-24 19:03 (UTC)

PSA: I just enabled OPENBLAS, but I had to disable both MKL and DNNL to do it. Please let me know how that goes.

Latest Comments

yochananmarqos commented on 2024-11-14 18:55 (UTC)

@xuiqzy: Disable debug in your makepkg.conf.

xuiqzy commented on 2024-11-14 01:38 (UTC)

Fails to build. Full output on https://pastebin.com/Gi65MfCP End of output:

/usr/bin/ld: CMakeFiles/ctranslate2.dir/kernels_avx2.cc.o: in function `float ctranslate2::cpu::reduce_logsumexp<(ctranslate2::cpu::CpuIsa)2>(float const*, long)':
/usr/src/debug/ctranslate2/build/kernels_avx2.cc:376: multiple definition of `float ctranslate2::cpu::reduce_logsumexp<(ctranslate2::cpu::CpuIsa)2>(float const*, long)'; CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:/usr/src/debug/ctranslate2/CTranslate2/src/cpu/kernels.cc:376: first defined here
/usr/bin/ld: CMakeFiles/ctranslate2.dir/kernels_avx2.cc.o: in function `void ctranslate2::cpu::softmax<(ctranslate2::cpu::CpuIsa)2>(float const*, int const*, float*, long, long, bool)':
/usr/src/debug/ctranslate2/build/kernels_avx2.cc:408: multiple definition of `void ctranslate2::cpu::softmax<(ctranslate2::cpu::CpuIsa)2>(float const*, int const*, float*, long, long, bool)'; CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:/usr/src/debug/ctranslate2/CTranslate2/src/cpu/kernels.cc:408: first defined here
/usr/bin/ld: CMakeFiles/ctranslate2.dir/kernels_avx2.cc.o: in function `void ctranslate2::cpu::layer_norm<(ctranslate2::cpu::CpuIsa)2>(float const*, float const*, float const*, float*, long, long, float)':
/usr/src/debug/ctranslate2/build/kernels_avx2.cc:469: multiple definition of `void ctranslate2::cpu::layer_norm<(ctranslate2::cpu::CpuIsa)2>(float const*, float const*, float const*, float*, long, long, float)'; CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:/usr/src/debug/ctranslate2/CTranslate2/src/cpu/kernels.cc:469: first defined here
/usr/bin/ld: CMakeFiles/ctranslate2.dir/kernels_avx2.cc.o: in function `void ctranslate2::cpu::layer_norm_axis<(ctranslate2::cpu::CpuIsa)2>(float const*, float const*, float const*, float*, long, long, long, float)':
/usr/src/debug/ctranslate2/build/kernels_avx2.cc:506: multiple definition of `void ctranslate2::cpu::layer_norm_axis<(ctranslate2::cpu::CpuIsa)2>(float const*, float const*, float const*, float*, long, long, long, float)'; CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:/usr/src/debug/ctranslate2/CTranslate2/src/cpu/kernels.cc:506: first defined here
/usr/bin/ld: CMakeFiles/ctranslate2.dir/kernels_avx2.cc.o: in function `void ctranslate2::cpu::rms_norm<(ctranslate2::cpu::CpuIsa)2>(float const*, float const*, float*, long, long, float, bool)':
/usr/src/debug/ctranslate2/build/kernels_avx2.cc:550: multiple definition of `void ctranslate2::cpu::rms_norm<(ctranslate2::cpu::CpuIsa)2>(float const*, float const*, float*, long, long, float, bool)'; CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:/usr/src/debug/ctranslate2/CTranslate2/src/cpu/kernels.cc:550: first defined here
/usr/bin/ld: CMakeFiles/ctranslate2.dir/kernels_avx2.cc.o: in function `void ctranslate2::cpu::quantize_s8<(ctranslate2::cpu::CpuIsa)2>(float const*, signed char*, float*, long, long, bool, bool)':
/usr/src/debug/ctranslate2/build/kernels_avx2.cc:646: multiple definition of `void ctranslate2::cpu::quantize_s8<(ctranslate2::cpu::CpuIsa)2>(float const*, signed char*, float*, long, long, bool, bool)'; CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:/usr/src/debug/ctranslate2/CTranslate2/src/cpu/kernels.cc:646: first defined here
/usr/bin/ld: CMakeFiles/ctranslate2.dir/kernels_avx2.cc.o: in function `void ctranslate2::cpu::dequantize_gemm_output<(ctranslate2::cpu::CpuIsa)2>(int const*, float const*, float const*, long, long, float*, float const*, ctranslate2::ops::ActivationType const*)':
/usr/src/debug/ctranslate2/build/kernels_avx2.cc:732: multiple definition of `void ctranslate2::cpu::dequantize_gemm_output<(ctranslate2::cpu::CpuIsa)2>(int const*, float const*, float const*, long, long, float*, float const*, ctranslate2::ops::ActivationType const*)'; CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:/usr/src/debug/ctranslate2/CTranslate2/src/cpu/kernels.cc:732: first defined here
/usr/bin/ld: CMakeFiles/ctranslate2.dir/kernels_avx2.cc.o: in function `void ctranslate2::cpu::gelu<(ctranslate2::cpu::CpuIsa)2>(float const*, float*, long)':
/usr/src/debug/ctranslate2/build/kernels_avx2.cc:240: multiple definition of `void ctranslate2::cpu::gelu<(ctranslate2::cpu::CpuIsa)2>(float const*, float*, long)'; CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:/usr/src/debug/ctranslate2/CTranslate2/src/cpu/kernels.cc:240: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/ctranslate2.dir/build.make:2242: libctranslate2.so.4.5.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:391: CMakeFiles/ctranslate2.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

yochananmarqos commented on 2024-10-24 19:03 (UTC)

PSA: I just enabled OPENBLAS, but I had to disable both MKL and DNNL to do it. Please let me know how that goes.

AlD commented on 2024-06-04 20:53 (UTC)

Needs a patch like this for the time being:

diff --git a/PKGBUILD b/PKGBUILD
index 1b97483..b9ccaba 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -15,6 +15,7 @@ makedepends=(
   'cmake'
   'cuda'
 #  'cudnn'
+  'gcc13'
   'git'
   'intel-oneapi-mkl'
   'onednn'
@@ -87,6 +88,7 @@ build() {
   # Enabling both WITH_DNNL and WITH_OPENBLAS is broken
   # https://github.com/OpenNMT/CTranslate2/issues/1294

+  export CC=gcc-13 CXX=g++-13
   cmake -B build -S CTranslate2 \
     -DCMAKE_BUILD_TYPE='Release' \
     -DCMAKE_INSTALL_PREFIX='/usr' \

arzeth commented on 2024-04-27 18:55 (UTC) (edited on 2024-04-27 22:36 (UTC) by arzeth)

First, there should be -DWITH_CUDNN="${WITH_CUDNN:-OFF}" \\ otherwise there's a warning. Probably the same with WITH_OPENBLAS.

Second, I had an error:

/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include/amxtileintrin.h(42): error: identifier "__builtin_ia32_ldtilecfg" is undefined

because of https://github.com/gcc-mirror/gcc/commit/2b3ecdf4fb13471b69d80583e10c5baedfe84d7c in gcc 13.2.1 which changed 2 lines.

So I had to use 13.2.0's amxtileintrin.h

sudo wget https://raw.githubusercontent.com/gcc-mirror/gcc/83ffe9cde7fe0b4deb0d1b54175fd9b19c38179c/gcc/config/i386/amxtileintrin.h -O /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include/amxtileintrin.h.13.2.0 && \
sudo mv /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include/amxtileintrin.h{,.13.2.1} && \
sudo ln -s /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include/amxtileintrin.h{.13.2.0,}

Then I had the linking problem ("multiple definitions" in kernels{,_avx,_avx2,_avx512}.cc), which I fixed by removing -march from /etc/makepkg.conf. But it compiled successfully with just -mtune=native instead (BTW, -march=X implies -mtune=X).

Also I tuned -DCUDA_ARCH_LIST='Common' to '7.5' because /opt/cuda/extras/demo_suite/deviceQuery says my GPU's "CUDA Capability version" is 7.5; this sped up compilation by ~30 minutes (Ryzen 5 2600), and saved 415 MiB of space.

wyrmku commented on 2024-04-10 22:09 (UTC)

if any parents of the build director has a space in it, fails with `/usr/bin/cc is not able to compile a simple test program.``

yochananmarqos commented on 2024-04-02 14:21 (UTC)

@acgtyrant: I'm not sure exactly why the tests fail, that's why they're disabled currently.

acgtyrant commented on 2024-04-02 06:36 (UTC)

Hello, I am trying to determine whether I built ctranslate2 with cuDNN succesfully. However after I added -DBUILD_TESTS='ON' and uncommented the check function, a failure occured in check():

==> Starting check()...
/var/cache/private/pikaur/build/ctranslate2/PKGBUILD: line 125: ./tests/ctranslate2_test: No such file or directory

I appreciate your reading and help!