Repository navigation
Conversation
MIOpen on Windows ROCm for RDNA2 (gfx103x) cannot JIT-compile the LSTM and InstanceNorm kernels used by Kokoro, so generation fails with miopenStatusUnknownError. Route Kokoro generation through PyTorch's native GPU fallbacks for this configuration only, and restore the flag afterwards. Other platforms and engines are unaffected.
itxtoledo
force-pushed
the
fix/kokoro-windows-rocm-miop
branch
from
October 20, 2026 13:51
863a2e5 to
070de29
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows with ROCm on RDNA2 GPUs (
gfx103x, e.g. RX 6650 XT /gfx1032), Kokoro generation fails because MIOpen cannot JIT-compile the RNN and InstanceNorm kernels used by the model:The failure happens in Kokoro's text encoder (LSTM) and in its InstanceNorm layers, so the request aborts before producing audio.
Fix
Detect Windows + ROCm +
gfx103xinkokoro_backend.pyand temporarily disabletorch.backends.cudnn.enabledfor the duration of the Kokoro generation. On ROCm this routes RNN / InstanceNorm / convolution through PyTorch's native implementations, which still run on the GPU, instead of MIOpen. The previous value is restored in afinallyblock.A module-level lock serializes Kokoro generations on this path so concurrent requests cannot restore the flag mid-generation.
The fallback is strictly scoped:
sys.platform == "win32")torch.version.hip is not None)gcnArchNamestarts withgfx103)CUDA, CPU, Linux ROCm, and other GPU architectures are unaffected.
Testing
gfx1032, 8 GB)torch 2.14.0+rocm10.1.0pf_dora, pt-BR, textOlá mundomiopenStatusUnknownErrorThis change does not touch the ROCm build or runtime. It fixes the MIOpen op failure once the runtime can enumerate the GPU. On this GPU, ROCm 7.2.1 currently crashes during device enumeration (a separate AMD issue), so the test was done with ROCm 10.1.
Changes
backend/backends/kokoro_backend.py