[skip ci] libtorch agnostic FA3 north star proposal #1685
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.
This PR denotes the changes we would make to make FA3 libtorch agnostic if all the torch stable APIs were in place (today they are not!!!). This PR is not meant to be buildable and I've skipped CI for that reason.
To define terminology, we say a custom op library is libtorch agnostic if you can switch out the libtorch version without needing to rebuild the custom op kernels. For example, FA3 built for libtorch version 2.8 would be able to run without needing to rebuild in an environment with libtorch 2.9.
This exercise was to help me determine what sort of APIs torch should support in a stable manner and how (standalone = header only and thus libtorch free, stable = ABI stable and thus libtorch agnostic). I am also hoping to get feedback from @tridao regarding whether these code changes look sufficiently acceptable to achieve libtorch agnosticism.
I've summarized these changes into categories in this GDoc: https://docs.google.com/document/d/1hL-pMgmsj8YlEmZOdbRqW0yfwHyPlJ8usn0xW_GqjFA/edit?tab=t.0