mirror of
https://github.com/Comfy-Org/comfy-aimdo.git
synced 2026-11-04 23:37:21 +00:00
[PR #2] [CLOSED] [DRAFT] Barebones ROCM support #53
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-aimdo#53
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-aimdo/pull/2
Author: @asagi4
Created: 2/5/2026
Status: ❌ Closed
Base:
master← Head:hack/rocm-support📝 Commits (10+)
639124dAdd platform-specific defines to enable compilation with HIP659b3dcHIP async support needs access to the original functions on Linux3bff535Simultaneous cuda+rocm supportd53839bAssume nvidia if autodetection fails34557d9ROCm build scripta81e95fHIP: Windows support349e73bAdd Windows ROCm build script7421008Safely handle lib cleanup in model_vbarc6b8f27Improve validation and error handling in Windows ROCm build scriptfaea564Fix windows build script📊 Changes
15 files changed (+310 additions, -22 deletions)
View changed files
📝
.gitignore(+4 -0)➕
build-rocm-local(+6 -0)➕
build-rocm-local_win.ps1(+65 -0)📝
comfy_aimdo/control.py(+57 -6)📝
comfy_aimdo/model_vbar.py(+2 -1)📝
pyproject.toml(+1 -1)➕
src-posix/detour-hip.c(+42 -0)📝
src-posix/model-mmap.c(+1 -1)📝
src-win/cuda-detour.c(+22 -4)📝
src-win/shmem-detect.c(+24 -1)📝
src/model-vbar.c(+1 -0)📝
src/plat.h(+9 -7)➕
src/plat_cuda.h(+7 -0)➕
src/plat_hip.h(+63 -0)📝
src/vrambuf.c(+6 -1)📄 Description
Contribution Agreement
This is not really intended for merging as is, but for reference. hipify-clang can convert the CUDA code to HIP code pretty easily with a few fixes, and it actually allows you to run aimdo on ROCM.
You might have to make sure your Python venv is using your system ROCM libraries for this to work.
It does not work perfectly (I'm still getting pytorch OOMs when it should be freeing memory) but workflows can run and produce good output.
I am not able to test, but the HIP code should be compilable as is on nvidia platforms too. If you run build-rocm on an nvidia platform, hipcc and hipconfig should set it up to link against cuda instead of ROCM and the result should be basically identical to the CUDA implementation.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.