No SGEMM backend on CPU despite OpenBLAS installed and CTranslate2 built with -DWITH_OPENBLAS=ON

Aperta
#1,885 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
cpp, python

Direzione di ricerca

Riproduci la build di Ubuntu 24.04 con le opzioni CMake elencate, quindi confronta il percorso funzionante di ct2-translator con il binding Python e lo script faster-whisper. Controlla la ricerca di SGEMM tramite ctypes e i risultati di ldd mentre tracci la selezione del backend a runtime; il lavoro è completato quando il modello CPU float32 viene caricato e trascrive senza “No SGEMM backend on CPU”.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

I’ve rebuilt CTranslate2 from source (v4.6.0) with -DWITH_OPENBLAS=ON for CPU inference using faster-whisper, but consistently hit this runtime error:

RuntimeError: No SGEMM backend on CPU

Despite verifying that OpenBLAS is installed, SGEMM is available, and everything compiles cleanly.

System Info
OS: Ubuntu 24.04
Python: 3.11.12 (venv)
CTranslate2 version: 4.6.0 (built from source)
BLAS: OpenBLAS installed (libopenblas.so.0)
Model: faster-whisper-base from HuggingFace

Reproduction

  1. Built CTranslate2 with:
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_CUDA=OFF -DWITH_MKL=OFF -DWITH_OPENBLAS=ON
make -j$(nproc)

  1. Installed Python bindings:
CMAKE_ARGS="-DCT2_ROOT=$HOME/CTranslate2/build" pip install . --no-build-isolation
  1. Confirmed SGEMM exists in OpenBLAS:
import ctypes
blas = ctypes.cdll.LoadLibrary("libopenblas.so.0")
print(blas.cblas_sgemm)  # Found
  1. Ran a minimal test script:
from faster_whisper import WhisperModel

print("Loading model...")
model = WhisperModel("/home/andre/faster-whisper-models/models--Systran--faster-whisper-base/snapshots/...", device="cpu", compute_type="float32")
print("Model loaded.")
segments, _ = model.transcribe("debug_compare.wav")
  1. Hit this error:
RuntimeError: No SGEMM backend on CPU

Notes

  • `ct2-translator` shows the same model path works.
    
  • OpenBLAS is installed system-wide and `LD_PRELOAD` had no effect.
    
  • `libopenblas.so` is detected in `ldd` of dependent `.so` files.
    

Request
What else can I try to ensure CTranslate2 detects and uses SGEMM from OpenBLAS correctly on CPU?

Thanks in advance.

Lingua principale
C++
Stelle
4.8k
Fork
557
Merge medio
1g 6h
PR unite (30g)
24

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenNMT/CTranslate2

Tutte le issue di OpenNMT/CTranslate2

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.