Skip to content

Refactor Single Loop Fusing Logic#142

Merged
ShangkunLi merged 2 commits intocoredac:mainfrom
ShangkunLi:single-loop-fuse
Oct 7, 2025
Merged

Refactor Single Loop Fusing Logic#142
ShangkunLi merged 2 commits intocoredac:mainfrom
ShangkunLi:single-loop-fuse

Conversation

@ShangkunLi
Copy link
Copy Markdown
Collaborator

We provide a stream-based loop controller here for a single loop.

We embed all the constant loop info as attributes into the loop_control operation, e.g., step, start, end, etc.

This can greatly reduce the fan-ins for loop_control and get better mapping results.

@ShangkunLi ShangkunLi marked this pull request as ready for review October 6, 2025 07:38
@ShangkunLi ShangkunLi requested a review from tancheng October 6, 2025 10:47
@tancheng
Copy link
Copy Markdown
Contributor

tancheng commented Oct 6, 2025

Can we also enable the interpreter to verify the fusion's functionality?

@tancheng tancheng requested review from MeowMJ and itemkelvin October 6, 2025 15:22
@ShangkunLi
Copy link
Copy Markdown
Collaborator Author

Can we also enable the interpreter to verify the fusion's functionality?

Sure~ But can we do it after I finish the experiment evaluation? I may create a new pr about transforming our IR into a steering-control-based manner tomorrow.

Filed an issue about that #143

@tancheng
Copy link
Copy Markdown
Contributor

tancheng commented Oct 6, 2025

I may create a new pr about transforming our IR into a steering-control-based manner tomorrow.

Why we need control-based? I thought this PR's change is for data flow?

@ShangkunLi
Copy link
Copy Markdown
Collaborator Author

I may create a new pr about transforming our IR into a steering-control-based manner tomorrow.

Why we need control-based? I thought this PR's change is for data flow?

Yes, I developed a pass to convert our dataflow ir into steering control ir, like RipTide. It may lay the foundations for a further hybrid execution model~

@ShangkunLi ShangkunLi merged commit 3c3c0bf into coredac:main Oct 7, 2025
1 check passed
@tancheng
Copy link
Copy Markdown
Contributor

tancheng commented Oct 7, 2025

I may create a new pr about transforming our IR into a steering-control-based manner tomorrow.

Why we need control-based? I thought this PR's change is for data flow?

Yes, I developed a pass to convert our dataflow ir into steering control ir, like RipTide. It may lay the foundations for a further hybrid execution model~

So basically two PRs:

  • Verifying loop_control in dataflow fashion via our dataflow interpreter
  • Transform loop_control into steering-based ctrl logic
    • also verify via our ctrl-flow interpreter

Am I right?

@ShangkunLi
Copy link
Copy Markdown
Collaborator Author

So basically two PRs:

  • Verifying loop_control in dataflow fashion via our dataflow interpreter

Correct for this.

  • Transform loop_control into steering-based ctrl logic

    • also verify via our ctrl-flow interpreter

Am I right?

It is to convert all the predicate-based IR into steer-control-based IR, not just the loop_control.

@tancheng
Copy link
Copy Markdown
Contributor

tancheng commented Oct 7, 2025

So basically two PRs:

  • Verifying loop_control in dataflow fashion via our dataflow interpreter

Correct for this.

  • Transform loop_control into steering-based ctrl logic

    • also verify via our ctrl-flow interpreter

Am I right?

It is to convert all the predicate-based IR into steer-control-based IR, not just the loop_control.

one qq, maybe we discussed before. Steering-based sounds like ctrl-flow mixed with dataflow, why do we tune our dataflow into mixed ctrl-flow + dataflow? why not directly lower pure ctrl-flow into steering-based flow?

@ShangkunLi
Copy link
Copy Markdown
Collaborator Author

So basically two PRs:

  • Verifying loop_control in dataflow fashion via our dataflow interpreter

Correct for this.

  • Transform loop_control into steering-based ctrl logic

    • also verify via our ctrl-flow interpreter

Am I right?

It is to convert all the predicate-based IR into steer-control-based IR, not just the loop_control.

one qq, maybe we discussed before. Steering-based sounds like ctrl-flow mixed with dataflow, why do we tune our dataflow into mixed ctrl-flow + dataflow? why not directly lower pure ctrl-flow into steering-based flow?

Oh, we discussed it last Tuesday. If we choose to directly lower from the neura CDFG representation like RipTide, it would be extremely complex as we need to handle many things, including memory access ordering, ensuring transformation completeness, detecting the correct insertion points for steer ops, etc.

And using pattern-matching-based methods to convert current predicate-based ir to the new dataflow ir would be much easier. And, we can guarantee the transformation is complete.

ShangkunLi added a commit that referenced this pull request Mar 12, 2026
Refactor Single Loop Fusing Logic
ShangkunLi added a commit that referenced this pull request Mar 12, 2026
Refactor Single Loop Fusing Logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants