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

[ROCm] Add pieces from the CUDA codgen lowering path #14769

Merged

Conversation

sogartar
Copy link
Contributor

Enable iree-llvmgpu-cast-address-space-function.
Add DropSharedMemoryDeallocOp rewrite pattern in ConvertToROCDLPass. Remove dynamic legalization for FuncOp.
Add ConvertToDynamicSharedMemory ConvertToROCDLPass.

I am not at all confident that these need to be the same on the ROCm path as are on the CUDA path. If there is no one to express confidence I will dig deeper to make sure it makes sense.

Enable iree-llvmgpu-cast-address-space-function.
Add DropSharedMemoryDeallocOp rewrite pattern in ConvertToROCDLPass.
Remove dynamic legalization for  FuncOp.
Add ConvertToDynamicSharedMemory ConvertToROCDLPass.
// A `dealloc` is converted into a call to `free` on the underlying data buffer.
// The memref descriptor being an SSA value, there is no need to clean it up
// in any way.
struct DropSharedMemoryDeallocOp : public OpRewritePattern<memref::DeallocOp> {
Copy link
Contributor

Choose a reason for hiding this comment

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

THe norm is to not have the pattern exposed directly this way. Could you move these patterns to Common/GPU and use a populateDropSharedMemoryDeallocPatterns method to add these patterns to both paths?

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 moved it.

@sogartar
Copy link
Contributor Author

@MaheshRavishankar, will you rereview this PR?

@qedawkins
Copy link
Contributor

@sogartar is this ready to merge?

@sogartar
Copy link
Contributor Author

sogartar commented Sep 1, 2023

@sogartar is this ready to merge?

It is.

@qedawkins qedawkins merged commit 25c2ab3 into iree-org:main Sep 8, 2023
50 checks passed
jinchen62 pushed a commit to jinchen62/iree that referenced this pull request Sep 18, 2023
Enable iree-llvmgpu-cast-address-space-function.
Add DropSharedMemoryDeallocOp rewrite pattern in ConvertToROCDLPass.
Remove dynamic legalization for FuncOp.
Add ConvertToDynamicSharedMemory ConvertToROCDLPass.

I am not at all confident that these need to be the same on the ROCm
path as are on the CUDA path. If there is no one to express confidence I
will dig deeper to make sure it makes sense.

---------

Co-authored-by: Boian Petkantchin <boian@nod-labs.com>
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.

3 participants