-
Notifications
You must be signed in to change notification settings - Fork 608
Changes to allow the export of functions with no user input. #8031
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -321,6 +321,8 @@ def lift_constant_tensor_pass(ep): | |
new_input_specs.extend(lifted_constants) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And if we just insert all the constants at the beginning, we can just directly prepend to input_specs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done, and removed all the logic I had previously, now: No user inputs -> inserting before |
||
lifted_constants.clear() | ||
new_input_specs.append(s) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a test case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a test case, shifted to the simpler implementation of just prepending the signature since the order of the non-user inputs does not matter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have also validated that it works with my export process as well. |
||
if len(lifted_constants) > 0: | ||
new_input_specs = lifted_constants + new_input_specs | ||
ep.graph_signature.input_specs = new_input_specs | ||
ep.graph_module.recompile() | ||
return ep | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
this change looks fine. On our side we should probably take a pass over all the memory planning infra. A lot of it was written before export graphs were functionalized so the concept of non user inputs didnt make exist.
Like realistically we should /only/ be verifying the memory planning of user inputs here