Uh oh!
There was an error while loading. Please reload this page.
[SVE] Change the dtype of Ramp and Broadcast lanes to PrimExpr - #16523
Conversation
ekalda
commented
Feb 5, 2024
ekalda
commented
Feb 6, 2024
@tvm-bot rerun |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
tqchen
commented
Feb 6, 2024
if it is not high effort, consider add https://github.com/apache/tvm/blob/main/python/tvm/ir/json_compact.py so previously serialized node can be loaded |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| */ | ||
| inline int GetVectorBytes(DataType dtype) { | ||
| if (dtype.is_scalable()) { | ||
| LOG(FATAL) << "Cannot get vector bytes of scalable vector"; |
There was a problem hiding this comment.
runtime Data type cannot be scalable vector
Uh oh!
There was an error while loading. Please reload this page.
cea202e to
888ad3bCompareekalda
commented
Feb 13, 2024
Thanks @tqchen, @Lunderberg and @lhutton1 for your feedback, I uploaded a reworked version of the patch. Here's what's changed:
|
…imExpr This change will allow us to express scalable vectors through Ramp and Broadcast nodes, e.g. ``` vec = tvm.tir.expr.Ramp(0, 1, 4 * tvm.tir.vscale()) ``` We will use negative values for `runtime::DataType` the encode the scalable lane values, e.g. the above example would result in `lanes` = -4. That's because the lanes in `runtime::DataType` are tied to DLPack standard which uses `uint16_t` for the lanes. The conversion happens in the node definitions and `runtime::DataType`, so the `int` and `uint16_t` values should never be exposed to the API user, especially after the string support has been added. Also include the TVMScript support for scalable Ramp and Broadcasts. Note that this patch doesn't include lowering to the appropriate LLVM vectors, support for data type string representation or `LoopVectorizer` support. All of these will be part of future patches. Co-authored-by: Luke Hutton <luke.hutton@arm.com> Co-authored-by: Neil Hickey <neil.hickey@arm.com>
Change-Id: I8eb77ce5632359b6e4a2e63c4da490e3abab3ee9
* Separate APIs for fixed length and scalable vectors * Improve the function that extracts the multiplier from scalable lanes expression * Update json_compact.py
Fix failures in test_arith_intset.py and test_tvmscript_printer_tir.py
888ad3b to
60e7d83Comparelhutton1
commented
Feb 20, 2024
Thanks @ekalda@tqchen@Lunderberg |
This change will allow us to express scalable vectors through Ramp and Broadcast nodes, e.g.
We will use negative values for
runtime::DataTypethe encode the scalable lane values, e.g. the above example would result inlanes= -4. That's because the lanes inruntime::DataTypeare tied to DLPack standard which usesuint16_tfor the lanes. The conversion happens in the node definitions andruntime::DataType, so theintanduint16_tvalues should never be exposed to the API user, especially after the string support has been added.Also include the TVMScript support for scalable Ramp and Broadcasts.
Note that this patch doesn't include lowering to the appropriate LLVM vectors, support for data type string representation or
LoopVectorizersupport. All of these will be part of future patches.