-
Notifications
You must be signed in to change notification settings - Fork 608
Allow kernel manual registration #491
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
✅ Deploy Preview for resplendent-gnome-14e531 canceled.
|
This pull request was exported from Phabricator. Differential Revision: D49439673 |
This pull request was exported from Phabricator. Differential Revision: D49439673 |
6a17ee1
to
8a1f1c2
Compare
This pull request was exported from Phabricator. Differential Revision: D49439673 |
8a1f1c2
to
a61a375
Compare
This pull request was exported from Phabricator. Differential Revision: D49439673 |
a61a375
to
f8f3a94
Compare
This pull request was exported from Phabricator. Differential Revision: D49439673 |
f8f3a94
to
11f18f2
Compare
This pull request was exported from Phabricator. Differential Revision: D49439673 |
11f18f2
to
7275e09
Compare
This pull request was exported from Phabricator. Differential Revision: D49439673 |
7275e09
to
dfdcf50
Compare
This pull request was exported from Phabricator. Differential Revision: D49439673 |
dfdcf50
to
3d959be
Compare
This pull request was exported from Phabricator. Differential Revision: D49439673 |
3d959be
to
3bd619d
Compare
This pull request was exported from Phabricator. Differential Revision: D49439673 |
Summary: X-link: pytorch/pytorch#110086 Exposing a codegen mode for generating a hook for user to register their kernels. If we pass `--manual-registration` flag to `gen_executorch.py`, we will generate the following files: 1. RegisterKernels.h which declares a `register_all_kernels()` API inside `torch::executor` namespace. 2. RegisterKernelsEverything.cpp which implements `register_all_kernels()` by defining an array of generated kernels. This way user can depend on the library declared by `executorch_generated_lib` macro (with `manual_registration=True`) and be able to include `RegisterKernels.h`. Then they can manually call `register_all_kernels()` instead of relying on C++ static initialization mechanism which is not available in some embedded systems. Reviewed By: cccclai Differential Revision: D49439673
…0086) Summary: X-link: pytorch/executorch#491 Exposing a codegen mode for generating a hook for user to register their kernels. If we pass `--manual-registration` flag to `gen_executorch.py`, we will generate the following files: 1. RegisterKernels.h which declares a `register_all_kernels()` API inside `torch::executor` namespace. 2. RegisterKernelsEverything.cpp which implements `register_all_kernels()` by defining an array of generated kernels. This way user can depend on the library declared by `executorch_generated_lib` macro (with `manual_registration=True`) and be able to include `RegisterKernels.h`. Then they can manually call `register_all_kernels()` instead of relying on C++ static initialization mechanism which is not available in some embedded systems. Test Plan: Rely on the unit test: ``` buck2 test fbcode//executorch/runtime/kernel/test:test_kernel_manual_registration ``` Reviewed By: cccclai Differential Revision: D49439673
3bd619d
to
8a53eef
Compare
This pull request was exported from Phabricator. Differential Revision: D49439673 |
This pull request has been merged in 153cf3b. |
* Minimal android app build * Improve script * Detect physical device as well
Summary:
Exposing a codegen mode for generating a hook for user to register their kernels.
If we pass
--manual-registration
flag togen_executorch.py
, we will generate the following files:register_all_kernels()
API insidetorch::executor
namespace.register_all_kernels()
by defining an array of generated kernels.This way user can depend on the library declared by
executorch_generated_lib
macro (withmanual_registration=True
) and be able to includeRegisterKernels.h
. Then they can manually callregister_all_kernels()
instead of relying on C++ static initialization mechanism which is not available in some embedded systems.Reviewed By: cccclai
Differential Revision: D49439673