Avoid nested thread-pool locking in parallel_for - #22663
Conversation
Summary: Using Kleidi can invoke `parallel_for` inside an existing pool task. Calculating the inner chunk size queries the pool's thread count and relocks the mutex held by the outer call, hanging real model inference even with one thread. Honor `NoThreadPoolGuard` before querying the pool. Run nested nonempty ranges directly and preserve the outer thread number used for per-thread scratch storage. Cover nested work, thread-number preservation, and empty ranges in both source mirrors. AI-assisted: Codex. Differential Revision: D119433132
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22663
Note: Links to docs will display an error until the docs builds have been completed. ❌ 5 New FailuresAs of commit 795b7d5 with merge base 897fc8e ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@JakeStevens has exported this pull request. If you are a Meta employee, you can view the originating Diff in D119433132. |
This PR needs a
|
Summary:
Using Kleidi can invoke
parallel_forinside an existing pool task. Calculating the inner chunk size queries the pool's thread count and relocks the mutex held by the outer call, hanging real model inference even with one thread.Honor
NoThreadPoolGuardbefore querying the pool. Run nested nonempty ranges directly and preserve the outer thread number used for per-thread scratch storage. Cover nested work, thread-number preservation, and empty ranges in both source mirrors.AI-assisted: Codex.
Differential Revision: D119433132