Add AMD ROCm support: AITER attention backend + robust imports + docs#3
Open
ZJLi2013 wants to merge 1 commit intoH-EmbodVis:mainfrom
Open
Add AMD ROCm support: AITER attention backend + robust imports + docs#3ZJLi2013 wants to merge 1 commit intoH-EmbodVis:mainfrom
ZJLi2013 wants to merge 1 commit intoH-EmbodVis:mainfrom
Conversation
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.
Summary
Enable HyDRA to run efficiently on AMD GPUs (ROCm) with optimized attention backends.
Problem
The current attention import guards use
ModuleNotFoundError, which misses partial import failures (e.g. AITER's eager top-level imports). Whenflash-attnis not installed, the code silently falls back to PyTorch SDPA with no diagnostic logging, making it hard to tell which backend is active.Changes
diffsynth/models/wan_video_dit.pyModuleNotFoundError→(ImportError, ModuleNotFoundError)forflash_attn,flash_attn_interface, andsageattentionimportsimportlibto avoid eager import side-effects), slotted between FA3 and FA2 in the dispatch chainREADME.mdDispatch priority
FA3 → AITER → FA2 → SageAttention → PyTorch SDPA (fallback)
No behavior change for NVIDIA users — AITER is only available on ROCm and gracefully skipped otherwise.
Benchmarks (AMD MI300X, ROCm 6.4, FA2 Triton backend)
Test plan
3_concat.mp4