Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New lock allocator for bf16 element wise fusion #573

Conversation

erwei-xilinx
Copy link
Collaborator

No description provided.

@erwei-xilinx erwei-xilinx changed the title New lock allocator for bf16 peeling New lock allocator for bf16 element wise fusion May 11, 2024
Comment on lines +2629 to +2640
} else if (need_unlock && readInRAW) {
if (t->getPrevNode() && isa<AIE::UseLockOp>(t->getPrevNode())) {
auto prevLockUse = dyn_cast<AIE::UseLockOp>(t->getPrevNode());
mergePrevLockUse(prevLockUse, lockRelValue);
}
auto br = dyn_cast<cf::BranchOp>(readInRAW->getBlock()->getTerminator());
if (br)
builder.setInsertionPointToStart(br.getDest());
else
builder.setInsertionPointToStart(readInRAW->getBlock());
builder.create<AIE::UseLockOp>(builder.getUnknownLoc(), relLockOp,
AIE::LockAction::Release, lockRelValue);
Copy link
Collaborator

@fifield fifield May 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit convoluted with all the conditionals and the calls to getReadInRAW and mergePrevLockUse. Do you have an example of the IR you're trying to match and replace here? Does the merge work for AIE1 locks? Or if the get and put are in the same block?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a prototype of a new lock allocator. The goal here is to have the elementwise fusion example (the new board test 12) work on npu, where the challenge is that the same accumulator buffer has (1) dada copied in,(2) compute on and (3) data copied out.

Although the new board test seems to pass with the pr, it seems to be too complicated and not compatible with a number of existing tests, or AIE1. So I think I'll close the PR and find another solution.

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