PyTorch CUDA Device Alignment Fix for ACE-Step on RX 9070 XT #1297
EmmanuelWorrell
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
2026-08-16 11:47:34
🚨 PyTorch CUDA Device Alignment Fix for ACE-Step on RX 9070 XT
Problem:
Encountered "Expected all tensors to be on the same device" error when using ACE-Step with mixed CPU/CUDA tensors.
Solution:
I've created PowerShell scripts to automatically fix device alignment issues in the ACE-Step framework. These scripts patch both the generation handler and HuggingFace model cache files.
This occurs because some model components (especially dynamically added ones) are not properly moved to the GPU device.
Solution
Here are two PowerShell scripts that automatically fix the device alignment issue:
01_Patch_GenerationHandler.ps102_Patch_HFModelCache.ps1Installation & Usage
How It Works
Each script:
Verification
After applying both patches:
.BAKbackup files created alongside the modified filesReverting Changes
If you need to revert the changes:
Additional Notes
📜 License
MIT
📝 Notes
📌 Conclusion
These scripts provide a quick fix for the device alignment issue in ACE-Step. For long-term solutions, I recommend implementing the permanent fix in the original repository or reporting this issue to the ACE-Step maintainers for a proper fix in future releases.
Would you like me to explain any specific part of the implementation or add any additional information to this GitHub post?
README
PyTorch CUDA Device Alignment Patch for ACE-Step
This repository provides PowerShell scripts to fix device mismatch errors in the ACE-Step PyTorch implementation.
🚨 Problem
Encounter the following error when running ACE-Step with mixed CPU/CUDA tensors:
💡 Solution
The provided scripts identify and fix the device mismatch by:
📦 Scripts Included
01_Patch_GenerationHandler.ps102_Patch_HFModelCache.ps1⚙️ Prerequisites
📌 Installation & Usage
🔍 How It Works
Each script:
📜 License
MIT
📝 Notes
Would you like me to explain any specific part of the implementation or add any additional information?
ACE-Step Inference Fix SafePatch & BAK Revert.zip
readme.md
All reactions