fix(rocm): add MIOpen stability env vars to docker-compose.rocm.yml#865
fix(rocm): add MIOpen stability env vars to docker-compose.rocm.yml#865Xarianne wants to merge 1 commit into
Conversation
Add three environment variables to prevent miopenStatusUnknownError and system stuttering during inference on RDNA4 GPUs: - MIOPEN_USER_DB_PATH: redirect MIOpen kernel cache to writable, persistent dir - MIOPEN_CUSTOM_CACHE_DIR: same, for custom operator cache - MIOPEN_FIND_MODE=FAST: use heuristic kernel selection instead of exhaustive benchmarking, which fails on RDNA4 with ptr: 0 size: 0 workspace warnings MIOPEN_FIND_MODE=FAST does not affect output quality. All MIOpen kernel variants produce the same numerical result; fast mode selects a known-good kernel using heuristics instead of benchmarking every variant on the GPU. Tested on RX 9070 (gfx1201) with ROCm 7.2 and PyTorch 2.12.1+rocm7.2. Hardware note: tested on Ryzen 7 9800X3D + RX 9070 with Gigabyte B650M DS3H motherboard. The exhaustive benchmarking failures may be related to IOMMU behavior on this platform. This system was affected by an IOMMU bug patched upstream in kernel 6.19.10, which may be a contributing factor. May not affect all RDNA4 systems. MIOPEN_FIND_MODE=FAST is a safe default regardless. Depends on PR jamiepine#862 which fixes the broken ROCm Docker build.
📝 WalkthroughWalkthroughAdds three MIOpen-related environment variables to the ROCm Docker Compose override: redirecting the MIOpen user database path and custom cache directory to persistent storage under ChangesROCm MIOpen Environment Configuration
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This PR is the result of extensive testing on an RDNA4 card (RX 9070). As of commit f2cf2a7 Voicebox does not work on Linux with AMD GPUs via Docker. The above changes, combined with the dependency PRs, result in a working Voicebox: fixing build failures, model download failures, and inference failures. I went through existing PRs, made suggestions to existing ones, and added new ones where needed. I can confirm that applying all of the above results in at least a minimum viable product where an RDNA4 card (at least the 9070) can run without issues. |
|
I have just filed an issue upstream about this btw: ROCm/MIOpen#3957 It looks like they had this issue before with RDNA 3 cards, they seem to close the issues but the problem reappears regularly. |
Problem
When running Voicebox with ROCm on RDNA4 GPUs (e.g. RX 9070), inference fails with
miopenStatusUnknownErrorand causes severe system stuttering with repeated MIOpen warnings:Two issues:
miopenStatusUnknownError.ptr: 0 size: 0), causing MIOpen to thrash through failing kernels and stall the GPU.Fix
Add three environment variables to
docker-compose.rocm.yml:MIOPEN_USER_DB_PATHMIOPEN_CUSTOM_CACHE_DIRMIOPEN_FIND_MODE=FASTMIOPEN_FIND_MODE=FASTdoes not affect output quality. All MIOpen kernel variants produce the same numerical result; fast mode simply selects a known-good kernel using heuristics instead of benchmarking every variant on the GPU.Testing
Tested on RX 9070 (gfx1201) with ROCm 7.2 and PyTorch 2.12.1+rocm7.2. Each variable was tested in isolation:
miopenStatusUnknownErroron inferenceMIOPEN_FIND_MODE=FAST: system stuttering during inference, repeated MIOpen workspace warnings on every generation even when cache is presentHardware note
This was tested on a Ryzen 7 9800X3D + RX 9070 with a Gigabyte B650M DS3H motherboard.
Dependencies
This PR depends on several other fixes that must be in place before the MIOpen fixes can be tested or used:
scripts/rocm-entrypoint.shfrom.dockerignore. Without this, the ROCm Docker build is broken because the entrypoint script is excluded from the build context./app/data/cache/, which requires the volume permissions to be correct. See my suggestion on that issue with alternative approach.HSA_OVERRIDE_GFX_VERSIONenvironment variable that docker-compose passes by default. Without this, no GPU is detected at all.Summary by CodeRabbit