Skip to content

Add named manual kernel registration API#20658

Open
goutamadwant wants to merge 1 commit into
pytorch:mainfrom
goutamadwant:11221-named-manual-kernel-registration
Open

Add named manual kernel registration API#20658
goutamadwant wants to merge 1 commit into
pytorch:mainfrom
goutamadwant:11221-named-manual-kernel-registration

Conversation

@goutamadwant

Copy link
Copy Markdown
Contributor

Summary

Adds an opt-in library-name parameter for manual kernel registration codegen so generated RegisterKernels.{h,cpp} can expose a library-specific registration API such as register_portable_ops_lib_kernels().

The default manual registration API remains register_all_kernels() when no library name is provided. CMake manual-registration generation now passes the target library name through to codegen, and the Buck macro path supports the same optional parameter.

Fixes #11221.

Test plan

  • PYTHONPATH=.. python3 -m unittest codegen.test.test_executorch_gen
  • PYTHONPATH=.. python3 -m unittest codegen.test.test_executorch_gen codegen.test.test_executorch_signatures codegen.test.test_executorch_types codegen.test.test_executorch_unboxing codegen.test.test_selective_build
  • python3 -m py_compile codegen/gen.py codegen/test/test_executorch_gen.py
  • git diff --check origin/main..HEAD
  • Ran a temporary codegen.gen --manual-registration --manual-registration-lib-name=portable_ops_lib invocation and verified generated RegisterKernels.h and RegisterKernelsEverything.cpp use register_portable_ops_lib_kernels().

Could not run CMake validation locally because cmake is not installed on this PATH.

Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
@pytorch-bot

pytorch-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⚠️ 11 Awaiting Approval

As of commit 5acef86 with merge base e17700a (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla 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 Jul 1, 2026
@goutamadwant

Copy link
Copy Markdown
Contributor Author

@pytorchbot label "release notes: api"

@pytorch-bot pytorch-bot Bot added the release notes: api Changes to public facing apis (any interfaces, pybinded runtime methods, etc.) label Jul 1, 2026
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. release notes: api Changes to public facing apis (any interfaces, pybinded runtime methods, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manual kernel registration to include library names in API

2 participants