-
Notifications
You must be signed in to change notification settings - Fork 594
[3/N] Add update function in backend interface #11391
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/23/base
Are you sure you want to change the base?
Conversation
Add update function in backend interface class. Next step, will add update API in the method and then module Differential Revision: [D75919242](https://our.internmc.facebook.com/intern/diff/D75919242/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11391
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 2 Unrelated FailuresAs of commit efa67f3 with merge base f7cc72f ( NEW FAILURE - The following job has 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. |
Add update function in backend interface class. Next step, will add update API in the method and then module Differential Revision: [D75919242](https://our.internmc.facebook.com/intern/diff/D75919242/) ghstack-source-id: 288333606 Pull Request resolved: #11391
This pull request was exported from Phabricator. Differential Revision: D75919242 |
This PR needs a
|
runtime/backend/backend_options.h
Outdated
@@ -117,6 +118,10 @@ class BackendOptions { | |||
return err; | |||
} | |||
|
|||
executorch::runtime::ArrayRef<BackendOption> view() const { |
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.
maybe more meaningful name. get_backend_options
or get_ref_to_backend_options
Add update function in backend interface class. Next step, will add update API in the method and then module Differential Revision: [D75919242](https://our.internmc.facebook.com/intern/diff/D75919242/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D75919242 |
Add update function in backend interface class. Next step, will add update API in the method and then module Differential Revision: [D75919242](https://our.internmc.facebook.com/intern/diff/D75919242/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D75919242 |
Add update function in backend interface class. Next step, will add update API in the method and then module Differential Revision: [D75919242](https://our.internmc.facebook.com/intern/diff/D75919242/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D75919242 |
* @param[in] args A list of BackendOptions passed in by users. | ||
* @retval Error::Ok if successful. | ||
*/ | ||
ET_NODISCARD virtual Error update( |
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 would jsut call it set_backend_options which seems more appropriate
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 kind of like this API name more, but we can discuss about it.
BackendUpdateContext& context, | ||
const executorch::runtime::ArrayRef<BackendOption>& backend_options) const { | ||
return Error::Ok; | ||
}; |
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.
what is the implementation of this? If it is in the next diff, can you pull it here?
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.
It's the base function. If backends didn't implement this function, this function will be called. If we set it to virtual, then we need all backends to implement this fucntion.
* @retval Error::Ok if successful. | ||
*/ | ||
ET_NODISCARD virtual Error update( | ||
BackendUpdateContext& context, |
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.
what is supposed to be the role of BackendUpdateContext?
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.
It's a place holder for future API changes. Currently have the context for init and execute
BackendOptions<5> options; | ||
}; | ||
|
||
TEST_F(BackendInterfaceUpdateTest, HandlesInvalidOption) { |
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.
There are all these tests but I am not sure if they are meanigfully testing anything? do you need all of them?
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 it's helpful to make sure we know each option inside the backend is updated successfully, and they are isolated.
Stack from ghstack (oldest at bottom):
Add update function in backend interface class.
Next step, will add update API in the method and then module
Differential Revision: D75919242