Skip to content

[ET-VK][EZ] Clean up OperatorRegistry #2304

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

Closed
wants to merge 2 commits into from

Conversation

jorgep31415
Copy link
Contributor

@jorgep31415 jorgep31415 commented Mar 7, 2024

Stack from ghstack (oldest at bottom):

Align OperatorRegistry with the style of ShaderRegistry in #2222

This means

  • Improve comments and comment formatting.
  • Use snake case, even if it deviates from the original registry I was following. Snake case is more consistent with the Vulkan backend code.
    https://www.internalfb.com/code/fbsource/[a97f9ed1a715231bb61b05942273f1e8f8631503]/fbcode/executorch/runtime/kernel/operator_registry.h?lines=208%2C213
  • Move using declarations and member variables to top of class definition.
  • Place static OperatorRegistry instance declaration in a global function operator_registry() instead of in member function getInstance().
  • Use macros to wrap OperatorRegistry functions instead of global functions.
  • For simplicity, remove unneeded ctor and assignment operator deletion/hiding. Note users can now create their own non-static OperatorRegistry instance and we can consider hiding this again later.

Differential Revision: D54640160

Align `OperatorRegistry` with the style of `ShaderRegistry` in #2222

This means
- Improve comments and comment formatting.
- Use snake case, even if it deviates from the original registry I was following. Snake case is more consistent with the Vulkan backend code.
https://www.internalfb.com/code/fbsource/[a97f9ed1a715231bb61b05942273f1e8f8631503]/fbcode/executorch/runtime/kernel/operator_registry.h?lines=208%2C213
- Move `using` declarations and member variables to top of class definition.
- Place static `OperatorRegistry` instance declaration in a global function `operator_registry()` instead of in member function `getInstance()`.
- Use macros to wrap `OperatorRegistry` functions instead of global functions.
- For simplicity, remove unneeded ctor and assignment operator deletion/hiding. Note users can now create their own non-static `OperatorRegistry` instance and we can consider hiding this again later.

Differential Revision: [D54640160](https://our.internmc.facebook.com/intern/diff/D54640160/)

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Mar 7, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/2304

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 1 Unrelated Failure

As of commit 50eec4e with merge base 47b837b (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following job 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.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 7, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D54640160

Align `OperatorRegistry` with the style of `ShaderRegistry` in #2222

This means
- Improve comments and comment formatting.
- Use snake case, even if it deviates from the original registry I was following. Snake case is more consistent with the Vulkan backend code.
https://www.internalfb.com/code/fbsource/[a97f9ed1a715231bb61b05942273f1e8f8631503]/fbcode/executorch/runtime/kernel/operator_registry.h?lines=208%2C213
- Move `using` declarations and member variables to top of class definition.
- Place static `OperatorRegistry` instance declaration in a global function `operator_registry()` instead of in member function `getInstance()`.
- Use macros to wrap `OperatorRegistry` functions instead of global functions.
- For simplicity, remove unneeded ctor and assignment operator deletion/hiding. Note users can now create their own non-static `OperatorRegistry` instance and we can consider hiding this again later.

Differential Revision: [D54640160](https://our.internmc.facebook.com/intern/diff/D54640160/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D54640160

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 9b3925d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants