Skip to content

Update PAL override docs for new APIs #11747

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GregoryComer
Copy link
Member

Summary

Update PAL docs in using-executorch-runtime-integration.md to describe the new PAL override mechanism introduced in #10675. I've left the docs in for the weak symbol override mechanism, as well, though I've recommended use of the runtime APIs.

Test plan

I built the docs locally to validate form and content.

Copy link

pytorch-bot bot commented Jun 17, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 51b2155 with merge base 7b39a0c (image):
💚 Looks good so far! There are no failures yet. 💚

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 Jun 17, 2025
@GregoryComer GregoryComer added the release notes: none Do not include this in the release notes label Jun 17, 2025
Comment on lines 61 to 64
ET_UNUSED bool registration_result = runtime::register_pal(build_pal());
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this how you do static initialization? It should be a static variable right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@larryliu0820 I updated the example code to be slightly more clear. The original snippet is inside an anonymous namespace, which serves the same purpose of translation-unit scoping for the variable. But it is a global constructor in the same way. I've included the anonymous namespace in the snippet so that this is more clear.

- Call `executorch::platform::register_pal(pal_impl)` to register the implementation.
- This can be done from as as a global constructor, as in the example below.

Here is a complete example from [pybindings.cpp](https://github.com/pytorch/executorch/blob/7b39a0ce63bfb5124d4d29cfb6c8af85a3c580ba/extension/pybindings/pybindings.cpp#L4), where logs are redirected to show up properly in a Python notebook environment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link is pointing to a comment though

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: none Do not include this in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants