[gmx-developers] A HIP version of gromacs 2018.7

Vedran Miletić vedran at miletic.net
Mon Jan 6 12:05:54 CET 2020


Hi Zhang,

I tried to compile your version on Vega 20 (so it's gfx906 as well) 
with ROCm 3.0 using the command:

cmake -DBUILD_SHARED_LIBS=ON -DGMX_BUILD_FOR_COVERAGE=on 
-DCMAKE_BUILD_TYPE=Release -DGMX_CUDA_NB_SINGLE_COMPILATION_UNIT=on 
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DGMX_MPI=on 
-DGMX_GPU=on -DGMX_OPENMP=on -DGMX_GPU_DETECTION_DONE=on 
-DHIP_TOOLKIT_ROOT_DIR=/opt/rocm/hip -DGMX_SIMD=AUTO 
-DGMX_FFT_LIBRARY=fftw3 -DREGRESSIONTEST_DOWNLOAD=OFF 
-DCMAKE_PREFIX_PATH=/opt/rocm/rocfft/lib/cmake/rocfft/:/opt/rocm/hip/cmake 
-DGMX_DEVELOPER_BUILD=off ..

After removing find_package(rocfft REQUIRED) in 
src/gromacs/CMakeLists.txt which fails due to missing Findrocfft.cmake 
(perhaps you forgot to add the file?), the configuration succeeds, but 
the compilation fails with:

$ make
[  1%] Built target tng_io_zlib
[  1%] Generating git version information
[  1%] Built target git-version-info
[  2%] Built target tng_io_obj
[  2%] Building HIPCC object 
src/gromacs/CMakeFiles/libgromacs.dir/mdlib/nbnxn_cuda/libgromacs_generated_nbnxn_cuda.cu.o
clang-10: warning: argument unused during compilation: 
'--amdgpu-target=gfx906' [-Wunused-command-line-argument]
In file included from 
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu:1:
In file included from /opt/rocm/include/hip/hip_runtime.h:56:
In file included from /opt/rocm/include/hip/hcc_detail/hip_runtime.h:106:
/opt/rocm/include/hip/hcc_detail/texture_functions.h:173:5: warning: 
array designators are a C99 extension [-Wc99-designator]
     [HIP_AD_FORMAT_NOT_INITIALIZED] = 1  ,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from 
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu:1:
In file included from /opt/rocm/include/hip/hip_runtime.h:56:
In file included from /opt/rocm/include/hip/hcc_detail/hip_runtime.h:106:
/opt/rocm/include/hip/hcc_detail/texture_functions.h:173:5: warning: 
array designators are a C99 extension [-Wc99-designator]
     [HIP_AD_FORMAT_NOT_INITIALIZED] = 1  ,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from 
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu:118:
In file included from 
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_pruneonly.cuh:52:
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh:440:12: 
error: no matching function for call to 'lerp'
     return lerp(d01.x, d01.y, fraction);
            ^~~~
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh:423:3: 
note: candidate template ignored: deduced conflicting types for 
parameter 'T' ('Scalar_accessor<[2 * ...], 0>' vs. 'Scalar_accessor<[2 * 
...], 1>')
T lerp(T d0, T d1, T t)
   ^
1 warning and 1 error generated.
CMake Error at libgromacs_generated_nbnxn_cuda.cu.o.cmake:174 (message):
   Error generating file
 
/home/vedranm/workspace/hipified-gromacs/builddir/src/gromacs/CMakeFiles/libgromacs.dir/mdlib/nbnxn_cuda/./libgromacs_generated_nbnxn_cuda.cu.o


src/gromacs/CMakeFiles/libgromacs.dir/build.make:411: recipe for target 
'src/gromacs/CMakeFiles/libgromacs.dir/mdlib/nbnxn_cuda/libgromacs_generated_nbnxn_cuda.cu.o' 
failed
make[2]: *** 
[src/gromacs/CMakeFiles/libgromacs.dir/mdlib/nbnxn_cuda/libgromacs_generated_nbnxn_cuda.cu.o] 
Error 1
CMakeFiles/Makefile2:2886: recipe for target 
'src/gromacs/CMakeFiles/libgromacs.dir/all' failed
make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

Any ideas?

Thanks in advance.

Vedran

05. 01. 2020. u 04:45, 张驭洲 je napisao/la:
> Dear gromacs developers,
> 
> The HIP version of gromacs 2018.7 that I mentioned in my last email yesterday is now avaliable on https://github.com/ipe-zhangyz/hipified-gromacs-2018.7
> I have tested it only on Rocm 2.8.13 and AMD MI50 GPUs because I don't have other test environment.
> Please have a try if you are interested. My configuration commands are in the config.sh file in the top dir of the project. Before you run the cmake configuration, maybe you need to modify the --amdgpu-target parameter in src/gromacs/CMakeLists.txt to satisfy your AMD GPU.
> Any feedback is welcome!
> 
> Sincerely,
> Zhang
> 
> 
> 
> 
>> -----原始邮件-----
>> 发件人: gromacs.org_gmx-developers-request at maillist.sys.kth.se
>> 发送时间: 2020-01-04 17:36:47 (星期六)
>> 收件人: gromacs.org_gmx-developers at maillist.sys.kth.se
>> 抄送:
>> 主题: gromacs.org_gmx-developers Digest, Vol 189, Issue 2
>>
>> Send gromacs.org_gmx-developers mailing list submissions to
>> 	gromacs.org_gmx-developers at maillist.sys.kth.se
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> 	https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers
>>
>> or, via email, send a message with subject or body 'help' to
>> 	gromacs.org_gmx-developers-request at maillist.sys.kth.se
>>
>> You can reach the person managing the list at
>> 	gromacs.org_gmx-developers-owner at maillist.sys.kth.se
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of gromacs.org_gmx-developers digest..."
>>
>>
>> Today's Topics:
>>
>>     1. Is there any hip version of gromacs? (???)
>>     2. Re: Is there any hip version of gromacs? (Benson Muite)
>>     3. Re: Is there any hip version of gromacs? (Erik Lindahl)
>>     4. Re: Is there any hip version of gromacs? (Erik Lindahl)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Sat, 4 Jan 2020 14:49:05 +0800 (GMT+08:00)
>> From: ??? <zhangyuzhou15 at mails.ucas.edu.cn>
>> To: gromacs.org_gmx-developers at maillist.sys.kth.se
>> Subject: [gmx-developers] Is there any hip version of gromacs?
>> Message-ID:
>> 	<4cc7bba1.1db1e.16f6f50862b.Coremail.zhangyuzhou15 at mails.ucas.edu.cn>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Dear gromacs developers,
>>
>> I want to know if there is any HIP version of gromacs.HIP is a thin layer above the AMD Rocm stack, and it allows CUDA code to be converted to portable C++. You can find more details about HIP on https://github.com/ROCm-Developer-Tools/HIP. Currently gromacs runs on AMD GPU via OpenCL,but the performance of the OpenCL version may be worse than the CUDA version.
>>
>> Actually I have a HIP version of gromacs right now, which is converted from 2018.7. I have tested it on AMD MI50 GPUs and get 10%~30% better performance on some test cases than the OpenCL code of gromacs 2019.3. I want to know if there is any official plan to develop HIP version gromacs, or anyone else who is interested in this work.
>>
>>
>>
>>
>> Sincerely,
>>
>> zhang
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20200104/346de9ed/attachment-0001.html>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Sat, 4 Jan 2020 10:52:14 +0300
>> From: Benson Muite <benson_muite at emailplus.org>
>> To: gromacs.org_gmx-developers at maillist.sys.kth.se
>> Subject: Re: [gmx-developers] Is there any hip version of gromacs?
>> Message-ID: <1e9dce47-4468-989d-0197-4399b7d672df at emailplus.org>
>> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>>
>> Hi Zhang,
>>
>> This is interesting, though? maintaining a large number of accelerated
>> versions may be challenging. OpenCL is more portable than HIP, Vulkan
>> looks like a possible well supported accelerator API. Is your code
>> openly available?
>>
>> Benson
>>
>> On 1/4/20 9:49 AM, ??? wrote:
>>>
>>> Dear?gromacs developers,
>>>
>>> I want to know if there is any?HIP version of gromacs.HIP is a thin
>>> layer above the AMD Rocm stack, and it allows CUDA code to be
>>> converted to portable C++. You can find?more details about HIP?on
>>> https://github.com/ROCm-Developer-Tools/HIP.?Currently gromacs runs on
>>> AMD GPU via OpenCL,but the performance of the OpenCL version may be
>>> worse than the CUDA version.
>>>
>>> Actually I have a HIP version of gromacs right now, which is converted
>>> from 2018.7. I have tested it on AMD MI50 GPUs and get 10%~30% better
>>> performance on some test cases than the OpenCL code of gromacs 2019.3.
>>> I want to know if there is any official plan to develop HIP version
>>> gromacs, or anyone else who is interested in this work.
>>>
>>>
>>> Sincerely,
>>>
>>> zhang
>>>
>>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20200104/7a7bea5c/attachment-0001.html>
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Sat, 4 Jan 2020 10:36:42 +0100
>> From: Erik Lindahl <erik.lindahl at gmail.com>
>> To: gmx-developers at gromacs.org
>> Cc: gromacs.org_gmx-developers at maillist.sys.kth.se
>> Subject: Re: [gmx-developers] Is there any hip version of gromacs?
>> Message-ID: <33886056-E14F-4331-AA8B-29B6C741A91A at gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Hi,
>>
>> Without going into too much details (which I can't :-), there have been some efforts that were not too happy with hip performance.
>>
>> We haven't yet had time to look into it ourselves, but it'son our radar, and with at least one concrete hip port example (say, for one gromacs kernel) where it's appreciably faster than OpenCL it would likely get higher priority in the team.
>>
>> So, the short story is that it's not supported in release 2020, but it might appear in master during the year.
>>
>> Cheers,
>>
>> Erik
>>
>>
>>
>> --
>> Erik Lindahl <erik.lindahl at scilifelab.se>
>> Professor of Biophysics
>> Science for Life Laboratory
>> Stockholm University & KTH
>> Office (SciLifeLab): +46 8 524 81567
>> Cell (Sweden): +46 73 4618050
>> Cell (US): 1 267 307 8746
>>
>>
>>> On Jan 4, 2020, at 08:53, Benson Muite <benson_muite at emailplus.org> wrote:
>>>
>>> ?
>>> Hi Zhang,
>>>
>>> This is interesting, though  maintaining a large number of accelerated versions may be challenging. OpenCL is more portable than HIP, Vulkan looks like a possible well supported accelerator API. Is your code openly available?
>>>
>>> Benson
>>>
>>>> On 1/4/20 9:49 AM, ??? wrote:
>>>> Dear gromacs developers,
>>>>
>>>> I want to know if there is any HIP version of gromacs.HIP is a thin layer above the AMD Rocm stack, and it allows CUDA code to be converted to portable C++. You can find more details about HIP on https://github.com/ROCm-Developer-Tools/HIP. Currently gromacs runs on AMD GPU via OpenCL,but the performance of the OpenCL version may be worse than the CUDA version.
>>>>
>>>> Actually I have a HIP version of gromacs right now, which is converted from 2018.7. I have tested it on AMD MI50 GPUs and get 10%~30% better performance on some test cases than the OpenCL code of gromacs 2019.3. I want to know if there is any official plan to develop HIP version gromacs, or anyone else who is interested in this work.
>>>>
>>>>
>>>>
>>>> Sincerely,
>>>> zhang
>>>>
>>>>
>>>>
>>> -- 
>>> Gromacs Developers mailing list
>>>
>>> * Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before posting!
>>>
>>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>>>
>>> * For (un)subscribe requests visit
>>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers or send a mail to gmx-developers-request at gromacs.org.
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20200104/c0ede1e6/attachment-0001.html>
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Sat, 4 Jan 2020 10:36:42 +0100
>> From: Erik Lindahl <erik.lindahl at gmail.com>
>> To: gmx-developers at gromacs.org
>> Cc: gromacs.org_gmx-developers at maillist.sys.kth.se
>> Subject: Re: [gmx-developers] Is there any hip version of gromacs?
>> Message-ID: <33886056-E14F-4331-AA8B-29B6C741A91A at gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Hi,
>>
>> Without going into too much details (which I can't :-), there have been some efforts that were not too happy with hip performance.
>>
>> We haven't yet had time to look into it ourselves, but it'son our radar, and with at least one concrete hip port example (say, for one gromacs kernel) where it's appreciably faster than OpenCL it would likely get higher priority in the team.
>>
>> So, the short story is that it's not supported in release 2020, but it might appear in master during the year.
>>
>> Cheers,
>>
>> Erik
>>
>>
>>
>> --
>> Erik Lindahl <erik.lindahl at scilifelab.se>
>> Professor of Biophysics
>> Science for Life Laboratory
>> Stockholm University & KTH
>> Office (SciLifeLab): +46 8 524 81567
>> Cell (Sweden): +46 73 4618050
>> Cell (US): 1 267 307 8746
>>
>>
>>> On Jan 4, 2020, at 08:53, Benson Muite <benson_muite at emailplus.org> wrote:
>>>
>>> ?
>>> Hi Zhang,
>>>
>>> This is interesting, though  maintaining a large number of accelerated versions may be challenging. OpenCL is more portable than HIP, Vulkan looks like a possible well supported accelerator API. Is your code openly available?
>>>
>>> Benson
>>>
>>>> On 1/4/20 9:49 AM, ??? wrote:
>>>> Dear gromacs developers,
>>>>
>>>> I want to know if there is any HIP version of gromacs.HIP is a thin layer above the AMD Rocm stack, and it allows CUDA code to be converted to portable C++. You can find more details about HIP on https://github.com/ROCm-Developer-Tools/HIP. Currently gromacs runs on AMD GPU via OpenCL,but the performance of the OpenCL version may be worse than the CUDA version.
>>>>
>>>> Actually I have a HIP version of gromacs right now, which is converted from 2018.7. I have tested it on AMD MI50 GPUs and get 10%~30% better performance on some test cases than the OpenCL code of gromacs 2019.3. I want to know if there is any official plan to develop HIP version gromacs, or anyone else who is interested in this work.
>>>>
>>>>
>>>>
>>>> Sincerely,
>>>> zhang
>>>>
>>>>
>>>>
>>> -- 
>>> Gromacs Developers mailing list
>>>
>>> * Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before posting!
>>>
>>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>>>
>>> * For (un)subscribe requests visit
>>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers or send a mail to gmx-developers-request at gromacs.org.
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20200104/c0ede1e6/attachment-0002.html>
>>
>> ------------------------------
>>
>> -- 
>> Gromacs Developers mailing list
>>
>> * Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before posting!
>>
>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>>
>> * For (un)subscribe requests visit
>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers or send a mail to gmx-developers-request at gromacs.org.
>>
>> End of gromacs.org_gmx-developers Digest, Vol 189, Issue 2
>> **********************************************************

-- 
Vedran Miletić
vedran.miletic.net


More information about the gromacs.org_gmx-developers mailing list