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

[RFC][Frontend] Return module for Relay frontend converter #3346

Closed
icemelon opened this issue Jun 11, 2019 · 6 comments
Closed

[RFC][Frontend] Return module for Relay frontend converter #3346

icemelon opened this issue Jun 11, 2019 · 6 comments

Comments

@icemelon
Copy link
Member

As we have pass manager in Relay optimization and mostly use module as optimization unit, I suggest we change the Relay frontend converter to return a module instead of a function. The change also makes easier add prelude and global var in the frontend converter in the future. Frontend converter will preset the main function in the module to the converted function as

mod[mod.entry_func] = converted_func

Correspondingly we need to change the relay executor to be able to run the converted module. I use MxNet as an exmple to show the proposed change:

mod, _ = relay.frontend.from_mxnet(mx_sym, shapes, dtype)
for kind in ["graph", "debug"]:
    intrp = relay.create_executor(kind, mod=mod, ctx=ctx, target=target)
    op_res = intrp.evaluate()(*args)

When executor is given no input, it will execute the mod.entry_func by default.

cc @jroesch @tqchen @wweic @zhiics

@zhiics
Copy link
Member

zhiics commented Jun 12, 2019

Yeah, this is exactly what I think as well.

@wweic
Copy link
Contributor

wweic commented Jun 12, 2019

+1

1 similar comment
@yongwww
Copy link
Member

yongwww commented Jun 12, 2019

+1

@zhiics
Copy link
Member

zhiics commented Jun 12, 2019

@icemelon9 #3353 was the draft I haven't finished yet.

@tqchen
Copy link
Member

tqchen commented Jun 12, 2019

+1

@tqchen
Copy link
Member

tqchen commented Jun 17, 2019

#3353

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

No branches or pull requests

5 participants