[SVE] Change the dtype of Ramp and Broadcast lanes to PrimExpr - #16523
Merged
Merged
Conversation
12 tasks
Contributor
Author
Contributor
Author
|
@tvm-bot rerun |
lhutton1
reviewed
Feb 6, 2024
Member
|
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 |
Lunderberg
reviewed
Feb 6, 2024
tqchen
requested changes
Feb 6, 2024
| */ | ||
| inline int GetVectorBytes(DataType dtype) { | ||
| if (dtype.is_scalable()) { | ||
| LOG(FATAL) << "Cannot get vector bytes of scalable vector"; |
Member
There was a problem hiding this comment.
runtime Data type cannot be scalable vector
tqchen
reviewed
Feb 6, 2024
ekalda
force-pushed
the
p2-scalable-ramps2
branch
from
February 13, 2024 16:17
cea202e to
888ad3b
Compare
Contributor
Author
|
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
ekalda
force-pushed
the
p2-scalable-ramps2
branch
from
February 14, 2024 10:25
888ad3b to
60e7d83
Compare
tqchen
approved these changes
Feb 19, 2024
Contributor
|
Thanks @ekalda @tqchen @Lunderberg |
This was referenced Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.