[RFC] Enabling SVE with offloading to nvptx

Andrew Stubbs ams@baylibre.com
Mon Nov 4 10:21:58 GMT 2024


[...skip literally unreadable deeply nested conversation...]

A couple of years ago I posted a patch to this same code solving a 
performance problem with x86_64/amdgcn offloading:
https://patchwork.sourceware.org/project/gcc/patch/0e1a740e-46d5-ebfa-36f4-9a069ddf8620@codesourcery.com/

At that time, the patch was rejected, and I didn't have time to make the 
requested edits due to higher priorities.

Co-incidentally, I just started working on this again a week or so ago. 
I now have a patch series nearly ready to go (I was just about to work 
on adding some testcases), but on reading the list this morning I find 
that it conflicts with your patch already posted.

Some of the patch is nearly identical (such as a new IFN with the 
obvious not-an-expander), but not quite. Instead of adding a whole new 
pass I have simply enabled ompdevlow for this case. Also, I didn't need 
to do anything about SIMT for my usecase.

BabelStream "dot" benchmark (gfx90a):

Baseline:   364541 MBytes/sec
Your patch: 354892 MBytes/sec -- same, within noise
My patches: 574802 MBytes/sec -- 1.6x speedup[*]

So, your patch doesn't fix my problem, and I imagine my patch doesn't 
fix your problem (because max_vf remains "1" when offloading to SIMT 
devices).

Only patch 1/3 is actually needed to fix my benchmark. The other two are 
increasingly thorough handling of the other cases.

To do this thing perfectly I think we need to delay the SIMT cases as 
well, so as not to hurt AArch64 hosts, but I still need to figure out 
why your solution is not working for me.

Andrew


[*] My original post claimed a 10x speedup, but that was when amdgcn 
only had V64 vector modes, so setting "max_vf = 16" resulted in total 
vectorizer failure. Now that amdgcn has V16 modes the baseline result is 
much better, but max_vf really does need to be 64.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-openmp-Tune-omp_max_vf-for-offload-targets.patch
Type: text/x-patch
Size: 4496 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20241104/f3142795/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-openmp-use-offload-max_vf-for-chunk_size.patch
Type: text/x-patch
Size: 5122 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20241104/f3142795/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-openmp-Add-IFN_GOMP_MAX_VF.patch
Type: text/x-patch
Size: 3428 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20241104/f3142795/attachment-0002.bin>


More information about the Gcc mailing list