masahi commented on a change in pull request #9482:
URL: https://github.com/apache/tvm/pull/9482#discussion_r797995975
##########
File path: python/tvm/tir/transform/transform.py
##########
@@ -310,6 +310,15 @@ def BF16TypeLowering():
"""
return _ffi_api.BF16TypeLowering() # type: ignore
+def CommonSubexprElim(enable_cse_tir: bool = True):
Review comment:
I didn't know that other TIR passes have a specific option for
disabling. `disabled_pass` I brought up is enforced at
https://github.com/apache/tvm/blob/3fbce70a8ad7e032de8c402fb27e0396435c8eca/src/ir/transform.cc#L479.
I believe this has higher precedence than other disabling options, since it is
enforced at the higher level in the stack. I don't know why things are like
this way, maybe @tqchen @zhiics knows?
For Vectorize, I think this option is needed because we need to turn a loop
with `vectorized` annotation into a sequential one if we want to skip this
pass.
https://github.com/apache/tvm/blob/c6f62aafc91e2600ed7772597fd4238c924c2a1b/src/tir/transforms/vectorize_loop.cc#L584-L588
Not so long ago, the contents of `driver_api.c`` was actually written in
python, so exposing this option to python made sense at that time. It's still
good to have it today for experimentation purposes like you said. You can keep
it for CSE if you find it useful, but for the purpose of disabling CSE,
`disabled_list` already does the job (but not for `Vectorize` as explained
above).
> The pass LoopPartition is quite weird, as its boolean for
activation/deactivation is passed directly to the CreatePassList() method:
Indeed it is weird, I remember our `LoopPartition` implementation was
problematic in the past (may be it is still today), probably an artifact from
that time. Anyway I don't think there is a deep reason behind it.
--
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]