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

[GEN] Implement GPU to GEN lowering #13427

Merged
merged 4 commits into from
May 16, 2024
Merged

[GEN] Implement GPU to GEN lowering #13427

merged 4 commits into from
May 16, 2024

Conversation

FMarno
Copy link
Contributor

@FMarno FMarno commented Apr 16, 2024

Implements the lowering of the GPU dialect to the GEN dialect where possible.
Currently there are only 6 GEN operations, so the lowering is a bit limited.

Signed-off-by: Finlay Marno [email protected]

Currently the only supported GEN operations are:
* LocalIdOp
* WorkgroupIdOp
* WorkgroupSizeOp
* NumWorkGroupsOp
* BarrierOp
* SubgroupShuffleOp
@sommerlukas sommerlukas requested a review from a team April 16, 2024 13:32
@FMarno
Copy link
Contributor Author

FMarno commented Apr 16, 2024

@etiotto @whitneywhtsang In GPUShuffleToGENLowering, we were a bit unsure what to do with the width argument. GPU to SPIRV lowering checks that the width is constant and equal to the subgroup size, but I don't know if we can check the target information here. Do you have any ideas?

@sommerlukas sommerlukas added the genx Pull requests or issues for genx branch label Apr 16, 2024
Copy link
Contributor

@victor-eds victor-eds left a comment

Choose a reason for hiding this comment

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

Just some minors

mlir/include/mlir/Conversion/GPUToGEN/GPUToGEN.h Outdated Show resolved Hide resolved
mlir/include/mlir/Conversion/Passes.h Outdated Show resolved Hide resolved
mlir/include/mlir/Conversion/Passes.td Outdated Show resolved Hide resolved
mlir/lib/Conversion/GPUToGEN/GPUToGEN.cpp Outdated Show resolved Hide resolved
mlir/lib/Conversion/GPUToGEN/GPUToGEN.cpp Show resolved Hide resolved
@whitneywhtsang
Copy link
Contributor

@etiotto @whitneywhtsang In GPUShuffleToGENLowering, we were a bit unsure what to do with the width argument. GPU to SPIRV lowering checks that the width is constant and equal to the subgroup size, but I don't know if we can check the target information here. Do you have any ideas?

Target information is not currently available in GEN, we can check if it is one of the expected subgroup sizes (16, 32) for now.

@victor-eds
Copy link
Contributor

Target information is not currently available in GEN, we can check if it is one of the expected subgroup sizes (16, 32) for now.

I'd say we keep this as is till we include a way to encode that in the dialect, i.e., an attribute.

@FMarno
Copy link
Contributor Author

FMarno commented May 16, 2024

I'm just going to merge this for now, hopefully #13640 will gain traction and a proper solution for the subgroup shuffles can be found.

@FMarno FMarno merged commit e7d7250 into intel:genx May 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
genx Pull requests or issues for genx branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants