tvm
tvm copied to clipboard
[Relax] Remove name requirement from MergeCompositeFunctions
Prior to this commit, the relax.transform.MergeCompositeFunctions required the module to contain a single Relax function named "main". Lack of this function would result in an error when mod->GetGlobalVar("main") was called. Presence of any other Relax function would cause an error, since they were not collected into the CompositeGroupsBuilder.
This commit updates MergeCompositeFunctions to be indepedendent of the names of the Relax functions in an IRModule. The transform now updates all Relax functions that do not have the attr::kPrimitive or attr::kCodegen attributes.
Closes https://github.com/apache/tvm/issues/17210