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

Expand from write nodes inside reductions #395

Merged
merged 4 commits into from
Jan 22, 2025

Conversation

GMNGeoffrey
Copy link
Contributor

Right now, it only looks at write nodes in the root graph and misses ones in reductions. Instead we walk all the regions for Write nodes and GetResult nodes without users.

get_leaf_node_types also appeared to always return [Write] as it sets leaf_nodes to that and then immediately checks if it's empty, which it never will be, so I deleted it.

Also includes some .gitignore additions that I can drop if you don't like them.

Fixes #374

@GMNGeoffrey GMNGeoffrey changed the title gitignore vscode workspaces and out/ directory Expand from write nodes inside reductions Jan 18, 2025
@GMNGeoffrey
Copy link
Contributor Author

I actually signed the commits with my ssh key, but it looks like it's not accepting that.

I'm surprised the vscode workspace wasn't already in there, as I think
that's the typical place to put it. I think it's generally useful to
have a place to put output files (and the MLIR dumps should probably go
there by default). I can drop these though.

Signed-off-by: Geoffrey Martin-Noble <[email protected]>
Right now, it only looks at write nodes in the root graph and misses
ones in reductions. Instead we walk all the regions for `Write` nodes
and `GetResult` nodes without users.

`get_leaf_node_types` also appeared to always return `[Write]` as it
sets `leaf_nodes` to that and then immediately checks if it's empty,
which it never will be, so I deleted it.

Signed-off-by: Geoffrey Martin-Noble <[email protected]>
@GMNGeoffrey
Copy link
Contributor Author

@harsh-nod PTAL

@ScottTodd
Copy link
Member

I actually signed the commits with my ssh key, but it looks like it's not accepting that.

DCO allows signing (instead of sign-off) for organization members. I've sent you an invite to iree-org + the iree-triage team. That will also let checks run without approval.

IREE docs: https://iree.dev/developers/general/contributing/#developer-certificate-of-origin
DCO docs: https://github.com/dcoapp/app?tab=readme-ov-file#skipping-sign-off-for-organization-members

Copy link
Contributor

@harsh-nod harsh-nod left a comment

Choose a reason for hiding this comment

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

thanks, this looks good! Could you add a lit test with a write inside a reduction in expansion to make sure that this works properly?

iree/turbine/kernel/wave/expansion/expansion.py Outdated Show resolved Hide resolved
@GMNGeoffrey
Copy link
Contributor Author

Added tests. PTAL

@GMNGeoffrey GMNGeoffrey requested a review from harsh-nod January 22, 2025 00:46
Confirmed this fails on main and succeeds with my change.
The thing I was doing here actually failed because apparently _node_list
isn't an iterator, so switched to looking at `_root.prev`, althoug
I'm a bit leery of using a private member here.
@GMNGeoffrey
Copy link
Contributor Author

The failing test doesn't seem related to my change and passes on my local mi210. It's also a numerical diff on a check that already has rtol set to 0.8, which suggests to me that it's already broken and should probably be xfailed or skipped...

@harsh-nod
Copy link
Contributor

The failing test doesn't seem related to my change and passes on my local mi210. It's also a numerical diff on a check that already has rtol set to 0.8, which suggests to me that it's already broken and should probably be xfailed or skipped...

Yes we have flaky attention tests that need to be debugged, but you can just retrigger for now.

Copy link
Contributor

@harsh-nod harsh-nod left a comment

Choose a reason for hiding this comment

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

lgtm! thanks!

@Hardcode84 Hardcode84 merged commit f133435 into iree-org:main Jan 22, 2025
9 of 10 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.

[TKW] Bug: gemm write inside of unrelated reduction writes incorrect value
4 participants