[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Joining ROCm team, ectrans




On 14/10/2024 09:51, Cordell Bloor wrote:
Hi Alastair,

On 2024-10-12 02:07, Alastair McKinstry wrote:
I plan to enable ROCm support for some packages used in weather and climate modelling; in particular ectrans.

Are there good examples and docs on how ROCm works in Debian available yet?

I'd suggest -DCMAKE_HIP_ARCHITECTURES="gfx803;gfx900;gfx906;gfx908;gfx90a;gfx1010;gfx1030;gfx1100;gfx1101;gfx1102" to match the math libraries that ectrans depends on. We could also use your help in getting HIPCXXFLAGS set up in dpkg-dev [2]. Until support for the HIP language exists in dpkg-dev, you might have to copy flags from CXXFLAGS to HIPCXXFLAGS when using CMake's HIP language support.

Is there a list of where these archs came from for the math libraries?
Alternatively, you can use the old-style method for building HIP programs that uses clang or hipcc as the CXX compiler. This requires all the same B-D, but you set CXX=clang++-17 or CXX=hipcc as an environment variable. Typically, you specify the GPU architectures you're building for in this mode by passing -DAMDGPU_TARGETS=<arch>, but it appears that ectrans will use CMAKE_HIP_ARCHITECTURES instead. If there are build flags that cause problems for GPU code, you can prepend -Xarch_host to them in d/rules, like was done for rocSPARSE [2].

There is a CMake package "ecbuild" that ECMWF uses to provide frequently-used detection support.

This might be a useful place foe some of this work.  Or moving the ectrans cmake/ectrans_Find_HIP.cmake and updating it.



Once you've successfully enabled ROCm support in a library, perhaps you could write the docs on this topic. :9

Err, ok.

Thanks

Alastair


Sincerely,
Cory Bloor

[1]: https://github.com/ecmwf-ifs/ectrans/blob/1.5.0/cmake/ectrans_find_hip.cmake
[2]: https://bugs.debian.org/1065439
[3]: https://salsa.debian.org/rocm-team/rocsparse/-/blob/debian/5.7.1-5/debian/rules?ref_type=tags#L7-9

--
Alastair McKinstry,
GPG: 82383CE9165B347C787081A2CBE6BB4E5D9AD3A5
e: alastair@mckinstry.ie, im: @alastair:mckinstry.ie @amckinstry@mastodon.ie

Commander Vimes didn’t like the phrase “The innocent have nothing to fear,”
 believing the innocent had everything to fear, mostly from the guilty but in the longer term
 even more from those who say things like “The innocent have nothing to fear.”
 - T. Pratchett, Snuff


Reply to: