cbalint13 commented on PR #15918:
URL: https://github.com/apache/tvm/pull/15918#issuecomment-1764839468
> ```
> idx_vec = T.allocate_const([0, 1, 4, 5, 2, 3, 6, 7], "int32")
> tir.vectorpermute("int32x8", whatever_vector, idx_vec)
> ```
>
> is not more complex in my opinion :) I appreciate the convenience of
printing the index array inplace in TIR though.
Hmm ... that's really short !
I don't know why I found ```AllocateConst``` (and stayed convinced) that is
something complicated for "immediate" use.
https://github.com/apache/tvm/blob/a13eadbddaa94246f2d572aed6e04b70737616c5/tests/python/unittest/test_tvmscript_ir_builder_tir.py#L386-L394
I also find attracted to pass a plain simple python ```list()```.
> In general, I won't argue against this change if there is a wider
consensus that this is a necessary addition. However, I think we have to think
carefully about adding another mechanism into TIR for representing data arrays
that is opaque to the memory planning. From what I can see, there are no
restrictions to the size of the data it can hold, so it's rather susceptible to
misuse.
For the misuse part, yes, also agree, but my understanding of
```AllocateConst``` is that inherits many properties of the buffers, while
```ArrayIntImm``` is more restrained kind of object treatable *only* as plain
"constant" within TIR parts.
Well, I reconsider ```AllocateConst``` if there is no consensus.
Thanks for pointing this out with a succinct example !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]