-
Notifications
You must be signed in to change notification settings - Fork 537
[ExecuTorch][to_backend] Enable to_backend API to leverage preprocess_multimethod #9824
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9824
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit f23ecf3 with merge base ae2d822 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
for the failing test, let me rebase and resubmit |
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.
Looks good. Thank you for being patient and all the effort!
### summary We introduce a new preprocess_multimethod. This takes the place of preprocess all in the following discussion: #8230 This is a class method so that we can allow the default implementation to leverage the static preprocess method. The default implementation just applies preprocess on all the exported programs given. ### Testing Testing done in follow up PR #9824
### summary We introduce a new preprocess_multimethod. This takes the place of preprocess all in the following discussion: pytorch#8230 This is a class method so that we can allow the default implementation to leverage the static preprocess method. The default implementation just applies preprocess on all the exported programs given. ### Testing Testing done in follow up PR pytorch#9824
Summary
We add a new to_backend api which for multi method models. Specifically, we pass in a dictionary mapping MethodName to ExportedProgram, as well as a dictionary mapping MethodName to Partitioner. We then return a dictionary mapping MethodName to the partitioned and lowered exported program.
In addition, we also provide a new preprocess API for backends to implement. This API is preprocess_multimethod. The signature of the new method is as follows:
This new API enableds backends to preprocess all partitions/methods at once. This way, while processing blobs, they can identify shared components between preprocessed blobs. Shared components can be serialized within the NamedDataStore.
The key change in backend infra, is that when partitioning, we now have to identify all the partitioned graphs to be lowered at once, and pass them to preprocess_multimethod at once. Previously, as we found lowerable partitions, we preprocessed and embedded them into the graph.
Testing
python -m unittest exir.backend.test.test_to_backend_multi_method