Ctranslate2 on RaspberryPi 4

My question is for the support of Ctranslate2 on Raspberry Pi 4.
Also, for just to know, do ctranslate2 is only for Intel hardwares as it depends on Intel’s MKL lib.

CTranslate2 can now be compiled for ARM processors. You should disable Intel MKL and select a backend that is optimized for ARM such as OpenBLAS:

Note that the published binaries (Python packages and Docker images) are optimized for x86-64 processors (Intel, AMD, etc.) and will not run on ARM.

As you can see in the link above, Intel MKL is not the only supported library.

1 Like

For reference, version 2.11 added Python wheels for AArch64 platforms (a.k.a. ARM64).

So the installation is simplified to:

pip install ctranslate2
2 Likes

Hi, I am also trying to compile on arm (pi 4 4 gig with 64 bits architecture). Only I met two problems, the first one is that even with

cmake -DWITH_MKL=OFF -OPENMP_RUNTIME=NONE -DWITH_CUDA=OFF ..

Ctranslate2 tries to use it. This was causing this error:
Intel OpenMP runtime libiomp5 not found
I solved this problem by deleting this part from the cmakelist file. However, when compiling, I get this error:

/home/pi/CTranslate2/src/cpu/primitives.cc:1051:3: required from here
/home/pi/CTranslate2/src/cpu/primitives.cc:241:21: error: 'CPU_ISA_DISPATCH' was not declared in this scope
     CPU_ISA_DISPATCH((cpu::mul<ISA>(a, b, c, size)));
     ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/CTranslate2/src/cpu/primitives.cc:241:21: note: suggested alternative: 'CPU_ISA_DEFAULT'
     CPU_ISA_DISPATCH((cpu::mul<ISA>(a, b, c, size)));
     ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     CPU_ISA_DEFAULT
make[2]: *** [CMakeFiles/ctranslate2.dir/build.make:167: CMakeFiles/ctranslate2.dir/src/cpu/primitives.cc.o] Error 1
make[2]: *** Waiting for unfinished tasks....
make[1]: *** [CMakeFiles/Makefile2:115: CMakeFiles/ctranslate2.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Do you know what this is due to?

There is a typo in your CMake command line. This option should be:

-DOPENMP_RUNTIME=NONE

Do you plan to use the Python or C++ API? For Python, it is no longer needed to manually compile the project, as indicated in the post just above:

1 Like

Okay, it was for the 32 bits architecture that I try to compile, thanks for your answer!
I will use my raspberry pi 4. (compiling for a raspberry pi 3 gives the error above)

1 Like

Yes, 32-bit systems are not supported.