public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC and OpenACC
@ 2022-01-11 12:50 Mikel Mendizabal
  2022-01-11 13:26 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Mikel Mendizabal @ 2022-01-11 12:50 UTC (permalink / raw)
  To: gcc

Dear GCC developers,

In the past year we started the offload of our software to GPUs. We decided to go with OpenACC. The program we are trying to offload is Millepede2 (MP2),  a tracker alignment software used to align the CMS experiment tracker at the large hadron collider. 

We are using gcc as our main compiler. However, we found a major inconvenience with OpenACC 2.6, the REDUCTION clause does not accept arrays. Thus, it not possible for us to parallelise our largest loops due to array dependencies. We managed to offload MP2 for small datasets, we worked around the reduction issue. Nonetheless, if our alignment campaign is large the workarounds are not useful anymore. 

I went thought the new versions of OpenACC and I found that v2.7 accepts arrays for the REDUCTION clause. I was wondering if it is in your plans to include a newer version of OpenACC for the next releases. 

Sincerely,
Mikel Mendizabal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC and OpenACC
  2022-01-11 12:50 GCC and OpenACC Mikel Mendizabal
@ 2022-01-11 13:26 ` Richard Biener
  2022-01-12 10:01   ` Mikel Mendizabal
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2022-01-11 13:26 UTC (permalink / raw)
  To: Mikel Mendizabal; +Cc: GCC Development

On Tue, Jan 11, 2022 at 1:52 PM Mikel Mendizabal via Gcc
<gcc@gcc.gnu.org> wrote:
>
> Dear GCC developers,
>
> In the past year we started the offload of our software to GPUs. We decided to go with OpenACC. The program we are trying to offload is Millepede2 (MP2),  a tracker alignment software used to align the CMS experiment tracker at the large hadron collider.
>
> We are using gcc as our main compiler. However, we found a major inconvenience with OpenACC 2.6, the REDUCTION clause does not accept arrays. Thus, it not possible for us to parallelise our largest loops due to array dependencies. We managed to offload MP2 for small datasets, we worked around the reduction issue. Nonetheless, if our alignment campaign is large the workarounds are not useful anymore.
>
> I went thought the new versions of OpenACC and I found that v2.7 accepts arrays for the REDUCTION clause. I was wondering if it is in your plans to include a newer version of OpenACC for the next releases.

Can you produce a self-contained example with an array for the
REDUCTION clause that should be accepted with OpenACC v2.7?

Thanks,
Richard.

> Sincerely,
> Mikel Mendizabal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC and OpenACC
  2022-01-11 13:26 ` Richard Biener
@ 2022-01-12 10:01   ` Mikel Mendizabal
  2022-01-12 11:53     ` Tobias Burnus
  0 siblings, 1 reply; 4+ messages in thread
From: Mikel Mendizabal @ 2022-01-12 10:01 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Development

Dear Richard,

Thanks a lot for the fast response. Here I send you a self contained example. I took it from openACC tutorial in [1]. I modified the code and added a dummy vector of size 1, lines 140-160 in the attached file (jsolvef_mikel.F90). The dummy vector (residual_v)  is the array form of the variable residual.

If the reduction clause (line 142) is commented both residual and residual_v give the same result. If in the reduction clause residual_v is given a compilation error appears, that the reduction clause does not support this variable datatype. In [2] I added the OpenACC 3.1 documentation. In section 1.12 the changes from v2.6 to v2.7 are described. More precisely, in line 612-613 the next is quoted:

"Arrays, subarrays and composite variables are now allowed in reduction clauses; see Sections 2.9.11 reduction clause and 2.5.14 reduction clause.”
I hope I could explain myself properly!
Thanks a lot :) 

Mikel Mendizabal


[1] https://github.com/OpenACCUserGroup/openacc-users-group/blob/master/Contributed_Sample_Codes/Tutorial1/solver/jsolvef.F90 <https://github.com/OpenACCUserGroup/openacc-users-group/blob/master/Contributed_Sample_Codes/Tutorial1/solver/jsolvef.F90> 
[2] https://www.openacc.org/sites/default/files/inline-images/Specification/OpenACC-3.1-final.pdf <https://www.openacc.org/sites/default/files/inline-images/Specification/OpenACC-3.1-final.pdf> 



> On 11. Jan 2022, at 14:26, Richard Biener <richard.guenther@gmail.com> wrote:
> 
> On Tue, Jan 11, 2022 at 1:52 PM Mikel Mendizabal via Gcc
> <gcc@gcc.gnu.org <mailto:gcc@gcc.gnu.org>> wrote:
>> 
>> Dear GCC developers,
>> 
>> In the past year we started the offload of our software to GPUs. We decided to go with OpenACC. The program we are trying to offload is Millepede2 (MP2),  a tracker alignment software used to align the CMS experiment tracker at the large hadron collider.
>> 
>> We are using gcc as our main compiler. However, we found a major inconvenience with OpenACC 2.6, the REDUCTION clause does not accept arrays. Thus, it not possible for us to parallelise our largest loops due to array dependencies. We managed to offload MP2 for small datasets, we worked around the reduction issue. Nonetheless, if our alignment campaign is large the workarounds are not useful anymore.
>> 
>> I went thought the new versions of OpenACC and I found that v2.7 accepts arrays for the REDUCTION clause. I was wondering if it is in your plans to include a newer version of OpenACC for the next releases.
> 
> Can you produce a self-contained example with an array for the
> REDUCTION clause that should be accepted with OpenACC v2.7?
> 
> Thanks,
> Richard.
> 
>> Sincerely,
>> Mikel Mendizabal


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC and OpenACC
  2022-01-12 10:01   ` Mikel Mendizabal
