[CK_TILE] Fix Windows build in FMHA head grouping#5977
[CK_TILE] Fix Windows build in FMHA head grouping#5977brockhargreaves-amd merged 2 commits intodevelopfrom
Conversation
|
@brockhargreaves-amd This PR will fix the Windows build. Could you take a look? |
|
Windows Strix Halo should support this, no? |
|
This PR was created after building FlashAttention 2's CK backend on Windows. @astrelsky, do you think these changes are also necessary, or are the ones in this PR sufficient? We could get this one merged instead since @brockhargreaves-amd is already here. |
Yes it should support Windows Strix Halo. I think the previous CI error is coming from the other component like miopen, not related to this pr. |
|
@hyoon1 Thanks for your work on Dao-AILab/flash-attention#2400 and #5018 as well! Also, thx to the maintainers for the reviews. After this PR is merged, the only remaining blocker for building FlashAttention's CK backend on Windows will be pypa/distutils#406. |
[CK_TILE] Fix Windows build in FMHA head grouping ## Motivation This is a follow-up fix for [PR #5018](ROCm/rocm-libraries#5018). [PR #5018](ROCm/rocm-libraries#5018) added LLC-aware FMHA head grouping / head-major scheduling on RDNA, but it also introduced Linux-only code paths, including `<dirent.h>`, which break Windows builds. This change fixes that by guarding the Linux-specific LLC probing logic so non-Linux platforms can still build correctly. ## Technical Details - Guard `<dirent.h>` with `#ifdef __linux__` - Guard KFD sysfs traversal logic with `#if defined(__linux__)` - On non-Linux platforms, return `0` from `get_kfd_sysfs_llc_cache_bytes()` - Preserve existing fallback behavior through: - `CK_TILE_FMHA_LLC_CACHE_MB` - arch-based default LLC sizes - no head grouping when no LLC size can be resolved ## Test Plan <!-- Explain any relevant testing done to verify this PR. --> ## Test Result <!-- Briefly summarize test outcomes. --> ## Submission Checklist - [ ] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
## Motivation This is a follow-up fix for [PR #5018](#5018). [PR #5018](#5018) added LLC-aware FMHA head grouping / head-major scheduling on RDNA, but it also introduced Linux-only code paths, including `<dirent.h>`, which break Windows builds. This change fixes that by guarding the Linux-specific LLC probing logic so non-Linux platforms can still build correctly. ## Technical Details - Guard `<dirent.h>` with `#ifdef __linux__` - Guard KFD sysfs traversal logic with `#if defined(__linux__)` - On non-Linux platforms, return `0` from `get_kfd_sysfs_llc_cache_bytes()` - Preserve existing fallback behavior through: - `CK_TILE_FMHA_LLC_CACHE_MB` - arch-based default LLC sizes - no head grouping when no LLC size can be resolved ## Test Plan <!-- Explain any relevant testing done to verify this PR. --> ## Test Result <!-- Briefly summarize test outcomes. --> ## Submission Checklist - [ ] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
Motivation
This is a follow-up fix for PR #5018.
PR #5018 added LLC-aware FMHA head grouping / head-major scheduling on RDNA, but it also introduced Linux-only code paths, including
<dirent.h>, which break Windows builds. This change fixes that by guarding the Linux-specific LLC probing logic so non-Linux platforms can still build correctly.Technical Details
<dirent.h>with#ifdef __linux__#if defined(__linux__)0fromget_kfd_sysfs_llc_cache_bytes()CK_TILE_FMHA_LLC_CACHE_MBTest Plan
Test Result
Submission Checklist