Skip to content
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

Move XNNPACK work to its own directory #2

Merged
merged 2 commits into from
Oct 23, 2023
Merged

Move XNNPACK work to its own directory #2

merged 2 commits into from
Oct 23, 2023

Conversation

ramiro050
Copy link
Owner

No description provided.

@ramiro050 ramiro050 requested a review from okkwon October 23, 2023 19:10
Copy link
Collaborator

@okkwon okkwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@ramiro050 ramiro050 merged commit dc4be22 into xnnpack Oct 23, 2023
@ramiro050 ramiro050 deleted the new-dir branch October 23, 2023 22:35
ramiro050 pushed a commit that referenced this pull request Dec 19, 2023
…e_thread_request_affinity` (iree-org#15499)

TSan report:

```
WARNING: ThreadSanitizer: data race (pid=45817)
  Read of size 4 at 0x0001084004e0 by thread T2:
    #0 iree_thread_request_affinity threading_darwin.c:230 (local-task_vmvx_semaphore_submission_test:arm64+0x100078f40)
    #1 iree_task_worker_main worker.c:385 (local-task_vmvx_semaphore_submission_test:arm64+0x100071594)
    #2 iree_thread_start_routine threading_darwin.c:72 (local-task_vmvx_semaphore_submission_test:arm64+0x100078e3c)

  Previous write of size 4 at 0x0001084004e0 by main thread:
    #0 iree_thread_create threading_darwin.c:140 (local-task_vmvx_semaphore_submission_test:arm64+0x100078ca4)
    #1 iree_task_worker_initialize worker.c:66 (local-task_vmvx_semaphore_submission_test:arm64+0x1000714f8)
    #2 iree_task_executor_create executor.c:161 (local-task_vmvx_semaphore_submission_test:arm64+0x10006b2b0)
```

The read of `thread->mach_port` at
https://github.com/openxla/iree/blob/ccc4c3719cea467477a783f1c9e9f1fc06b4c508/runtime/src/iree/base/internal/threading_darwin.c#L230

is not ordered relatively to the write of that variable in the parent
thread after `pthread_mach_thread_np` returns:
https://github.com/openxla/iree/blob/ccc4c3719cea467477a783f1c9e9f1fc06b4c508/runtime/src/iree/base/internal/threading_darwin.c#L140

The proposed fix is that the worker thread shouldn't need to access its
own `thread->mach_port`, it can equivalently call `mach_task_self()`.
ramiro050 pushed a commit that referenced this pull request Dec 19, 2023
…e_thread_request_affinity` (iree-org#15499)

TSan report:

```
WARNING: ThreadSanitizer: data race (pid=45817)
  Read of size 4 at 0x0001084004e0 by thread T2:
    #0 iree_thread_request_affinity threading_darwin.c:230 (local-task_vmvx_semaphore_submission_test:arm64+0x100078f40)
    #1 iree_task_worker_main worker.c:385 (local-task_vmvx_semaphore_submission_test:arm64+0x100071594)
    #2 iree_thread_start_routine threading_darwin.c:72 (local-task_vmvx_semaphore_submission_test:arm64+0x100078e3c)

  Previous write of size 4 at 0x0001084004e0 by main thread:
    #0 iree_thread_create threading_darwin.c:140 (local-task_vmvx_semaphore_submission_test:arm64+0x100078ca4)
    #1 iree_task_worker_initialize worker.c:66 (local-task_vmvx_semaphore_submission_test:arm64+0x1000714f8)
    #2 iree_task_executor_create executor.c:161 (local-task_vmvx_semaphore_submission_test:arm64+0x10006b2b0)
```

The read of `thread->mach_port` at
https://github.com/openxla/iree/blob/ccc4c3719cea467477a783f1c9e9f1fc06b4c508/runtime/src/iree/base/internal/threading_darwin.c#L230

is not ordered relatively to the write of that variable in the parent
thread after `pthread_mach_thread_np` returns:
https://github.com/openxla/iree/blob/ccc4c3719cea467477a783f1c9e9f1fc06b4c508/runtime/src/iree/base/internal/threading_darwin.c#L140

The proposed fix is that the worker thread shouldn't need to access its
own `thread->mach_port`, it can equivalently call `mach_task_self()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants