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

Merged
merged 1 commit into from
May 13, 2025

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

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.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 2 New Failures, 3 Pending

As of commit 3a86502 with merge base 518324f (image):

NEW FAILURES - The following jobs have failed:

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

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. XNNPACK can't run, but it at least will allow graceful fallback at the application level.

Reviewed By: digantdesai

Differential Revision: D74604740
@facebook-github-bot
Copy link
Contributor

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

@GregoryComer GregoryComer added the release notes: none Do not include this in the release notes label May 13, 2025
@facebook-github-bot facebook-github-bot merged commit 9ded0a2 into pytorch:main May 13, 2025
84 of 88 checks passed
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 release notes: none Do not include this in the release notes topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants