Skip to content

Update rocm xformers dockerfile#81

Open
sammysun0711 wants to merge 1 commit into
ROCm:developfrom
sammysun0711:update_rocm_dockerfile
Open

Update rocm xformers dockerfile#81
sammysun0711 wants to merge 1 commit into
ROCm:developfrom
sammysun0711:update_rocm_dockerfile

Conversation

@sammysun0711
Copy link
Copy Markdown

@sammysun0711 sammysun0711 commented Oct 29, 2025

What does this PR do?

This PR aim to fix xformers build issue on ROCm platform with composable kernel support.

  • Update ROCm version from 6.2.2 to 6.4.4 to support minimal pytorch requirement (torch >=2.7.0)
  • Explicit set XFORMERS_CK_FLASH_ATTN=1 and use HIP_ARCHITECTURE instead of HIP_ARCHITECTURES to meet following condition to enable composable kernel during docker build:

    xformers/setup.py

    Lines 576 to 580 in c9911ff

    elif (
    torch.version.hip
    and os.getenv("XFORMERS_CK_FLASH_ATTN", "1") == "1"
    and (torch.cuda.is_available() or os.getenv("HIP_ARCHITECTURE", "") != "")
    ):

BTW, it seems current setup.py can only support compilation on the single target gfx architecture due to different compilation option:

xformers/setup.py

Lines 606 to 613 in c9911ff

if arch == "native":
arch = get_rocm_agent_arch()
if arch not in ["gfx908", "gfx90a", "gfx942", "gfx950"]:
raise ValueError(f"Not supported AMD GPU arch: {arch}")
if arch == "gfx950":
cc_flag += ["-DFMHA_BUILD_ON_GFX950"]

Before submitting

  • Did you have fun?
    • Make sure you had fun coding 🙃
  • Did you read the contributor guideline?
  • Was this discussed/approved via a Github issue? (no need for typos, doc improvements)
    • N/A
  • Did you make sure to update the docs?
    • N/A
  • Did you write any new necessary tests?
    • N/A
  • Did you update the changelog? (if needed)
    • N/A

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant