Windows 11 process-exit hang after ROCm Whisper inference with AMD GPU
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
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Ambito
- backend, machine-learning, operating-systems
Direzione di ricerca
Inizia con il riproduttore Python minimo pubblicato e con l'oggetto nativo CTranslate2 Whisper mantenuto da model.model. Analizza la distruzione durante l'arresto dell'interprete Windows per la configurazione AMD/ROCm, confrontandola con il caso CPU segnalato. Il lavoro è completato quando il riproduttore termina normalmente senza impostare manualmente model.model su None.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Windows 11 process-exit hang after ROCm Whisper inference with AMD/ROCm backend
Description
I have encountered a reproducible process-exit hang when using CTranslate2 through faster-whisper with an AMD GPU / ROCm backend on Windows 11.
Whisper model loading and transcription both complete successfully. The Python process then hangs during normal interpreter shutdown when the native CTranslate2 Whisper object remains attached.
As a diagnostic workaround, explicitly detaching the native CTranslate2 object with:
model.model = None
allows the process to terminate normally.
This appears to point to an issue during destruction/finalization of the native CTranslate2 Whisper object or associated ROCm resources.
Environment
- OS: Windows 11 64-bit
- Python: CPython 3.14.4 64-bit
- faster-whisper: 1.2.1
- CTranslate2: 4.8.1
- GPU backend: ROCm / AMD
- faster-whisper model:
tiny - Device:
cuda - Compute type:
float32
The ROCm runtime DLL directory is explicitly added before importing CTranslate2:
import os
os.add_dll_directory(
r"<ROCM_DLL_DIR>"
)
The actual local filesystem path has intentionally been replaced with <ROCM_DLL_DIR> in this report.
What works
The following operations complete successfully:
- Importing CTranslate2
- Creating a
faster-whisperWhisperModel - Loading the
tinymodel - Running Whisper transcription
- Iterating over the generated segments
- Accessing the resulting transcription text
For example, model creation succeeds:
CREATE
READY
and transcription succeeds:
TRANSCRIBE DONE
TEXT LENGTH: 994
The native object is confirmed to be:
<class 'ctranslate2._ext.Whisper'>
Reproduction
The following is a minimal reproducer for the observed behavior:
import os
os.add_dll_directory(
r"<ROCM_DLL_DIR>"
)
from faster_whisper import WhisperModel
print("CREATE")
model = WhisperModel(
"tiny",
device="cuda",
compute_type="float32"
)
print("READY")
segments, info = model.transcribe(
r"<TEST_AUDIO_FILE>"
)
print("TRANSCRIBE DONE")
text = "".join(segment.text for segment in segments).strip()
print("TEXT LENGTH:", len(text))
print("PROCESS END")
Observed output:
CREATE
READY
TRANSCRIBE DONE
TEXT LENGTH: 994
PROCESS END
After PROCESS END, the Python process does not terminate normally and remains stuck.
The transcription itself is already complete at this point.
Important diagnostic observation
The following modification allows the process to terminate normally:
model.model = None
Complete test:
import os
import gc
os.add_dll_directory(
r"<ROCM_DLL_DIR>"
)
from faster_whisper import WhisperModel
print("CREATE")
model = WhisperModel(
"tiny",
device="cuda",
compute_type="float32"
)
print("READY")
segments, info = model.transcribe(
r"<TEST_AUDIO_FILE>"
)
text = "".join(segment.text for segment in segments).strip()
print("TEXT LENGTH:", len(text))
print("DETACH")
model.model = None
print("DETACHED")
gc.collect()
print("GC DONE")
print("NORMAL EXIT")
Observed output:
CREATE
READY
TEXT LENGTH: 994
DETACH
DETACHED
GC DONE
NORMAL EXIT
The process terminates normally.
Further isolation
The faster-whisper object hierarchy was inspected.
The relevant objects are:
MODEL TYPE:
<class 'faster_whisper.transcribe.WhisperModel'>
CT TYPE:
<class 'ctranslate2._ext.Whisper'>
The WhisperModel instance contains the native CTranslate2 Whisper object as:
model.model
Detaching exactly this native object is sufficient to avoid the shutdown hang.
CPU comparison
The same general model-loading operation using the CPU backend does not exhibit the shutdown hang.
For example:
from faster_whisper import WhisperModel
model = WhisperModel(
"tiny",
device="cpu",
compute_type="int8"
)
print("MODEL READY")
followed by normal interpreter termination works correctly.
This suggests that the issue is related to the GPU/ROCm configuration rather than to faster-whisper model creation itself.
CTranslate2 import isolation
Importing CTranslate2 alone also terminates normally:
import ctranslate2
print("CTRANSLATE2 IMPORTED")
Therefore, the issue does not appear to be caused simply by importing the CTranslate2 Python module.
The problematic behavior occurs after creating a native CTranslate2 Whisper object using the ROCm/AMD configuration.
Reproduction boundary
The observed sequence can therefore be summarized as:
Windows 11
+
Python 3.14.4
+
faster-whisper 1.2.1
+
CTranslate2 4.8.1
+
AMD / ROCm
+
WhisperModel("tiny", device="cuda", compute_type="float32")
|
+--> model creation succeeds
|
+--> transcription succeeds
|
+--> transcription result is fully available
|
+--> process shutdown
|
+--> HANG
Whereas:
model.model = None
|
+--> native CTranslate2 Whisper object detached
|
+--> normal interpreter shutdown
|
+--> EXIT
Expected behavior
After successful inference, the Python process should be able to terminate normally and the native CTranslate2/ROCm resources should be released during interpreter shutdown.
Actual behavior
With the AMD/ROCm configuration described above, the process hangs during shutdown while the native CTranslate2 Whisper object remains attached.
Explicitly detaching the native object before shutdown avoids the hang.
Current hypothesis
I do not know the exact root cause.
Based on the isolation tests, the current hypothesis is that the problem occurs during destruction/finalization of the native CTranslate2 Whisper object or associated ROCm resources on Windows.
Possible areas could include:
- GPU resource cleanup
- native worker threads
- synchronization during destruction
- ROCm runtime shutdown
- interaction between CTranslate2 native cleanup and the Windows process shutdown sequence
This is only a hypothesis. The purpose of this report is to provide the reproducible behavior and the minimal diagnostic information for investigation.
Versions
OS: Windows 11 64-bit
Python: 3.14.4 (CPython, 64-bit)
faster-whisper: 1.2.1
CTranslate2: 4.8.1
Model: tiny
Device: cuda
Compute type: float32
Backend: AMD / ROCm
Workaround
Until the underlying issue is identified, explicitly detaching the native CTranslate2 object before interpreter shutdown appears to work as a workaround:
model.model = None
This is currently only being used as a diagnostic/workaround and is not intended as a proposed permanent fix.
Request
Could you please investigate whether the CTranslate2 native Whisper object has a shutdown/destructor issue with the ROCm/AMD backend on Windows?
I can provide additional diagnostic output, package information, or a more minimal reproducer if required.
Thank you for your work on CTranslate2 and for taking the time to investigate this issue.
- Lingua principale
- C++
- Stelle
- 4.8k
- Fork
- 557
- Merge medio
- 1g 6h
- PR unite (30g)
- 24
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OpenNMT/CTranslate2
-
MPS: GPT-2 produces NaN logits and invalid token IDsForse già presa @TBO22 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
OpenNMT/CTranslate2#2154 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Allow no-timestamp Whisper decoding beyond 224 tokensForse già presa @Emre-Akgul l’ha presa 127 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenNMT/CTranslate2#2074 ·
I maintainer di solito rispondono entro 1 giorno
-
T5Gemma fails on MPS: incorrect beam expansion with padded batchesForse già presa @TBO22 l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
OpenNMT/CTranslate2#2153 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
OpenNMT/CTranslate2#2152 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
OpenNMT/CTranslate2#2149 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di OpenNMT/CTranslate2
Issue simili
-
Documentation: Fix parameter markup, legacy branch link, and phrasing in Detachable Joints and Model Command tutorialsForse già presa @patelshivani2283-lab l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Niko1221/Strata#6071 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
KhronosGroup/Vulkan-Tutorial#551 ·
I maintainer di solito rispondono entro 1 giorno