-
Notifications
You must be signed in to change notification settings - Fork 260
[spirv] [tracking] SPIR-V lowering #303
Comments
@antiagainst can you please clarify on "Layout decoration utilities", I thought they exist, do I miss something? Thanks. |
Oh, sorry I thought I ticked it... Fixed now. Yes we can have a few more things to do there like supporting more rules but I don't think they are of high priority. They can be added later when needed. I would consider the general utility is there for this reason. Also note that this is a coarse summary right now and expect this to expand. :) We also plan to expand the SPIR-V.md doc to explain more over the lowering internals and instructions on adding an new op lowering. Would highly appreciate your help (as always) on completing the lowering! :) |
Thanks for mention this, I completely forget about different rules for layout, sorry about it.
Sounds great, I would like to help, if it possible. Thanks! |
Feel free to take whatever you are interested and not done. Please create an issue; I'll link it here. Thanks! :) |
Updated to add non-kernel functions and dynamic shapes as not completed items. |
@MaheshRavishankar as far as I understood the lowering from std->spv mostly done by you, in this case can you please share the task which I can start from and you are not working on it? Thanks. |
@denis0x0D : Thanks for picking up some of these tasks. For Std to SPIR-V all except call operation are fairly low hanging fruit. I am not working on this right now. Feel free to pick up any that make sense to you. Thanks! |
@MaheshRavishankar nice, thanks! |
@antiagainst @MaheshRavishankar sorry for delay, is it ok if I'll take some bit and cast op lowering from std to spv? Thanks. |
Sure, please go ahead! |
@antiagainst @MaheshRavishankar can you please clarify on lowering for std.and and std.or, it seems like they have bitwise semantics? Do I miss something? Thanks. |
Oops, yes indeed as shown by llvm/llvm-project@a8a5c06. Good catch! This is a bug that should be fixed. Would you mind to send a PR for it? Thanks! |
What's the bug here. The lowering is only supported for bool. So that should be fine right? |
@MaheshRavishankar oh sorry, you are right, I missed that |
Oops again. Yes @MaheshRavishankar is correct. I commented too quickly... |
@antiagainst @MaheshRavishankar just to note about patches: |
@antiagainst @MaheshRavishankar is it ok if I'll take lowering for |
@denis0x0D: please feel free! But note that control flow is a bit tricky that we'll need to make sure the generated SPIR-V counterpart is structured. Starting from some simple cases is totally fine. |
@antiagainst indeed it's a bit tricky part to |
@antiagainst @MaheshRavishankar oh, I've missed that loop.for is already lowering to spv.loop in GPUToSPIRV part, is it ok if I'll add a lowering loop.if to spv.selection? Thanks. |
Hi @denis0x0D, sorry for the late reply! Yes indeed with MLIR's multi-level capability when we translate from some high-level dialect to SPIR-V we'd prefer to go through a more structured way to preserve information as much as possible, like what you said with loop dialect (and we are doing that). I guess converting from std control flows could still be useful under certain cases (given that we cannot always guarantee the input is some high-level dialect) but it's not a priority with clear use case right now. If you are interested though, you are still very welcome to contribute (starting from simple cases). But yes if you can handle |
@antiagainst thanks for clarification, I'll take lowering |
@antiagainst @MaheshRavishankar just to note a lowering |
Thanks @denis0x0D! for https://reviews.llvm.org/D72836. I've approved it. Yes, please feel free to pick up composite constant lowering. |
@antiagainst thanks a lot! |
@antiagainst @MaheshRavishankar related to composite constant lowering https://reviews.llvm.org/D72999 https://reviews.llvm.org/D73022 |
@antiagainst @MaheshRavishankar according to the task "Pass pipeline to go from linalg to spv", I see that @MaheshRavishankar already added something similiar to IREE iree-org/iree@0200efc is this task still under TODO list for MLIR? |
@denis0x0D: yes it is. the task means to have some recommended pipeline to go from linalg to spv in MLIR core given that from linalg all the components are in MLIR repo. Mahesh and I will be working on this recently to flesh out more details for the pipeline. BTW, I've https://reviews.llvm.org/D73349 to add two more GroupNonUniform* ops. It would be awesome if you can help to flesh out more GroupNonUniform* arithmetic ops after the above CL lands! (I'd assume the ODS definition and parsing/printing/verification code can be reused largely there.) |
@antiagainst thanks for clarification!
SGTM, thanks! |
This is a tracking bug for implementing lowering towards the SPIR-V dialect. It will be periodically updated to provide the current status. Anybody interested in helping is very welcome to pick up tasks here! :)
Common utilities
From GPU dialect
From Std dialect
constant
load
,store
addi
,subi
,muli
divis
,remis
diviu
,remiu
select
return
br
cond_br
call
From Linalg dialect
The text was updated successfully, but these errors were encountered: