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

A pass to add noalias to function arguments, when safe #1081

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

newling
Copy link
Contributor

@newling newling commented Feb 5, 2025

Replaces #1006. From #1006 :

Making the 'C' argument of an outlined matmul (C = A@B) function 'noalias' 
results in much faster code. It brings the outlined code's performance within a 
few percentage of the non-outlined code, for -O2. Using -O3 with outlining is 
still our fastest direct codegen approach, and the program memory usage at 
O3 is still larger than with O2, but with this change at least we can fall back 
to O2+outlining from O3+outlining without seeing as bad a drop in performance 
as before.

This new PR addresses improves #1006 by making a pass that determines when it safe to add noalias rather than expecting the user to enable/disable adding the attribute.

This new PR results in numerical failure on strix, so the pass is disables for strix for now.

@newling newling force-pushed the noalias_take_2 branch 4 times, most recently from 769aa15 to 1b88de4 Compare February 7, 2025 18:17
@newling newling marked this pull request as ready for review February 7, 2025 20:17
void AMDAIENoAliasFunctionArgumentsPass::runOnOperation() {
Operation *op = getOperation();

// TODO(newling): resolve numerical issues on strix.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this an issue with peano and/or chess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so, I'm trying to understand the issue. With peano.

Copy link
Collaborator

@jtuyls jtuyls left a comment

Choose a reason for hiding this comment

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

LGTM

@newling newling merged commit 8f64421 into nod-ai:main Feb 11, 2025
7 checks passed
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