manupa-arm commented on pull request #8472:
URL: https://github.com/apache/tvm/pull/8472#issuecomment-880658254
Hi @tqchen,
After considering the suggestions, these are few options we could think of :
C1 :
```
@tvm.script.tir
def myfunc():
tir.attrs({
"link_params": {"model0": array}
})
my_param_var = tir.get_link_param("model0")
```
C2 :
```
@tvm.script.tir
def myfunc():
tir.attrs({
"link_params": {my_param_var: array}
})
```
C3 :
```
@tvm.script.tir
def myfunc():
param = tir.allocate_const([1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "int32", [10])
```
First of all, we do feel all the options could achieve what we want here.
If we consider C1, it seems to hide behind a tir builtin as a level of
indirection to obtain 'array'. Therefore, between C1 & C2, we feel C2 is better
and we do not see the requirement for that level of in-direction.
Between, C2 and C3, 'array' need to express information such as data,
datatype, alignment, etc. Thus, we do have to introduce a specialized
buffer_var (or something to that effect) to hold those information. Therefore,
we feel tir.allocate_const is cleaner and intuitive.
Regarding the cons of C3, would you be able to elaborate how this affects
negatively (where the compilation requires constants to be bound to the IR) in
other areas/passes ? We cannot figure out how certain mutators and visitors get
affected by adding an extra leaf node to IR w.r.t to other approached mentioned
here.
cc : @giuseros @mbaret
--
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]