-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix HIP, hwloc and test_install #712
Conversation
ed91ad7
to
e447828
Compare
Could you also update the ReadMe for hip and maybe INSTALL for hwloc? |
All requested changes should have been done for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Did you figure out why @nbeams was having an issue with the get_pci_device
function in MFEM ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general.
I would like check whether hip test is still compiled with correct arch flags or not.
For RPATH thing, I would like to depends on LD_LIBRARY_PATH
by default.
also, I think if we upload compiled ginkgo library via github release, the package should use LD_LIBRARY_PATH
to find hip stuff.
the one benefit of embedding all info into ginkgo is maybe for application with many library which use different backend
libs.
(I am not sure whether it really works or not)
cmake/create_test.cmake
Outdated
# With how HIP works, to prevent redifinition we need to comment these. | ||
# They might need to be used later though. | ||
#HIPCC_OPTIONS ${GINKGO_HIPCC_OPTIONS} | ||
#NVCC_OPTIONS ${GINKGO_HIP_NVCC_OPTIONS} | ||
#CLANG_OPTIONS ${GINKGO_HIP_CLANG_OPTIONS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean redefinition here?
If it does not contain these option, can it get the arch flag and optimization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have trouble explaining how it works but indeed with the current setting everything is passed correctly. I can only explain it as a bug in FindHIP.cmake, that bug would explain why we have so many duplications of all the flags as well.
For example:
/opt/rocm-4.0.0/hip/bin/hipcc -M /home/terry/ginkgo/hip/test/base/hip_executor_topology.hip.cpp
-o /home/terry/ginkgo/build/hip/test/base/CMakeFiles/hip_test_base_hip_executor_topology.dir//hip_test_base_hip_executor_topology_generated_hip_executor_topology.hip.cpp.o.depend.pre
-std=c++14 -fPIC --amdgpu-target=gfx906 --amdgpu-target=gfx908 -fPIC -O2 -DNDEBUG
-I/home/terry/ginkgo/build -I/opt/rocm-4.0.0/include -I/opt/rocm-4.0.0/hipblas/include
-I/opt/rocm-4.0.0/hiprand/include -I/opt/rocm-4.0.0/hipsparse/include -I/home/terry/ginkgo/build/include
-I/home/terry/ginkgo/include -I/home/terry/ginkgo -I/usr/local/include -I/home/terry/ginkgo/build/include
-I/home/terry/ginkgo/include -I/home/terry/ginkgo -I/usr/local/include -I/usr/local/include
-I/home/terry/ginkgo/build/include -I/home/terry/ginkgo/include -I/home/terry/ginkgo -I/usr/local/include
-I/home/terry/ginkgo/build/include -I/home/terry/ginkgo/include -I/home/terry/ginkgo -I/usr/local/include
-I/home/terry/ginkgo/build/include -I/home/terry/ginkgo/include -I/home/terry/ginkgo -I/usr/local/include
-I/opt/rocm-4.0.0/hip/include -I/home/terry/ginkgo/build/include -I/home/terry/ginkgo/include
-I/home/terry/ginkgo -I/usr/local/include -I/home/terry/ginkgo/build/include -I/home/terry/ginkgo/include
-I/home/terry/ginkgo -I/usr/local/include -I/home/terry/ginkgo/build/third_party/gtest/src/googletest/include
-I/home/terry/ginkgo/build/third_party/gtest/src/googletest/include
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that If I pass the flags again (at least HIPCC_OPTIONS), there is two std=c++14
and somehow that makes the command invalid. I can maybe reactivate the other flags at least for safety?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't try it to make 100% sure but I think the problem is due to these:
https://github.com/ROCm-Developer-Tools/HIP/blob/main/cmake/FindHIP.cmake#L463-L466
https://github.com/ROCm-Developer-Tools/HIP/blob/main/cmake/FindHIP.cmake#L381-L397
By looking only at these two, since no reset seem to be done, they always append the flags that they find to the global variables HIP_HIPCC_FLAGS
and whatnot. The macro doing this is called whenever we call a hip_add_library
or hip_add_executable
. Thus, when we do hip_add_executable
for the test, we already had the definitions from libginkgo_hip.so
which get reused and thus we do not need to pass the options again (and it creates an error in the case of -std=c++14
).
If they used a function that would make things much simpler and they could use a scoped variable to manage the flags that they find. Or they could just add them to the property of the object they are defining. I do not understand what they are doing.
In any case, I will try to put them back and see if it works, although that will duplicate everything at least twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness, here is the failing build, I think it's only nvcc
which creates issues so I will make a special case out of it:
https://gitlab.com/ginkgo-project/ginkgo-public-ci/-/jobs/1060533273
nvcc fatal : redefinition of argument 'std'
@@ -101,63 +101,31 @@ function(ginkgo_create_cuda_test test_name) | |||
add_test(NAME ${REL_BINARY_DIR}/${test_name} COMMAND ${TEST_TARGET_NAME}) | |||
endfunction(ginkgo_create_cuda_test) | |||
|
|||
function(ginkgo_create_hip_test_special_linkage test_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I also put the previous comments link here for reference.
#393 (comment)
# --cuda-gpu-arch=gfx900;--cuda-gpu-arch=gfx906 | ||
set_target_properties(hip::device PROPERTIES INTERFACE_LINK_LIBRARIES "hip::host") | ||
if(GINKGO_BUILD_HIP) | ||
find_package(HIP REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to add version check here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HIP version isn't the same as ROCm and in some cases defaults to 0 so this is hard to do.
The |
@nbeams , but it was when you were building this branch and not develop right ? Do you still get it with the current status of the |
I just tried with the latest version of this branch and also the latest version of develop; they both behave the same way. If I compile with gcc (9.2.0), I see the errors, but if I compile with ROCm clang, I don't. It only happens when building the examples, e.g.
So whatever is happening, whether it's my configuration on this machine or the hwloc I'm using or something else, it's not related to any changes in this branch. |
I see. thanks. I will look into that. |
0bcba17
to
456b16f
Compare
9c45bee
to
0afbd93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Only a few clarifying questions
cmake/install_helpers.cmake
Outdated
if (APPLE) | ||
set(ORIGIN_OR_LOADER_PATH "@loader_path") | ||
else() | ||
set(ORIGIN_OR_LOADER_PATH "$ORIGIN") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this would be a no-op on Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes there is anyway no RPATH support on Windows (except some experimental one somewhere).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
side note, Windows can use the registry to register the library path.
I do not want to change any system settings, so I do not dig into this direction.
cmake/install_helpers.cmake
Outdated
# libraries are present in the directory, these will be used first and | ||
# foremost and the environment variable `LD_LIBRARY_PATH` will have no | ||
# effect. | ||
function(ginkgo_add_install_rpath name subdir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see the subdir parameter being used anywhere. Is it still relevant here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it's a relica of ginkgo_install_library
where it's also useless now. Since this has been annoying me for a while, I'm removing this parameter everywhere.
if (GINKGO_BUILD_HIP AND GINKGO_HIP_PLATFORM MATCHES "hcc") | ||
set(RPATH_ADD_HIP_PATH "${HIP_PATH}/lib") | ||
list(APPEND GKO_RPATH_ADDITIONS "${HIP_PATH}/lib") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we always add this to the RPATH, or just in case GINKGO_INSTALL_RPATH_DEPENDENCIES is ON?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is passed to the ginkgo_install_library
which gets then passed to the ginkgo_add_install_rpath
, and nothing gets done when we are not either in BUILD_SHARED_LIBS
or GINKGO_INSTALL_RPATH
or GINKGO_INSTALL_RPATH_DEPENDENCIES
(where ARGN is used).
https://github.com/ginkgo-project/ginkgo/blob/fix_hip/cmake/install_helpers.cmake#L20-L21
https://github.com/ginkgo-project/ginkgo/blob/fix_hip/cmake/install_helpers.cmake#L27-L30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it already did. it passed by ARGN.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add more description on that topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Do you think it is possible to add some related tests for rpath check? (In CI not cmake, I guess)
# NVCC_OPTIONS ${GINKGO_HIP_NVCC_OPTIONS} | ||
# CLANG_OPTIONS ${GINKGO_HIP_CLANG_OPTIONS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could these two also uncomment if the problem is only in HIPCC_OPTIONS?
I think we use GINKGO_HIP_NVCC_OPTIONS to pass the cuda architecture flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's in everything. HIPCC
is in the name of the macro but it's used for all options, including NVCC
and CLANG
. The main issue actually comes from nvcc
(also clang sometimes if I recall) which really dislikes having two times some important flags like -std=c++14
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I also see what you wrote in the previous conversation.
We still have these flag added by hip on Nvidia (including optimization/arch).
The benchmark and test should have the same settings if they do not fix or change hip.
If we need to compare hip and nvcc on NVIDIA GPU again, we should remember to check these flags are still in library/benchmark/test.
Thanks
cmake/install_helpers.cmake
Outdated
set(ORIGIN_OR_LOADER_PATH "@loader_path") | ||
else() | ||
set(ORIGIN_OR_LOADER_PATH "$ORIGIN") | ||
if (GINKGO_INSTALL_RPATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If GINKGO_INTSALL_RPATH
is OFF, ginkgo does not include rpath information no matter if the other two config set or not, right?
If it is, adding it to install description might be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's the case. I thought it was already clear, I will add more details then.
if (GINKGO_BUILD_HIP AND GINKGO_HIP_PLATFORM MATCHES "hcc") | ||
set(RPATH_ADD_HIP_PATH "${HIP_PATH}/lib") | ||
list(APPEND GKO_RPATH_ADDITIONS "${HIP_PATH}/lib") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it already did. it passed by ARGN.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the topic of testing RPATH in CI, I don't think it can be easily done since it depends on platform, where libraries are located, etc...
cmake/install_helpers.cmake
Outdated
set(ORIGIN_OR_LOADER_PATH "@loader_path") | ||
else() | ||
set(ORIGIN_OR_LOADER_PATH "$ORIGIN") | ||
if (GINKGO_INSTALL_RPATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's the case. I thought it was already clear, I will add more details then.
if (GINKGO_BUILD_HIP AND GINKGO_HIP_PLATFORM MATCHES "hcc") | ||
set(RPATH_ADD_HIP_PATH "${HIP_PATH}/lib") | ||
list(APPEND GKO_RPATH_ADDITIONS "${HIP_PATH}/lib") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add more description on that topic.
cmake/install_helpers.cmake
Outdated
# libraries are present in the directory, these will be used first and | ||
# foremost and the environment variable `LD_LIBRARY_PATH` will have no | ||
# effect. | ||
function(ginkgo_add_install_rpath name subdir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it's a relica of ginkgo_install_library
where it's also useless now. Since this has been annoying me for a while, I'm removing this parameter everywhere.
# NVCC_OPTIONS ${GINKGO_HIP_NVCC_OPTIONS} | ||
# CLANG_OPTIONS ${GINKGO_HIP_CLANG_OPTIONS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's in everything. HIPCC
is in the name of the macro but it's used for all options, including NVCC
and CLANG
. The main issue actually comes from nvcc
(also clang sometimes if I recall) which really dislikes having two times some important flags like -std=c++14
.
On hwloc ________ There were a few issues with the CMake hwloc setup. + hwloc was always built even when a valid version already existed on the system. + The FindHWLOC module had a few issues in terms of organization, search paths as well as variable management. This has been fixed. + hwloc is a public dependency of Ginkgo but was not installed when we use the one from our build directory, that would create errors with missing libraries in some cases. + The `HWLOC_XMLFILE` should not be managed by Ginkgo, hwloc already takes care of it, if the environment variable `HWLOC_XMLFILE` is set, it uses that as base, otherwise it uses the machine topology it can detect. + The core/devices which are always compiled were moved into their own root directory. This better reflects the new library that it creates as well as the fact all libraries depend on it. On test install ________ Test install was missing a HIP version which I added. In addition, the commands were not properly triggered thus only the base (non CUDA version) was tested, that is now fixed. On RPATH management _________ For HIP and HWLOC, the INSTALL_RPATH property is now properly managed. Since all libraries require HWLOC, this setting is added directly into `ginkgo_install_libraries`. For HIP, the setting is added only when actually building HIP. On HIP ________ This part saw a lot of changes. + ROCm < 3.5 support is dropped as it is now old and all HPC clusters always update the ROCm version since they know the ecosystem is somewhat unstable. + Instead of linking against `hip::device` in `ginkgo_hip`, I link against `libamdhip64.so` publicly. + In general, the purpose of this rework is to depend more on CMake transitive properties such that we remove special cases. Thanks to this and the previous point as well, it is possible to remove entirely the `hip_helpers.cmake` file and remove all of the bans we were doing. + Thanks to relying on transitive properties, there is no need for the `special_linkage` test case anymore. + Instead of building the `RPATH_FOR_HIP` chain, in Ginkgo everything uses the `CXX` language for linking, which properly takes into account RPATH information unlike when liking with the `HIP` language. For users, a simple string `GINKGO_INSTALL_RPATH_FOR_HIP` is provided which is a linking flag to be given to the `HIP` language linker after installing Ginkgo. + In general, there is also better management or relying more on the defaults for some environment variables and HIP variables. Open issues ________ An annoying issue (still), although it's mitigated thanks to linking publicly against `libamdhip64.so` which doesn't create inconvenience to the user, is that we have to include `hip/hip_runtime.hpp` in our public headers (to find `__forceinline__` as well as `HIP_DEVICE_COMPILE`, see https://github.com/ginkgo-project/ginkgo/blob/develop/include/ginkgo/core/base/types.hpp#L46-L85. In addition, the `GKO_ASSERT` cannot be reworked as well otherwise it creates mysterious issues in the `check_headers` test, see: https://gitlab.com/ginkgo-project/ginkgo-public-ci/-/jobs/1073846520
+ Change behavior and name of the ginkgo_core_device library (to ginkgo_device). + Update the documentation in INSTALL.md and README.md and in cmake/install_helpers.cmake. + Fix some code style issues. Co-authored-by: Yuhsiang Tsai <yhmtsai@gmail.com> Co-authored-by: Pratik Nayak <pratikvn@protonmail.com> Co-authored-by: Tobias Ribizel <ribizel@kit.edu>
+ Add documentation to the new RPATH macro in install_helpers. + Remove the usage of `subdir` in `ginkgo_install_library` and the new `ginkgo_add_install_rpath` since this is unused. + Some minor improvements to other documentations. Co-authored-by: Yuhsiang Tsai <yhmtsai@gmail.com> Co-authored-by: Tobias Ribizel <ribizel@kit.edu>
SonarCloud Quality Gate failed. |
Ginkgo release 1.4.0 The Ginkgo team is proud to announce the new Ginkgo minor release 1.4.0. This release brings most of the Ginkgo functionality to the Intel DPC++ ecosystem which enables Intel-GPU and CPU execution. The only Ginkgo features which have not been ported yet are some preconditioners. Ginkgo's mixed-precision support is greatly enhanced thanks to: 1. The new Accessor concept, which allows writing kernels featuring on-the-fly memory compression, among other features. The accessor can be used as header-only, see the [accessor BLAS benchmarks repository](https://github.com/ginkgo-project/accessor-BLAS/tree/develop) as a usage example. 2. All LinOps now transparently support mixed-precision execution. By default, this is done through a temporary copy which may have a performance impact but already allows mixed-precision research. Native mixed-precision ELL kernels are implemented which do not see this cost. The accessor is also leveraged in a new CB-GMRES solver which allows for performance improvements by compressing the Krylov basis vectors. Many other features have been added to Ginkgo, such as reordering support, a new IDR solver, Incomplete Cholesky preconditioner, matrix assembly support (only CPU for now), machine topology information, and more! Supported systems and requirements: + For all platforms, cmake 3.13+ + C++14 compliant compiler + Linux and MacOS + gcc: 5.3+, 6.3+, 7.3+, all versions after 8.1+ + clang: 3.9+ + Intel compiler: 2018+ + Apple LLVM: 8.0+ + CUDA module: CUDA 9.0+ + HIP module: ROCm 3.5+ + DPC++ module: Intel OneAPI 2021.3. Set the CXX compiler to `dpcpp`. + Windows + MinGW and Cygwin: gcc 5.3+, 6.3+, 7.3+, all versions after 8.1+ + Microsoft Visual Studio: VS 2019 + CUDA module: CUDA 9.0+, Microsoft Visual Studio + OpenMP module: MinGW or Cygwin. Algorithm and important feature additions: + Add a new DPC++ Executor for SYCL execution and other base utilities [#648](#648), [#661](#661), [#757](#757), [#832](#832) + Port matrix formats, solvers and related kernels to DPC++. For some kernels, also make use of a shared kernel implementation for all executors (except Reference). [#710](#710), [#799](#799), [#779](#779), [#733](#733), [#844](#844), [#843](#843), [#789](#789), [#845](#845), [#849](#849), [#855](#855), [#856](#856) + Add accessors which allow multi-precision kernels, among other things. [#643](#643), [#708](#708) + Add support for mixed precision operations through apply in all LinOps. [#677](#677) + Add incomplete Cholesky factorizations and preconditioners as well as some improvements to ILU. [#672](#672), [#837](#837), [#846](#846) + Add an AMGX implementation and kernels on all devices but DPC++. [#528](#528), [#695](#695), [#860](#860) + Add a new mixed-precision capability solver, Compressed Basis GMRES (CB-GMRES). [#693](#693), [#763](#763) + Add the IDR(s) solver. [#620](#620) + Add a new fixed-size block CSR matrix format (for the Reference executor). [#671](#671), [#730](#730) + Add native mixed-precision support to the ELL format. [#717](#717), [#780](#780) + Add Reverse Cuthill-McKee reordering [#500](#500), [#649](#649) + Add matrix assembly support on CPUs. [#644](#644) + Extends ISAI from triangular to general and spd matrices. [#690](#690) Other additions: + Add the possibility to apply real matrices to complex vectors. [#655](#655), [#658](#658) + Add functions to compute the absolute of a matrix format. [#636](#636) + Add symmetric permutation and improve existing permutations. [#684](#684), [#657](#657), [#663](#663) + Add a MachineTopology class with HWLOC support [#554](#554), [#697](#697) + Add an implicit residual norm criterion. [#702](#702), [#818](#818), [#850](#850) + Row-major accessor is generalized to more than 2 dimensions and a new "block column-major" accessor has been added. [#707](#707) + Add an heat equation example. [#698](#698), [#706](#706) + Add ccache support in CMake and CI. [#725](#725), [#739](#739) + Allow tuning and benchmarking variables non intrusively. [#692](#692) + Add triangular solver benchmark [#664](#664) + Add benchmarks for BLAS operations [#772](#772), [#829](#829) + Add support for different precisions and consistent index types in benchmarks. [#675](#675), [#828](#828) + Add a Github bot system to facilitate development and PR management. [#667](#667), [#674](#674), [#689](#689), [#853](#853) + Add Intel (DPC++) CI support and enable CI on HPC systems. [#736](#736), [#751](#751), [#781](#781) + Add ssh debugging for Github Actions CI. [#749](#749) + Add pipeline segmentation for better CI speed. [#737](#737) Changes: + Add a Scalar Jacobi specialization and kernels. [#808](#808), [#834](#834), [#854](#854) + Add implicit residual log for solvers and benchmarks. [#714](#714) + Change handling of the conjugate in the dense dot product. [#755](#755) + Improved Dense stride handling. [#774](#774) + Multiple improvements to the OpenMP kernels performance, including COO, an exclusive prefix sum, and more. [#703](#703), [#765](#765), [#740](#740) + Allow specialization of submatrix and other dense creation functions in solvers. [#718](#718) + Improved Identity constructor and treatment of rectangular matrices. [#646](#646) + Allow CUDA/HIP executors to select allocation mode. [#758](#758) + Check if executors share the same memory. [#670](#670) + Improve test install and smoke testing support. [#721](#721) + Update the JOSS paper citation and add publications in the documentation. [#629](#629), [#724](#724) + Improve the version output. [#806](#806) + Add some utilities for dim and span. [#821](#821) + Improved solver and preconditioner benchmarks. [#660](#660) + Improve benchmark timing and output. [#669](#669), [#791](#791), [#801](#801), [#812](#812) Fixes: + Sorting fix for the Jacobi preconditioner. [#659](#659) + Also log the first residual norm in CGS [#735](#735) + Fix BiCG and HIP CSR to work with complex matrices. [#651](#651) + Fix Coo SpMV on strided vectors. [#807](#807) + Fix segfault of extract_diagonal, add short-and-fat test. [#769](#769) + Fix device_reset issue by moving counter/mutex to device. [#810](#810) + Fix `EnableLogging` superclass. [#841](#841) + Support ROCm 4.1.x and breaking HIP_PLATFORM changes. [#726](#726) + Decreased test size for a few device tests. [#742](#742) + Fix multiple issues with our CMake HIP and RPATH setup. [#712](#712), [#745](#745), [#709](#709) + Cleanup our CMake installation step. [#713](#713) + Various simplification and fixes to the Windows CMake setup. [#720](#720), [#785](#785) + Simplify third-party integration. [#786](#786) + Improve Ginkgo device arch flags management. [#696](#696) + Other fixes and improvements to the CMake setup. [#685](#685), [#792](#792), [#705](#705), [#836](#836) + Clarification of dense norm documentation [#784](#784) + Various development tools fixes and improvements [#738](#738), [#830](#830), [#840](#840) + Make multiple operators/constructors explicit. [#650](#650), [#761](#761) + Fix some issues, memory leaks and warnings found by MSVC. [#666](#666), [#731](#731) + Improved solver memory estimates and consistent iteration counts [#691](#691) + Various logger improvements and fixes [#728](#728), [#743](#743), [#754](#754) + Fix for ForwardIterator requirements in iterator_factory. [#665](#665) + Various benchmark fixes. [#647](#647), [#673](#673), [#722](#722) + Various CI fixes and improvements. [#642](#642), [#641](#641), [#795](#795), [#783](#783), [#793](#793), [#852](#852) Related PR: #857
Release 1.4.0 to master The Ginkgo team is proud to announce the new Ginkgo minor release 1.4.0. This release brings most of the Ginkgo functionality to the Intel DPC++ ecosystem which enables Intel-GPU and CPU execution. The only Ginkgo features which have not been ported yet are some preconditioners. Ginkgo's mixed-precision support is greatly enhanced thanks to: 1. The new Accessor concept, which allows writing kernels featuring on-the-fly memory compression, among other features. The accessor can be used as header-only, see the [accessor BLAS benchmarks repository](https://github.com/ginkgo-project/accessor-BLAS/tree/develop) as a usage example. 2. All LinOps now transparently support mixed-precision execution. By default, this is done through a temporary copy which may have a performance impact but already allows mixed-precision research. Native mixed-precision ELL kernels are implemented which do not see this cost. The accessor is also leveraged in a new CB-GMRES solver which allows for performance improvements by compressing the Krylov basis vectors. Many other features have been added to Ginkgo, such as reordering support, a new IDR solver, Incomplete Cholesky preconditioner, matrix assembly support (only CPU for now), machine topology information, and more! Supported systems and requirements: + For all platforms, cmake 3.13+ + C++14 compliant compiler + Linux and MacOS + gcc: 5.3+, 6.3+, 7.3+, all versions after 8.1+ + clang: 3.9+ + Intel compiler: 2018+ + Apple LLVM: 8.0+ + CUDA module: CUDA 9.0+ + HIP module: ROCm 3.5+ + DPC++ module: Intel OneAPI 2021.3. Set the CXX compiler to `dpcpp`. + Windows + MinGW and Cygwin: gcc 5.3+, 6.3+, 7.3+, all versions after 8.1+ + Microsoft Visual Studio: VS 2019 + CUDA module: CUDA 9.0+, Microsoft Visual Studio + OpenMP module: MinGW or Cygwin. Algorithm and important feature additions: + Add a new DPC++ Executor for SYCL execution and other base utilities [#648](#648), [#661](#661), [#757](#757), [#832](#832) + Port matrix formats, solvers and related kernels to DPC++. For some kernels, also make use of a shared kernel implementation for all executors (except Reference). [#710](#710), [#799](#799), [#779](#779), [#733](#733), [#844](#844), [#843](#843), [#789](#789), [#845](#845), [#849](#849), [#855](#855), [#856](#856) + Add accessors which allow multi-precision kernels, among other things. [#643](#643), [#708](#708) + Add support for mixed precision operations through apply in all LinOps. [#677](#677) + Add incomplete Cholesky factorizations and preconditioners as well as some improvements to ILU. [#672](#672), [#837](#837), [#846](#846) + Add an AMGX implementation and kernels on all devices but DPC++. [#528](#528), [#695](#695), [#860](#860) + Add a new mixed-precision capability solver, Compressed Basis GMRES (CB-GMRES). [#693](#693), [#763](#763) + Add the IDR(s) solver. [#620](#620) + Add a new fixed-size block CSR matrix format (for the Reference executor). [#671](#671), [#730](#730) + Add native mixed-precision support to the ELL format. [#717](#717), [#780](#780) + Add Reverse Cuthill-McKee reordering [#500](#500), [#649](#649) + Add matrix assembly support on CPUs. [#644](#644) + Extends ISAI from triangular to general and spd matrices. [#690](#690) Other additions: + Add the possibility to apply real matrices to complex vectors. [#655](#655), [#658](#658) + Add functions to compute the absolute of a matrix format. [#636](#636) + Add symmetric permutation and improve existing permutations. [#684](#684), [#657](#657), [#663](#663) + Add a MachineTopology class with HWLOC support [#554](#554), [#697](#697) + Add an implicit residual norm criterion. [#702](#702), [#818](#818), [#850](#850) + Row-major accessor is generalized to more than 2 dimensions and a new "block column-major" accessor has been added. [#707](#707) + Add an heat equation example. [#698](#698), [#706](#706) + Add ccache support in CMake and CI. [#725](#725), [#739](#739) + Allow tuning and benchmarking variables non intrusively. [#692](#692) + Add triangular solver benchmark [#664](#664) + Add benchmarks for BLAS operations [#772](#772), [#829](#829) + Add support for different precisions and consistent index types in benchmarks. [#675](#675), [#828](#828) + Add a Github bot system to facilitate development and PR management. [#667](#667), [#674](#674), [#689](#689), [#853](#853) + Add Intel (DPC++) CI support and enable CI on HPC systems. [#736](#736), [#751](#751), [#781](#781) + Add ssh debugging for Github Actions CI. [#749](#749) + Add pipeline segmentation for better CI speed. [#737](#737) Changes: + Add a Scalar Jacobi specialization and kernels. [#808](#808), [#834](#834), [#854](#854) + Add implicit residual log for solvers and benchmarks. [#714](#714) + Change handling of the conjugate in the dense dot product. [#755](#755) + Improved Dense stride handling. [#774](#774) + Multiple improvements to the OpenMP kernels performance, including COO, an exclusive prefix sum, and more. [#703](#703), [#765](#765), [#740](#740) + Allow specialization of submatrix and other dense creation functions in solvers. [#718](#718) + Improved Identity constructor and treatment of rectangular matrices. [#646](#646) + Allow CUDA/HIP executors to select allocation mode. [#758](#758) + Check if executors share the same memory. [#670](#670) + Improve test install and smoke testing support. [#721](#721) + Update the JOSS paper citation and add publications in the documentation. [#629](#629), [#724](#724) + Improve the version output. [#806](#806) + Add some utilities for dim and span. [#821](#821) + Improved solver and preconditioner benchmarks. [#660](#660) + Improve benchmark timing and output. [#669](#669), [#791](#791), [#801](#801), [#812](#812) Fixes: + Sorting fix for the Jacobi preconditioner. [#659](#659) + Also log the first residual norm in CGS [#735](#735) + Fix BiCG and HIP CSR to work with complex matrices. [#651](#651) + Fix Coo SpMV on strided vectors. [#807](#807) + Fix segfault of extract_diagonal, add short-and-fat test. [#769](#769) + Fix device_reset issue by moving counter/mutex to device. [#810](#810) + Fix `EnableLogging` superclass. [#841](#841) + Support ROCm 4.1.x and breaking HIP_PLATFORM changes. [#726](#726) + Decreased test size for a few device tests. [#742](#742) + Fix multiple issues with our CMake HIP and RPATH setup. [#712](#712), [#745](#745), [#709](#709) + Cleanup our CMake installation step. [#713](#713) + Various simplification and fixes to the Windows CMake setup. [#720](#720), [#785](#785) + Simplify third-party integration. [#786](#786) + Improve Ginkgo device arch flags management. [#696](#696) + Other fixes and improvements to the CMake setup. [#685](#685), [#792](#792), [#705](#705), [#836](#836) + Clarification of dense norm documentation [#784](#784) + Various development tools fixes and improvements [#738](#738), [#830](#830), [#840](#840) + Make multiple operators/constructors explicit. [#650](#650), [#761](#761) + Fix some issues, memory leaks and warnings found by MSVC. [#666](#666), [#731](#731) + Improved solver memory estimates and consistent iteration counts [#691](#691) + Various logger improvements and fixes [#728](#728), [#743](#743), [#754](#754) + Fix for ForwardIterator requirements in iterator_factory. [#665](#665) + Various benchmark fixes. [#647](#647), [#673](#673), [#722](#722) + Various CI fixes and improvements. [#642](#642), [#641](#641), [#795](#795), [#783](#783), [#793](#793), [#852](#852) Related PR: #866
HIP overhaul, Hwloc and test_install fixes.
On hwloc
There were a few issues with the CMake hwloc setup.
the system.
paths as well as variable management. This has been fixed.
use the one from our build directory, that would create errors with
missing libraries in some cases.
HWLOC_XMLFILE
should not be managed by Ginkgo, hwloc alreadytakes care of it, if the environment variable
HWLOC_XMLFILE
is set, ituses that as base, otherwise it uses the machine topology it can
detect.
root directory. This better reflects the new library that it creates as
well as the fact all libraries depend on it.
On test install
Test install was missing a HIP version which I added. In addition, the
commands were not properly triggered thus only the base (non CUDA
version) was tested, that is now fixed.
On HIP
This part saw a lot of changes.
always update the ROCm version since they know the ecosystem is somewhat
unstable.
hip::device
inginkgo_hip
, I linkagainst
libamdhip64.so
publicly.transitive properties such that we remove special cases. Thanks to this
and the previous point as well, it is possible to remove entirely the
hip_helpers.cmake
file and remove all of the bans we were doing.special_linkage
test case anymore.RPATH_FOR_HIP
chain, in Ginkgo everythinguses the
CXX
language for linking, which properly takes into accountRPATH information unlike when liking with the
HIP
language. For users,a simple string
GINKGO_INSTALL_RPATH_FOR_HIP
is provided which is alinking flag to be given to the
HIP
language linker after installingGinkgo.
defaults for some environment variables and HIP variables.
Open issues
An annoying issue (still), although it's mitigated thanks to linking
publicly against
libamdhip64.so
which doesn't create inconvenience tothe user, is that we have to include
hip/hip_runtime.hpp
in our publicheaders (to find
__forceinline__
as well asHIP_DEVICE_COMPILE
, seehttps://github.com/ginkgo-project/ginkgo/blob/develop/include/ginkgo/core/base/types.hpp#L46-L85.
In addition, the
GKO_ASSERT
cannot be reworked as well otherwise itcreates mysterious issues in the
check_headers
test, see:https://gitlab.com/ginkgo-project/ginkgo-public-ci/-/jobs/1073846520