The latest implication of your own real HW limitations into the coding design is this option do not list dynamically across apparatus records: a register file can be generally not be listed dynamically. It is because brand new check in count is restricted and another often must unroll explicitly locate repaired register amounts otherwise go courtesy thoughts. This might be a limitation familiar in order to CUDA coders: when saying a personal float a good ; and you can subsequently indexing having an energetic really worth causes very-named local memories incorporate (i.age. roundtripping to memories).
Implication into codegen ¶
This brings up the results to the fixed versus dynamic indexing discussed in past times: extractelement , insertelement and you will shufflevector on n-D vectors in the MLIR simply assistance fixed indices. Active indicator are only offered into the extremely slight step 1-D vector but not the newest outside (n-1)-D . To other circumstances, direct load / places are required.
- Loops around vector viewpoints are secondary addressing out-of vector beliefs, they must run-on explicit weight / store procedures over n-D vector systems.
- Immediately following a keen letter-D vector type of is piled towards an SSA worthy of (which can or may not reside in letter files, having otherwise as opposed to spilling, when fundamentally paid down), it can be unrolled to less k-D vector models and processes one to correspond to the brand new HW. This level of MLIR codegen is comparable to check in allocation and spilling you to definitely are present much afterwards about LLVM tube.
- HW get support >1-D vectors with intrinsics getting secondary handling in these vectors. These may getting focused as a consequence of explicit vector_shed businesses off MLIR k-D vector models and operations so you can LLVM 1-D vectors + intrinsics.
As an alternative, i believe personally minimizing so you’re able to a beneficial linearized abstraction hides aside the newest codegen intricacies associated with thoughts accesses by giving a bogus feeling from phenomenal dynamic indexing round the files. Alternatively we prefer to make men and women very explicit within the MLIR and you will allow it to be codegen to understand more about tradeoffs. Some other HW will demand other tradeoffs in the systems working in actions step 1., 2. and you can step 3.
Decisions produced from the MLIR top will get effects within a far afterwards stage within the LLVM (once sign in allocation). We really do not imagine to reveal inquiries regarding acting out of check in allowance and spilling so you’re able to MLIR explicitly. Alternatively, for each target will expose some “good” address procedures and you can n-D vector types, for the will cost you one to PatterRewriters within MLIR level was capable target. Particularly will set you back at MLIR peak might be abstract and you may put having ranks, not to own real performance acting. Later including will set you back could be read.
Implication toward Minimizing to help you Accelerators ¶
To target accelerators that support higher dimensional vectors natively, we can start from either 1-D or n-D vectors in MLIR and use vector.cast to flatten the most minor dimensions to 1-D vector
It is the role of an Accelerator-specific vector dialect (see codegen flow in the figure above) to lower the vector.cast . Accelerator -> LLVM lowering would then consist of a bunch of Accelerator -> Accelerator rewrites to perform the casts composed with Accelerator -> LLVM conversions + intrinsics that operate on escort girl Rockford 1-D vector
Some of those rewrites may need extra handling, especially if a reduction is involved. For example, vector.cast %0: vector
However vector.cast %0: vector