Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Relax] Remove name requirement from MergeCompositeFunctions #17212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lunderberg
Copy link
Contributor

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 #17210

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 apache#17210
@Lunderberg Lunderberg force-pushed the name_agnostic_merge_composite_functions branch from 061b266 to 4cb2d66 Compare September 16, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [Relax] InternalError: Check failed: (it_group != obj2group_.end()) is false
1 participant