Page MenuHomePhabricator

gValarini (Guilherme Valarini)
User

Projects

User does not belong to any projects.

User Details

User Since
May 10 2021, 10:14 AM (72 w, 5 d)

Recent Activity

Wed, Sep 14

gValarini added inline comments to D132005: [OpenMP] Add non-blocking support for target nowait regions.
Wed, Sep 14, 1:23 PM · Restricted Project, Restricted Project
gValarini added inline comments to D132005: [OpenMP] Add non-blocking support for target nowait regions.
Wed, Sep 14, 1:19 PM · Restricted Project, Restricted Project
gValarini updated the diff for D132005: [OpenMP] Add non-blocking support for target nowait regions.

Refactor interface code and address some code review changes

Wed, Sep 14, 11:54 AM · Restricted Project, Restricted Project

Aug 26 2022

gValarini added inline comments to D132005: [OpenMP] Add non-blocking support for target nowait regions.
Aug 26 2022, 10:06 AM · Restricted Project, Restricted Project
gValarini updated the diff for D132005: [OpenMP] Add non-blocking support for target nowait regions.

Update documentations and refactor some code

Aug 26 2022, 9:44 AM · Restricted Project, Restricted Project
gValarini added a comment to D132005: [OpenMP] Add non-blocking support for target nowait regions.

Thanks for the patch. I'll take a close look next week.

Aug 26 2022, 9:42 AM · Restricted Project, Restricted Project
gValarini added a comment to D132005: [OpenMP] Add non-blocking support for target nowait regions.

First of all, sorry for the late reply.

Aug 26 2022, 9:41 AM · Restricted Project, Restricted Project

Aug 25 2022

gValarini added a comment to D132532: [libomptarget] Avoid deleting the same entry multiple times.

tracking threads. My quick take will be another can of worms. I need to think about it when your patch shows up.

Aug 25 2022, 10:43 AM · Restricted Project, Restricted Project
gValarini requested review of D132676: [libomptarget] Avoid double-frees and user-after-frees of entries.
Aug 25 2022, 10:36 AM · Restricted Project, Restricted Project

Aug 24 2022

gValarini added a comment to D132532: [libomptarget] Avoid deleting the same entry multiple times.

I thought about this but IIRC, this doesn't work either. Now you have no way to prevent races between the copy back and copy to since the entry is gone while the copy back runs.

I thought about the racing. If race to write the same data, there is no harm. If race to write different data, the source of race is user program which needs to protect the race anyway.

Aug 24 2022, 7:39 AM · Restricted Project, Restricted Project

Aug 17 2022

gValarini added a comment to D132005: [OpenMP] Add non-blocking support for target nowait regions.

Right now the synchronization is based on stream. Have you though about synchronize by an CUDA event and return the Stream to the pool early?

Aug 17 2022, 6:57 PM · Restricted Project, Restricted Project
gValarini added a comment to D132005: [OpenMP] Add non-blocking support for target nowait regions.

Existing target nowait implementation doesn't distinguish using helper tasks or not. Setting LIBOMP_USE_HIDDEN_HELPER_TASK=0 dispatchs target tasks as regular tasks. As long as there are available OpenMP threads, these tasks can still run concurrently and gain asynchronicity although this scheme has the issue of active waiting and consuming host thread resource. I think this is the same issue you are trying to address in helper tasks.

Aug 17 2022, 3:59 PM · Restricted Project, Restricted Project
gValarini updated the diff for D132005: [OpenMP] Add non-blocking support for target nowait regions.

Update re-enqueue logic to support target nowait regions with hidden helper threads disabled

Aug 17 2022, 3:43 PM · Restricted Project, Restricted Project

Aug 16 2022

gValarini added a comment to D132005: [OpenMP] Add non-blocking support for target nowait regions.

If during the synchronization stage the operations are not completed, the attached hidden helper task is re-enqueued to any hidden helper thread to be later synchronized

Does this explicitly depends on helper threads and helper tasks or regular OpenMP threads and tasks can be used?

Aug 16 2022, 6:18 PM · Restricted Project, Restricted Project
gValarini updated the diff for D132005: [OpenMP] Add non-blocking support for target nowait regions.

Added missing commits

Aug 16 2022, 6:16 PM · Restricted Project, Restricted Project
gValarini updated the summary of D132005: [OpenMP] Add non-blocking support for target nowait regions.
Aug 16 2022, 5:51 PM · Restricted Project, Restricted Project
gValarini updated the summary of D132005: [OpenMP] Add non-blocking support for target nowait regions.
Aug 16 2022, 5:50 PM · Restricted Project, Restricted Project
gValarini requested review of D132005: [OpenMP] Add non-blocking support for target nowait regions.
Aug 16 2022, 5:47 PM · Restricted Project, Restricted Project

Jun 30 2021

gValarini added a comment to D104418: [OpenMP][Offloading] Fixed data race in libomptarget caused by async data movement.

The case you mentioned is not a problem. Say we have two queues for the two target regions. So the contents of each queue is:
Q1: data movement of A, notification of event E1, wait on E2, kernel issue.
Q2: data movement of B, notification of event E2, wait on E1, kernel issue.
You can see the notification of the two events always before the wait. No matter what execution orders they will be, it will not dead lock.

Jun 30 2021, 2:28 PM · Restricted Project
gValarini added a comment to D104418: [OpenMP][Offloading] Fixed data race in libomptarget caused by async data movement.
Jun 30 2021, 1:20 PM · Restricted Project
gValarini added a comment to D104418: [OpenMP][Offloading] Fixed data race in libomptarget caused by async data movement.

Reading the event-based solution, one corner case came up to my mind (it is odd, but possible):

Jun 30 2021, 9:52 AM · Restricted Project

Jun 18 2021

gValarini added inline comments to D104555: [OpenMP][Offloading] Fix data race in data mapping by using two locks.
Jun 18 2021, 1:00 PM · Restricted Project

Jun 17 2021

gValarini added a comment to D104418: [OpenMP][Offloading] Fixed data race in libomptarget caused by async data movement.

Or actually we can pass the update decision to getOrAllocTgtPtr such that we don't have to deal with lock(s) across functions.

Jun 17 2021, 11:08 AM · Restricted Project
gValarini added a comment to D104418: [OpenMP][Offloading] Fixed data race in libomptarget caused by async data movement.

So in one sentence, the root cause is the misalignment between assumption of mapping lookup logic and non-atomic data movement operations. It is not a problem for targets not supporting async data movement because everything can be guarded by the lock. Also, for those targets supporting async data movement, we don't want to use synchronous data movement here as well. The reason is obvious, for better performance. Data movement is extremely expensive, and multiple data movements can be potentially parallel, even for one single target region.

What I'm trying to do in this patch is to establish the dependency between the data movement and all other tasks using that data. We want to utilize the device side synchronization to do that by using event. The interesting thing for the event is, from host's perspective, "wait for an event" means just insert the event to the queue, and that's it. It is not like a barrier because it will not block the host. But yes, it is a barrier for the device scheduler for sure that all enqueued operations following the event can only start execution if the event is fulfilled.

Jun 17 2021, 9:33 AM · Restricted Project