tlc-pack / relax

Apache License 2.0
193 stars 58 forks source link

[Refactor][AST] `sinfo_args` A1: Update API of call_tir, call_packed, etc. #386

Closed MasterJH5574 closed 1 year ago

MasterJH5574 commented 1 year ago

Following #377 and #379, this PR followups to update the API of call_tir, call_packed, call_builtin and invoke_closure.


One thing specific to note is about our existing dataflow pattern language. Previously we have a sugar function for call_tir:

def is_call_tir(
    func_name: str,
    args: Union[List, Tuple, TuplePattern] = None,
    shape: Union[Tuple, List[tvm.ir.PrimExpr], DFPattern] = None,
) -> CallPattern:
    ...

Since we changed the API of call_tir - the CallNode does not contain the shape as one argument, - together with the fact that the dataflow pattern language does not yet support matching StructInfo, we have no approach to match the shape anymore. Therefore, the shape parameter is removed from is_call_tir. I left some Todo items there for future sinfo_args matching support.


cc @Hzfengsy @tqchen @slyubomirsky @spectrometerHBH