-
Notifications
You must be signed in to change notification settings - Fork 232
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
[HotFix] Adapt to changes to HIPRTC in current Staging/Mainline (future 6.1 RC) that disallow the use of <limits> in kernels #2650
Conversation
src/comgr.cpp
Outdated
/// Hence the workaround is applicable for a range of hipRTC versions | ||
/// and potentially in the future | ||
#define WORKAROUND_HIPRTC_LIMITS \ | ||
(HIP_PACKAGE_VERSION_FLAT >= 6000023464ULL && HIP_PACKAGE_VERSION_FLAT < 6000023494ULL) |
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 reviewers (@atamazov), these way points are the best we know at the moment, they may not be exactly precise but should work with official releases.
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 in Staging is usually incorrect. Therefore, we should not rely on these numbers in the code (otherwise we will have more and more of mess in the source code). It's much better to replace the incorrect HIP version numbers with the correct expected ones (in this case 6.1.24xxx) and use the correct version.
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.
@atamazov here is a summary of compiler versions and reported in the cmake output:
-
[Docker A] ROCm 6.0:
- HIP version: 6.0.32830-d62f6a171
- roc-6.0.0 23483 7208e8d15fbf218deb74483ea8c549c67ca4985e
- -- Build with HIP 6.0.23494
-
[Docker B] The docker with all proposed hipRTC changes:
- HIP version: 6.0.32830-dc7635e0d
- roc-6.0.0 23483 7208e8d15fbf218deb74483ea8c549c67ca4985e
- -- Build with HIP 6.0.23494
-
[Docker C] The latest mainline staging docker:
- HIP version: 6.0.32830-606beddb1
- amd-mainline-open 23512 8f0cb360b515076885176a3e5ba09dab6ecefa20
- -- Build with HIP 6.0.23464
There are a few critical issues:
- From Docker A and Docker B:
hipRTC
versioning is now decoupled fromHIP
package, so our code path control needs to accomodate. - From Docker C: the reported HIP version is incorrect
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.
Why: #2650 (comment)
-DMIOPEN_OVERRIDE_HIP_VERSION_MINOR=1 -DMIOPEN_OVERRIDE_HIP_VERSION_PATCH=24000
to CMake options. Please inform QA about this.
@junliume Maybe let's rename PR to "[HotFix] Adapt to changes to HIPRTC in current Staging/Mainline (future 6.1 RC) that disallow the use of <limits> in kernels"? |
src/kernels/miopen_type_traits.hpp
Outdated
@@ -76,7 +76,7 @@ struct remove_cv | |||
typedef typename remove_volatile<typename remove_const<T>::type>::type type; | |||
}; | |||
|
|||
#if HIP_PACKAGE_VERSION_FLAT >= 6001000000ULL | |||
#if HIP_PACKAGE_VERSION_FLAT >= 6001024000ULL |
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.
@atamazov now with the header issue resolved, we found more issues with
/tmp/comgr-4e3a20/include/miopen_type_traits.hpp:81:8: error: redefinition of 'integral_constant'
81 | struct integral_constant
| ^
/long_pathname_so_that_rpms_can_package_the_debug_info/src/external/clr/hipamd/include/hip/amd_detail/amd_hip_vector_types.h:55:38: note: previous definition is here
55 | template <class _Tp, _Tp __v> struct integral_constant {
| ^
I guess we have to identify another point where this workaround is needed, and not the same point with the limits header.
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.
We can make it
#if HIP_PACKAGE_VERSION_FLAT > 6001024000ULL
but this is very fragile ...
src/kernels/miopen_cstdint.hpp
Outdated
@@ -30,7 +30,7 @@ typedef signed char int8_t; | |||
typedef unsigned char uint8_t; | |||
typedef signed short int16_t; | |||
typedef unsigned short uint16_t; | |||
#if HIP_PACKAGE_VERSION_FLAT >= 6001000000ULL | |||
#if HIP_PACKAGE_VERSION_FLAT >= 6001024000ULL |
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.
Similar to https://github.com/ROCm/MIOpen/pull/2650/files#r1439946058
I am afraid this is fragile and might or might not break ...
@@ -41,6 +41,15 @@ namespace std { | |||
template <typename T> | |||
class numeric_limits; | |||
|
|||
template <> |
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.
@atamazov could you take a look? test_reduce_test
seems to be needing this in the docker where I am testing. Also I may wonder if there could be other data types missing?
@@ -26,6 +26,9 @@ | |||
#pragma once | |||
|
|||
#ifdef MIOPEN_DONT_USE_HIP_RUNTIME_HEADERS | |||
/// \todo: exact version from which this WA is needed should be updated in release | |||
/// https://github.com/ROCm/MIOpen/issues/2651 | |||
#define WORKAROUND_USE_MORE_CUSTOM_TYPE_TRAITS (HIP_PACKAGE_VERSION_FLAT > 6001024000ULL) |
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.
@atamazov reviewers be noted that this line excludes the assumed (fake) version.
replace with #2652 |
as commented below, with this PR, one has to use
to CMake options
Workaround lifecycle is tracked by #2651