Move hip_fmha op schemas next to their implementations#245
Closed
bottler wants to merge 1 commit intometa-pytorch:mainfrom
Closed
Move hip_fmha op schemas next to their implementations#245bottler wants to merge 1 commit intometa-pytorch:mainfrom
bottler wants to merge 1 commit intometa-pytorch:mainfrom
Conversation
Summary: When `MSLK_BUILD_HIP_FMHA=0`, `attention.cpp` was still compiled into the main library and registered schemas for `efficient_attention_forward_ck`, `efficient_attention_backward_ck`, and `_ck_rand_uniform` via `TORCH_LIBRARY_FRAGMENT`, even though the `TORCH_LIBRARY_IMPL` bindings and kernel implementations (in `mslk_hip_fmha`) were absent. This left unimplemented operators registered in the library — the op appears in the dispatcher but calling it fails. Fix by moving each `m.def` into the same file as its `TORCH_LIBRARY_IMPL`, inside `hip_fmha/`. Since those files are only compiled as part of the `mslk_hip_fmha` static library, schema and implementation now come and go together. The decoder ops remain in `attention.cpp` since their situation differs. Differential Revision: D97933992
|
This pull request has been merged in a271a6d. |
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:
When
MSLK_BUILD_HIP_FMHA=0,attention.cppwas still compiled into the main library and registered schemas forefficient_attention_forward_ck,efficient_attention_backward_ck, and_ck_rand_uniformviaTORCH_LIBRARY_FRAGMENT, even though theTORCH_LIBRARY_IMPLbindings and kernel implementations (inmslk_hip_fmha) were absent. This left unimplemented operators registered in the library — the op appears in the dispatcher but calling it fails.Fix by moving each
m.definto the same file as itsTORCH_LIBRARY_IMPL, insidehip_fmha/. Since those files are only compiled as part of themslk_hip_fmhastatic library, schema and implementation now come and go together. The decoder ops remain inattention.cppsince their situation differs.Differential Revision: D97933992