Skip to content

Allow graceful handling of cpuinfo init failure #10826

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

@GregoryComer GregoryComer commented May 12, 2025

Summary: Don't fatally assert when cpuinfo_initialize fails. This can happen in rare cases on weird hardware. This change instead logs an error and allows execution to continue without the threadpool.

Differential Revision: D74604740

Test Plan:
I locally modified cpuinfo_initialize to always return false. I then attempted to run a model (dl3_xnnpack_fp32.pte) with executor_runner_optimized. With this change, it outputs the following:

E 00:00:00.001021 executorch:XNNPACKBackend.cpp:49] Failed to initialize, XNNPACK status: 0x5
I 00:00:00.087180 executorch:executor_runner_lib.cpp:410] Model file /home/gjcomer/dl3_xnnpack_fp32.pte is loaded.
I 00:00:00.087213 executorch:executor_runner_lib.cpp:420] Running method forward
I 00:00:00.087231 executorch:executor_runner_lib.cpp:470] Setting up planned buffer 0, size 61424384.
E 00:00:00.110105 executorch:method.cpp:78] Backend XnnpackBackend is not available.
F 00:00:00.110144 executorch:executor_runner_lib.cpp:517] In function executor_runner_benchmark(), assert failed (method.ok()): load_me

Summary: Don't fatally assert when cpuinfo_initialize fails. This can happen in rare cases on weird hardware. This change instead logs an error and allows execution to continue without the threadpool.

Differential Revision: D74604740
Copy link

pytorch-bot bot commented May 12, 2025

🔗 Helpful Links

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

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

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 May 12, 2025
@facebook-github-bot
Copy link
Contributor

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

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 topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants