-
Notifications
You must be signed in to change notification settings - Fork 594
[6/N] Add update in module #11533
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
base: gh/cccclai/26/base
Are you sure you want to change the base?
[6/N] Add update in module #11533
Conversation
- Expose the update API in module. Inside the module. invoke the method. Update API - Did a bit refactor for the `StubBackend` test code, such that it can shared between `backend_interface_update_test.cpp` and `module_test.cpp` Differential Revision: [D76172680](https://our.internmc.facebook.com/intern/diff/D76172680/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11533
Note: Links to docs will display an error until the docs builds have been completed. ❌ 27 New Failures, 2 Unrelated FailuresAs of commit f0c47a6 with merge base f7cc72f ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
This pull request was exported from Phabricator. Differential Revision: D76172680 |
- Expose the update API in module. Inside the module. invoke the method. Update API - Did a bit refactor for the `StubBackend` test code, such that it can shared between `backend_interface_update_test.cpp` and `module_test.cpp` Differential Revision: [D76172680](https://our.internmc.facebook.com/intern/diff/D76172680/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76172680 |
runtime::Error Module::update( | ||
const std::string& method_name, | ||
runtime::ArrayRef<runtime::Entry> backend_options) { | ||
ET_CHECK_OK_OR_RETURN_ERROR(load_method(method_name)); | ||
auto& method = methods_.at(method_name).method; | ||
return method->update(backend_options); | ||
} | ||
|
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 is exactly my problem. none of the piping being done here is module or method name specific. Because the options being sent down are to the global singleton of backend. It would make sense only if we have a way to set options on an instance of the backend class that is tied to a given method and model.
Also I apologize if this was already discussed in review. It has been a while so likely I forgot
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.
I think we want to provide backend flexibility to decide whether it's global or per session. There is one single instance of the backend class. It is a singleton and processes all the .pte files (including all methods) even from different processes. We want the backend to have the option as needed.
Additionally, currently users don't interact with backend directly, Users just load the .pte file, construct the method. ET runtime is responsible for passing the information between user and the backends.
- Expose the update API in module. Inside the module. invoke the method. Update API - Did a bit refactor for the `StubBackend` test code, such that it can shared between `backend_interface_update_test.cpp` and `module_test.cpp` Differential Revision: [D76172680](https://our.internmc.facebook.com/intern/diff/D76172680/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76172680 |
Stack from ghstack (oldest at bottom):
StubBackend
test code, such that it can shared betweenbackend_interface_update_test.cpp
andmodule_test.cpp
Differential Revision: D76172680