-
Notifications
You must be signed in to change notification settings - Fork 586
[BugFix] Vendor HIP headers and build fat CUDA+ROCm linux wheels #2195
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
Merged
LeiWang1999
merged 17 commits into
tile-ai:main
from
benenzhu:fix_rocm_wheel_build_without_runtime
May 18, 2026
Merged
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f25f581
[BugFix] Allow USE_ROCM=ON wheel builds on hosts without a ROCm runtime
benenzhu bc32bc2
zz
benenzhu 2f950fd
zz
benenzhu 63ad2bb
zz
benenzhu 42e2cad
zz
benenzhu 5429965
merge
benenzhu dce7ae8
merge
benenzhu a46172c
merge
benenzhu 560f00c
Vendor HIP headers and build fat CUDA+ROCm linux wheels
benenzhu d42bead
Vendor hip/amd_detail headers from Triton
benenzhu ef4d508
Vendor hsa/hsa.h for TVM's rocm_device_api.cc
benenzhu 1b1bc7c
Fix Python 3.9 import of tilelang.autotuner.grouped_compile
benenzhu 42fd8bb
Revert hiprtc stub signatures to const char *const *
benenzhu 064fe97
merge
benenzhu 73d9bec
Suppress +rocm version tag when fat wheel also has USE_CUDA=ON
benenzhu 107aaab
merge
benenzhu 139c51d
Update ci.yml
benenzhu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
311 changes: 311 additions & 0 deletions
311
3rdparty/hip-headers/include/hip/amd_detail/amd_channel_descriptor.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,311 @@ | ||
| /* | ||
| Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved. | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. | ||
| */ | ||
|
|
||
| #ifndef HIP_INCLUDE_HIP_AMD_DETAIL_CHANNEL_DESCRIPTOR_H | ||
| #define HIP_INCLUDE_HIP_AMD_DETAIL_CHANNEL_DESCRIPTOR_H | ||
|
|
||
| #if !defined(__HIPCC_RTC__) | ||
| #include <hip/hip_common.h> | ||
| #include <hip/driver_types.h> | ||
| #include <hip/amd_detail/amd_hip_vector_types.h> | ||
| #endif | ||
|
|
||
| #ifdef __cplusplus | ||
|
|
||
| extern "C" HIP_PUBLIC_API hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, | ||
| hipChannelFormatKind f); | ||
|
|
||
| static inline hipChannelFormatDesc hipCreateChannelDescHalf() { | ||
| int e = (int)sizeof(unsigned short) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); | ||
| } | ||
|
|
||
| static inline hipChannelFormatDesc hipCreateChannelDescHalf1() { | ||
| int e = (int)sizeof(unsigned short) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); | ||
| } | ||
|
|
||
| static inline hipChannelFormatDesc hipCreateChannelDescHalf2() { | ||
| int e = (int)sizeof(unsigned short) * 8; | ||
| return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindFloat); | ||
| } | ||
|
|
||
| static inline hipChannelFormatDesc hipCreateChannelDescHalf4() { | ||
| int e = (int)sizeof(unsigned short) * 8; | ||
| return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindFloat); | ||
| } | ||
|
|
||
| template <typename T> static inline hipChannelFormatDesc hipCreateChannelDesc() { | ||
| return hipCreateChannelDesc(0, 0, 0, 0, hipChannelFormatKindNone); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<char>() { | ||
| int e = (int)sizeof(char) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<signed char>() { | ||
| int e = (int)sizeof(signed char) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<unsigned char>() { | ||
| int e = (int)sizeof(unsigned char) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<uchar1>() { | ||
| int e = (int)sizeof(unsigned char) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<char1>() { | ||
| int e = (int)sizeof(signed char) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<uchar2>() { | ||
| int e = (int)sizeof(unsigned char) * 8; | ||
| return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<char2>() { | ||
| int e = (int)sizeof(signed char) * 8; | ||
| return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| #ifndef __GNUC__ // vector3 is the same as vector4 | ||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<uchar3>() { | ||
| int e = (int)sizeof(unsigned char) * 8; | ||
| return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<char3>() { | ||
| int e = (int)sizeof(signed char) * 8; | ||
| return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); | ||
| } | ||
| #endif | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<uchar4>() { | ||
| int e = (int)sizeof(unsigned char) * 8; | ||
| return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<char4>() { | ||
| int e = (int)sizeof(signed char) * 8; | ||
| return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<unsigned short>() { | ||
| int e = (int)sizeof(unsigned short) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<signed short>() { | ||
| int e = (int)sizeof(signed short) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<ushort1>() { | ||
| int e = (int)sizeof(unsigned short) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<short1>() { | ||
| int e = (int)sizeof(signed short) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<ushort2>() { | ||
| int e = (int)sizeof(unsigned short) * 8; | ||
| return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<short2>() { | ||
| int e = (int)sizeof(signed short) * 8; | ||
| return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| #ifndef __GNUC__ | ||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<ushort3>() { | ||
| int e = (int)sizeof(unsigned short) * 8; | ||
| return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<short3>() { | ||
| int e = (int)sizeof(signed short) * 8; | ||
| return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); | ||
| } | ||
| #endif | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<ushort4>() { | ||
| int e = (int)sizeof(unsigned short) * 8; | ||
| return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<short4>() { | ||
| int e = (int)sizeof(signed short) * 8; | ||
| return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<unsigned int>() { | ||
| int e = (int)sizeof(unsigned int) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<signed int>() { | ||
| int e = (int)sizeof(signed int) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<uint1>() { | ||
| int e = (int)sizeof(unsigned int) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<int1>() { | ||
| int e = (int)sizeof(signed int) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<uint2>() { | ||
| int e = (int)sizeof(unsigned int) * 8; | ||
| return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<int2>() { | ||
| int e = (int)sizeof(signed int) * 8; | ||
| return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| #ifndef __GNUC__ | ||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<uint3>() { | ||
| int e = (int)sizeof(unsigned int) * 8; | ||
| return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<int3>() { | ||
| int e = (int)sizeof(signed int) * 8; | ||
| return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); | ||
| } | ||
| #endif | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<uint4>() { | ||
| int e = (int)sizeof(unsigned int) * 8; | ||
| return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<int4>() { | ||
| int e = (int)sizeof(signed int) * 8; | ||
| return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<float>() { | ||
| int e = (int)sizeof(float) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<float1>() { | ||
| int e = (int)sizeof(float) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<float2>() { | ||
| int e = (int)sizeof(float) * 8; | ||
| return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindFloat); | ||
| } | ||
|
|
||
| #ifndef __GNUC__ | ||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<float3>() { | ||
| int e = (int)sizeof(float) * 8; | ||
| return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindFloat); | ||
| } | ||
| #endif | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<float4>() { | ||
| int e = (int)sizeof(float) * 8; | ||
| return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindFloat); | ||
| } | ||
|
|
||
| #if !defined(__LP64__) | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<unsigned long>() { | ||
| int e = (int)sizeof(unsigned long) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<signed long>() { | ||
| int e = (int)sizeof(signed long) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<ulong1>() { | ||
| int e = (int)sizeof(unsigned long) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<long1>() { | ||
| int e = (int)sizeof(signed long) * 8; | ||
| return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<ulong2>() { | ||
| int e = (int)sizeof(unsigned long) * 8; | ||
| return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<long2>() { | ||
| int e = (int)sizeof(signed long) * 8; | ||
| return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); | ||
| } | ||
|
|
||
| #ifndef __GNUC__ | ||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<ulong3>() { | ||
| int e = (int)sizeof(unsigned long) * 8; | ||
| return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<long3>() { | ||
| int e = (int)sizeof(signed long) * 8; | ||
| return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); | ||
| } | ||
| #endif | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<ulong4>() { | ||
| int e = (int)sizeof(unsigned long) * 8; | ||
| return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindUnsigned); | ||
| } | ||
|
|
||
| template <> inline hipChannelFormatDesc hipCreateChannelDesc<long4>() { | ||
| int e = (int)sizeof(signed long) * 8; | ||
| return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); | ||
| } | ||
| #endif /* !__LP64__ */ | ||
|
|
||
| #else | ||
|
|
||
| struct hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, | ||
| enum hipChannelFormatKind f); | ||
|
|
||
| #endif /* __cplusplus */ | ||
|
|
||
| #endif /* !HIP_INCLUDE_HIP_AMD_DETAIL_CHANNEL_DESCRIPTOR_H */ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.