Always lock workspace in buck builds (#19734)#19734
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19734
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New Failures, 2 Unrelated FailuresAs of commit 57d55be with merge base 3b5f777 ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@GregoryComer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106026285. |
This PR needs a
|
Curious why bother with the differentiation between buck and cmake? |
Summary: In older versions of the XNNPACK backend, we always locked when accessing the XNNPACK workspace. This gives guarantees that we don't re-size the workspace, even when callers violate thread safety. In D95475030, an OSS contributor disabled locking when workspace sharing is off. This is safe as long as the caller observes proper thread safety. However, we're seeing some crashes that look like they might be caused by the workspace resizing or freeing during inference. This diff restores the locking for buck builds in the workspace sharing disabled case as a hardening measure. I've left it enabled in CMake. Differential Revision: D106026285
cda95e3 to
57d55be
Compare
An OSS contributor requested we get rid of the locks when not using workspace sharing. I don't think the overhead is high, but I did merge their PR to skip locking in this case. I don't love the fragmentation between buck/cmake, so I'm open to changing it. |
Summary:
In older versions of the XNNPACK backend, we always locked when accessing the XNNPACK workspace. This gives guarantees that we don't re-size the workspace, even when callers violate thread safety.
In D95475030, an OSS contributor disabled locking when workspace sharing is off. This is safe as long as the caller observes proper thread safety. However, we're seeing some crashes that look like they might be caused by the workspace resizing or freeing during inference.
This diff restores the locking for buck builds in the workspace sharing disabled case as a hardening measure. I've left it enabled in CMake.
Differential Revision: D106026285