slyubomirsky commented on PR #14394:
URL: https://github.com/apache/tvm/pull/14394#issuecomment-1496837764
Points from the the April 4, 2023, community meeting, proposed by @tqchen:
1. Should we replace `call_pure` with `call_pure_packed`? Almost all uses of
`call_pure` in the tests are for packed funcs. Using `call_pure_packed` would
mean that passes would only need to look for `call_pure_packed` if they have
anything to do with `PackedFunc`s.
There is one other case that comes up in the tests, which is calling a
`PrimFunc` directly via its `GlobalVar` (not via `call_tir`). Would it be
reasonable to use `call_pure_packed` for that as well? If so, then this would
be a reasonable replacement.
2. Possible syntactic sugar we could use for purity/impurity:
`@R.function(pure=False)`.
Having the optional `pure` argument in `function` would require a level of
indirection to implement due to the way Python decorators work, but this could
work.
```python
def function(pure=False):
def inner_function(func: FType):
# parse the function...
return inner_function
```
Would we be fine with this? I believe this would have to be in
`python/tvm/script/parser/relax/entry.py`, for `function`. @yongwww, does that
seem accurate to you, or are there other places I would have to add that
parameter?
Any opinions on these options?
--
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]