-
Notifications
You must be signed in to change notification settings - Fork 270
Mx fp6 flatmm #3601
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
Open
eeezio
wants to merge
15
commits into
ROCm:develop
Choose a base branch
from
eeezio:mx-fp6-flatmm
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+760
−135
Open
Mx fp6 flatmm #3601
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
870e751
add fp6 data-type and support sync/async dwordx3 load/store
1ca39c6
clang-format
2d88e63
pre-commit
bde9d17
1st commit
b1d3684
default mnk pass ut
6ac168c
fix a distrubution
4652476
fix
6b87639
fix bdram distr
f49f9f4
update
6f74976
pass ut
86be504
improve perf
6b53127
update
9dc1e91
clean code
5368838
resolve copilot comment
6e9587f
fix clang format
illsilin 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
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
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
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
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
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
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
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
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
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 |
|---|---|---|
|
|
@@ -1129,6 +1129,23 @@ llvm_amdgcn_raw_buffer_store_i32x2(int32x2_t vdata, | |
| index_t soffset, | ||
| index_t glc_slc) __asm("llvm.amdgcn.raw.buffer.store.v2i32"); | ||
|
|
||
| CK_TILE_DEVICE_EXTERN void | ||
| llvm_amdgcn_raw_buffer_store_i32x3_(int32x3_t vdata, | ||
| int32x4_t rsrc, | ||
| index_t voffset, | ||
| index_t soffset, | ||
| index_t glc_slc) __asm("llvm.amdgcn.raw.buffer.store.v3i32"); | ||
|
|
||
| CK_TILE_DEVICE_EXTERN void llvm_amdgcn_raw_buffer_store_i32x3( | ||
| dwordx3_union vdata, int32x4_t rsrc, index_t voffset, index_t soffset, index_t glc_slc) | ||
| { | ||
| int32x3_t v_reg; | ||
| v_reg[0] = vdata.as_i32[0]; | ||
| v_reg[1] = vdata.as_i32[1]; | ||
| v_reg[2] = vdata.as_i32[2]; | ||
| llvm_amdgcn_raw_buffer_store_i32x3_(v_reg, rsrc, voffset, soffset, glc_slc); | ||
| }; | ||
|
Comment on lines
+1139
to
+1147
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It reports compiler error in some versions of clang |
||
|
|
||
| CK_TILE_DEVICE_EXTERN void | ||
| llvm_amdgcn_raw_buffer_store_i32x4(int32x4_t vdata, | ||
| int32x4_t rsrc, | ||
|
|
@@ -1285,7 +1302,7 @@ amd_buffer_load_impl_with_bytes(int32x4_t src_wave_buffer_resource, | |
| index_t src_thread_addr_offset, | ||
| index_t src_wave_addr_offset) | ||
| { | ||
| static_assert(N == 1 || N == 2 || N == 4 || N == 8 || N == 16 || N == 32 || N == 64, | ||
| static_assert(N == 1 || N == 2 || N == 4 || N == 8 || N == 12 || N == 16 || N == 32 || N == 64, | ||
| "wrong! not implemented"); | ||
|
|
||
| using rtn_type = thread_buffer<int8_t, N>; | ||
|
|
@@ -1325,6 +1342,18 @@ amd_buffer_load_impl_with_bytes(int32x4_t src_wave_buffer_resource, | |
|
|
||
| return bit_cast<rtn_type>(tmp); | ||
| } | ||
| else if constexpr(N == 12) | ||
| { | ||
| auto tmp = llvm_amdgcn_raw_buffer_load_i32x3(src_wave_buffer_resource, | ||
| src_thread_addr_offset, | ||
| src_wave_addr_offset, | ||
| static_cast<index_t>(coherence)); | ||
| dwordx3_union ret; | ||
| ret.as_i32[0] = tmp[0]; | ||
| ret.as_i32[1] = tmp[1]; | ||
| ret.as_i32[2] = tmp[2]; | ||
| return bit_cast<rtn_type>(ret); | ||
| } | ||
| else if constexpr(N == 16) | ||
| { | ||
| int32x4_t tmp = llvm_amdgcn_raw_buffer_load_i32x4(src_wave_buffer_resource, | ||
|
|
@@ -1406,15 +1435,19 @@ CK_TILE_DEVICE thread_buffer<T, N> amd_buffer_load_impl(int32x4_t src_wave_buffe | |
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| (std::is_same<T, fp8_t>::value && (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| (std::is_same<T, bf8_t>::value && (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| (std::is_same<T, int8_t>::value && (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| (std::is_same<T, int8_t>::value && | ||
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 12 || N == 16)) || | ||
| (std::is_same<T, uint8_t>::value && | ||
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 12 || N == 16)) || | ||
| (std::is_same<T, e8m0_bexp_t>::value && | ||
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| (std::is_same<T, pk_fp4_raw_t>::value && | ||
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| (std::is_same<T, pk_int4_t>::value && | ||
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 16 || N == 32) || | ||
| (std::is_same<T, pk_fp4_t>::value && | ||
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 16))), | ||
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 16))) || | ||
| (std::is_same<T, pk_fp6x16_t>::value && (N == 1)), | ||
| "wrong! not implemented"); | ||
|
|
||
| using rtn_type = thread_buffer<T, N>; | ||
|
|
@@ -1745,7 +1778,7 @@ CK_TILE_DEVICE void amd_buffer_store_impl_with_bytes(const thread_buffer<int8_t, | |
| index_t dst_thread_addr_offset, | ||
| index_t dst_wave_addr_offset) | ||
| { | ||
| static_assert(N == 1 || N == 2 || N == 4 || N == 8 || N == 16 || N == 32 || N == 64, | ||
| static_assert(N == 1 || N == 2 || N == 4 || N == 8 || N == 12 || N == 16 || N == 32 || N == 64, | ||
| "wrong! not implemented"); | ||
|
|
||
| if constexpr(N == 1) | ||
|
|
@@ -1781,6 +1814,14 @@ CK_TILE_DEVICE void amd_buffer_store_impl_with_bytes(const thread_buffer<int8_t, | |
| dst_wave_addr_offset, | ||
| static_cast<index_t>(coherence)); | ||
| } | ||
| else if constexpr(N == 12) | ||
| { | ||
| llvm_amdgcn_raw_buffer_store_i32x3(bit_cast<dwordx3_union>(src_thread_data), | ||
| dst_wave_buffer_resource, | ||
| dst_thread_addr_offset, | ||
| dst_wave_addr_offset, | ||
| static_cast<index_t>(coherence)); | ||
| } | ||
| else if constexpr(N == 16) | ||
| { | ||
| llvm_amdgcn_raw_buffer_store_i32x4(bit_cast<int32x4_t>(src_thread_data), | ||
|
|
@@ -1854,10 +1895,13 @@ CK_TILE_DEVICE void amd_buffer_store_impl(const thread_buffer<T, N> src_thread_d | |
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| (std::is_same<T, fp8_t>::value && (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| (std::is_same<T, bf8_t>::value && (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| (std::is_same<T, int8_t>::value && (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| (std::is_same<T, int8_t>::value && | ||
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 12 || N == 16)) || | ||
| (std::is_same<T, uint16_t>::value && | ||
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| (std::is_same<T, uint8_t>::value && (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)), | ||
| (std::is_same<T, uint8_t>::value && | ||
| (N == 1 || N == 2 || N == 4 || N == 8 || N == 16)) || | ||
| std::is_same<T, pk_fp6x16_t>::value && (N == 1), | ||
| "wrong! not implemented"); | ||
|
|
||
| if constexpr(std::is_same<T, float>::value) // fp32 | ||
|
|
||
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.
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.
don't remove it