-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Unity] Implement relax.Function.bind_params #15626
Conversation
Similar to `relax.Function.bind_symbolic_vars`, implemented in apache#15509, this commit introduces `relax.Function.bind_params` to allow Relax parameters to be manipulated on a per-function basis. This utility function and the existing `BindParams` transform both use the same underlying implementation.
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
@sunggg This is a follow-up to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you @Lunderberg.
Just one basic question, what would be the real use-case for this pass? Is this for multi-gpu?
At the moment, this would primarily be to write a single Relax function, then manually manipulate it into a specialized form. For example, writing an attention function that accepts a boolean filter tensor, then using BindParams to make a sibling function that replaces it with a constant tensor which o Lu contains In the past, this would have been used to statically bind model parameters into an end-to-end model. However, since that requires the compiling machine to have sufficient RAM, it isn’t as flexible as the |
Thanks @Lunderberg and @sunggg! This is merged. |
This test was implemented in apache#15626, but was initially disabled as it depended on functionality not introduced until apache#15577. Since that PR has landed, cleaning up and enabling the unit test.
This test was implemented in apache#15626, but was initially disabled as it depended on functionality not introduced until apache#15577. Since that PR has landed, cleaning up and enabling the unit test.
Similar to
relax.Function.bind_symbolic_vars
, implemented in #15509, this commit introducesrelax.Function.bind_params
to allow Relax parameters to be manipulated on a per-function basis. This utility function and the existingBindParams
transform both use the same underlying implementation.