[DRAFT] Use owned affine alignment API in the AD affine adjoints - #3116
Draft
wsmoses wants to merge 1 commit into
Draft
[DRAFT] Use owned affine alignment API in the AD affine adjoints#3116wsmoses wants to merge 1 commit into
wsmoses wants to merge 1 commit into
Conversation
Blocked on rebasing to an LLVM where affine.load/store carry an owned alignment (the upstream affine-alignment interface is merged but not yet in our pinned LLVM); will not build until then. Stacked on #3115, which lands the same carries today via the discardable "alignment" attribute. Converts every affine alignment access in the AD affine adjoints from the discardable attribute to the owned interface: reads become affine op getAlignmentAttr(), writes onto a newly-built affine load/store become setAlignmentAttr(). The memref-target writes are already on the owned API and are unchanged. Once affine ops own alignment the discardable "alignment" round-trip (raising -> LowerAlignedAffineAccesses) is no longer needed for these ops. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD
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.
Draft — blocked on the LLVM affine-alignment rebase.
affine.load/affine.storedo not carry an ownedalignmentin our pinned LLVM yet (the upstream affine-alignment interface is merged but not in our pin), sogetAlignmentAttr()/setAlignmentAttr()on affine ops does not compile here. Stacked on #3115 (base is its branch), which lands the same carries today via the discardable"alignment"attribute; this PR migrates them to the proper API for when the rebase is ready.Converts every affine alignment access in the AD affine adjoints (
AffineAutoDiffOpInterfaceImpl.cpp) from the discardable attribute to the owned interface:op->getAttrOfType<IntegerAttr>("alignment")→op.getAlignmentAttr()affine.load/store:op->setAttr("alignment", …)→op.setAlignmentAttr(…)The memref-target writes (the
hasIndexsub-branches and the checkpointingcloneOp) are already on the owned API and are unchanged. Once affine ops own alignment, the discardable"alignment"round-trip (raising →LowerAlignedAffineAccesses) is no longer needed for these ops.Retarget to
mainonce #3115 merges; mark ready once the LLVM pin has affine alignment.🤖 Generated with Claude Code
https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD