This repository was archived by the owner on Sep 4, 2025. It is now read-only.
Open
Conversation
Collaborator
hameerabbasi
left a comment
There was a problem hiding this comment.
LGTM -- IIUC the stepper pass has been moved and slightly edited, correct?
Collaborator
Author
|
Yes, there was a minor bug in the stepper pass. I fixed it while moving it. |
hameerabbasi
approved these changes
Mar 20, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 introduces an operation
finch.stepperand a corresponding passfinch-looplet-stepper.It is a reimplemented version of https://github.com/finch-tensor/Finch.jl/blob/main/src/looplets/steppers.jl in Finch.jl
1.
finch.stepperoperationinclude/Finch/FinchOps.tdThis operation defines the Stepper Looplet, which represents repetitive patterns in child looplets.
Stepper takes four function arguments that always return with
finch.return:seek:
coordinate:index -> position:indexReturns the position of the child looplet whose range includes the given input coordinate.
stop:
position:index -> coordinate:indexReturns the coordinate at which the child looplet at the given position ends.
body:
position:index -> child:loopletReturns the child looplet located at the specified position.
next:
position:index -> position:indexReturns the subsequent position following the given position.
finch.stepper seek(crd):pos, stop(pos):crd, body(pos):looplet, next(pos):poscan be thought as a functionExample mlir :
2.
finch-looplet-stepperpassLowers finch.access of finch.stepper inside scf.for
A pseudocode of lowering a single stepper looks like :
to
3. Test cases
You can find tests at https://github.com/finch-tensor/Finch-mlir/blob/b453a57d9193e73ee64f55d60987be51fd30bec0/test/Finch/looplet-stepper.mlir
cmake --build build --target check-finchwill run this test automatically, but if you want to run manually, do :./build/bin/finch-opt ./test/Finch/looplet-stepper.mlir --finch-looplet-stepper