@ 2022-01-12 11:53     ` Tobias Burnus
  0 siblings, 0 replies; 4+ messages in thread
From: Tobias Burnus @ 2022-01-12 11:53 UTC (permalink / raw)
  To: Mikel Mendizabal, Thomas Schwinge; +Cc: GCC Development, Richard Biener

Dear Mikel,

thanks for the example. I have now filled a tracking issue at
https://gcc.gnu.org/PR103988.

Currently, GCC only supports OpenACC 2.6.

As GCC mainline is in feature-freeze Stage 3, this feature will surely
miss GCC 12, unfortunately.

At the moment, the OpenACC work is mostly focusing on behind-the-scene
changes (like corner cases, performance, nvptx/GCN improvements etc.).
However, support for OpenACC 2.7 (and later) is planned.*

Thanks for the report,

Tobias

*Planned by us, that is. GCC is an open-source project with contributors
from several companies and also many individual developers (spare
time/hobby or paid), each with their own schedule and topical focus.
Besides waiting, one option would be that you implement the reduction
feature yourself in GCC – or find someone who does this for you, paid or
not. (I think it should also be also suitable for Google Summer of Code.)
The array part should be relatively simple as GCC supports it already
for OpenMP; the structure part is a bit more work as piggybacking is not
possible but should be also not that complicated, I think.


On 12.01.22 11:01, Mikel Mendizabal via Gcc wrote:
> Dear Richard,
>
> Thanks a lot for the fast response. Here I send you a self contained example. I took it from openACC tutorial in [1]. I modified the code and added a dummy vector of size 1, lines 140-160 in the attached file (jsolvef_mikel.F90). The dummy vector (residual_v)  is the array form of the variable residual.
>
> If the reduction clause (line 142) is commented both residual and residual_v give the same result. If in the reduction clause residual_v is given a compilation error appears, that the reduction clause does not support this variable datatype. In [2] I added the OpenACC 3.1 documentation. In section 1.12 the changes from v2.6 to v2.7 are described. More precisely, in line 612-613 the next is quoted:
>
> "Arrays, subarrays and composite variables are now allowed in reduction clauses; see Sections 2.9.11 reduction clause and 2.5.14 reduction clause.”
> I hope I could explain myself properly!
> Thanks a lot :)
>
> Mikel Mendizabal
>
>
> [1] https://github.com/OpenACCUserGroup/openacc-users-group/blob/master/Contributed_Sample_Codes/Tutorial1/solver/jsolvef.F90 <https://github.com/OpenACCUserGroup/openacc-users-group/blob/master/Contributed_Sample_Codes/Tutorial1/solver/jsolvef.F90>
> [2] https://www.openacc.org/sites/default/files/inline-images/Specification/OpenACC-3.1-final.pdf <https://www.openacc.org/sites/default/files/inline-images/Specification/OpenACC-3.1-final.pdf>
>
>
>
>> On 11. Jan 2022, at 14:26, Richard Biener <richard.guenther@gmail.com> wrote:
>>
>> On Tue, Jan 11, 2022 at 1:52 PM Mikel Mendizabal via Gcc
>> <gcc@gcc.gnu.org <mailto:gcc@gcc.gnu.org>> wrote:
>>> Dear GCC developers,
>>>
>>> In the past year we started the offload of our software to GPUs. We decided to go with OpenACC. The program we are trying to offload is Millepede2 (MP2),  a tracker alignment software used to align the CMS experiment tracker at the large hadron collider.
>>>
>>> We are using gcc as our main compiler. However, we found a major inconvenience with OpenACC 2.6, the REDUCTION clause does not accept arrays. Thus, it not possible for us to parallelise our largest loops due to array dependencies. We managed to offload MP2 for small datasets, we worked around the reduction issue. Nonetheless, if our alignment campaign is large the workarounds are not useful anymore.
>>>
>>> I went thought the new versions of OpenACC and I found that v2.7 accepts arrays for the REDUCTION clause. I was wondering if it is in your plans to include a newer version of OpenACC for the next releases.
>> Can you produce a self-contained example with an array for the
>> REDUCTION clause that should be accepted with OpenACC v2.7?
>>
>> Thanks,
>> Richard.
>>
>>> Sincerely,
>>> Mikel Mendizabal
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-12 11:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 12:50 GCC and OpenACC Mikel Mendizabal
2022-01-11 13:26 ` Richard Biener
2022-01-12 10:01   ` Mikel Mendizabal
2022-01-12 11:53     ` Tobias Burnus

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).