public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Julian Brown <julian@codesourcery.com>
To: Thomas Schwinge <thomas@codesourcery.com>
Cc: <gcc-patches@gcc.gnu.org>, Jakub Jelinek <jakub@redhat.com>,
	"Chung-Lin Tang" <cltang@codesourcery.com>
Subject: Re: [PATCH 0/4] openacc: Async fixes
Date: Wed, 30 Jun 2021 11:40:33 +0100	[thread overview]
Message-ID: <20210630114033.4e85103f@squid.athome> (raw)
In-Reply-To: <87pmw3ycxb.fsf@euler.schwinge.homeip.net>

On Wed, 30 Jun 2021 10:28:00 +0200
Thomas Schwinge <thomas@codesourcery.com> wrote:

> >  - The OpenACC profiling-interface implementation did not measure
> >    asynchronous operations properly.  
> 
> We'll need to be careful: (possibly, an older version of) that one we
> internally had identified to be causing some issues; see the
> "acc_prof-parallel-1.c intermittent failure on og10 branch" emails,
> 2020-07.

Hmm, I'll check those.

> >  - Several test cases misuse OpenACC asynchronous support (more race
> >    conditions).  
> 
> Mostly ACK, but some more changes may be necessary; please see
> <http://mid.mail-archive.com/87sg1s9s9l.fsf@euler.schwinge.homeip.net>
> (you were CCed).

Thanks -- these test changes have been floating around uncommitted for
too long already, I guess...

> >  .../libgomp.oacc-c-c++-common/deep-copy-10.c  |  14 +-  
> 
> Please provide some detail about that one ("Fix async behaviour").
> It's not obvious to me what's wrong with the current version (but I
> haven't really spent time on that yet).

Aha, well I didn't see what was wrong with it either when I wrote the
test!

The problem is that we have copyin/modify-on-target/copyout operations
that process the *same data* from different async streams on successive
loop iterations. Those async streams are independent from one another,
so depending on how they are scheduled, we can be copying-in on one
async stream whilst simultaneously copying-out on another async stream
-- so of course, the data gets corrupted.

So the fix makes sure that each async stream only operates on "its own"
data. The increase in number of loop iterations was specifically to
tickle the flaw in the workaround used for GCN wrt. the ephemeral
copies -- i.e. snapshotting all host data immediately.

HTH,

Julian

  reply	other threads:[~2021-06-30 10:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29 23:42 Julian Brown
2021-06-29 23:42 ` [PATCH 1/4] openacc: Async fix for lib-94 testcase Julian Brown
2021-06-29 23:42 ` [PATCH 2/4] openacc: Fix async bugs in several OpenACC test cases Julian Brown
2021-06-29 23:52   ` Julian Brown
2021-06-29 23:42 ` [PATCH 3/4] openacc: Fix asynchronous host-to-device copies in libgomp runtime Julian Brown
2021-07-27 10:01   ` Thomas Schwinge
2023-03-10 15:22     ` Allow libgomp 'cbuf' buffering with OpenACC 'async' for 'ephemeral' data (was: [PATCH 3/4] openacc: Fix asynchronous host-to-device copies in libgomp runtime) Thomas Schwinge
2021-06-29 23:42 ` [PATCH 4/4] openacc: Profiling-interface fixes for asynchronous operations Julian Brown
2021-06-30  8:28 ` [PATCH 0/4] openacc: Async fixes Thomas Schwinge
2021-06-30 10:40   ` Julian Brown [this message]
2021-07-02 13:51     ` Julian Brown
2023-03-10 11:38   ` Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210630114033.4e85103f@squid.athome \
    --to=julian@codesourcery.com \
    --cc=cltang@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=thomas@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).