Skip to content

Comments

Auto-initialize PAL when functions are called before et_pal_init()#17546

Open
rascani wants to merge 2 commits intopytorch:mainfrom
rascani:autoinit-pal
Open

Auto-initialize PAL when functions are called before et_pal_init()#17546
rascani wants to merge 2 commits intopytorch:mainfrom
rascani:autoinit-pal

Conversation

@rascani
Copy link
Contributor

@rascani rascani commented Feb 19, 2026

Summary

Replace the debug-only assertion behavior with automatic initialization. When et_pal_current_ticks() or et_pal_emit_log_message() are called before et_pal_init(), they now call et_pal_init() automatically instead of aborting in debug builds or producing undefined behavior in release.

Uses std::call_once with a function-local static flag for thread-safe one-time initialization.

Rename executor_pal_death_test to executor_pal_autoinit_test since we now test auto-initialization behavior rather than death on missing init.

@pytorch-bot
Copy link

pytorch-bot bot commented Feb 19, 2026

🔗 Helpful Links

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

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

❌ 5 New Failures, 3 Cancelled Jobs

As of commit d04ac21 with merge base 505c5c9 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

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 Feb 19, 2026
@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Replace the debug-only assertion behavior with automatic initialization.
When et_pal_current_ticks() or et_pal_emit_log_message() are called
before et_pal_init(), they now call et_pal_init() automatically instead
of aborting in debug builds or producing undefined behavior in release.

Uses std::call_once with a function-local static flag for thread-safe
one-time initialization.

Rename executor_pal_death_test to executor_pal_autoinit_test since we
now test auto-initialization behavior rather than death on missing init.

Co-authored-by: Claude <noreply@anthropic.com>
@rascani rascani marked this pull request as ready for review February 19, 2026 17:10
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Feb 19, 2026

@rascani has imported this pull request. If you are a Meta employee, you can view this in D93765646.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants