-
Notifications
You must be signed in to change notification settings - Fork 270
Congma/ck tile/preshuffle b #3645
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
CongMa13
wants to merge
9
commits into
develop
Choose a base branch
from
congma/ck_tile/preshuffle_b
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.
+437
−395
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
080fa14
[CK TILE] Add new function get_k_warp_tile_for_preshuffle_b
CongMa13 dc83e28
[CK TILE] simplify function GetKBPerLoad
CongMa13 109bfa1
[CK TILE] Update get_k_warp_tile_for_preshuffle_b for MI350
bc91bb7
[CK TILE] Apply get_k_warp_tile_for_preshuffle_b in examples and tests
CongMa13 70bd8f8
[CK TIEL] Fix a const type qualifier error
CongMa13 89d4d51
[CK TIEL] Fix type error
CongMa13 6ba8427
[CK TILE] set proper K_Warp_Tile for quant gemm tests
CongMa13 ed0eadb
[CK TILE] disable tests on gfx950
CongMa13 3e91c74
solve the merge conflict
ThomasNing 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
110 changes: 55 additions & 55 deletions
110
test/ck_tile/gemm_block_scale/test_gemm_quant_abquant_base.cpp
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 |
|---|---|---|
| @@ -1,55 +1,55 @@ | ||
| // Copyright (c) Advanced Micro Devices, Inc., or its affiliates. | ||
| // SPDX-License-Identifier: MIT | ||
| #include "ck_tile/host.hpp" | ||
| #include "ck_tile/ops/gemm.hpp" | ||
| #include <gtest/gtest.h> | ||
| #include <memory> | ||
| #include "test_gemm_quant_fixtures.hpp" | ||
| // Type aliases for readability | ||
| using RowMajor = ck_tile::tensor_layout::gemm::RowMajor; | ||
| using ColumnMajor = ck_tile::tensor_layout::gemm::ColumnMajor; | ||
| using FP8 = ck_tile::fp8_t; | ||
| using BF8 = ck_tile::bf8_t; | ||
| using Half = ck_tile::half_t; | ||
| using PkInt4 = ck_tile::pk_int4_t; | ||
| using ABQuantGrouped = | ||
| std::integral_constant<ck_tile::QuantType, ck_tile::QuantType::ABQuantGrouped>; | ||
| using GroupSize = ck_tile::QuantGroupShape<ck_tile::sequence<1, 1, 128>>; | ||
| // 2d block sizes for BQuant | ||
| using GroupSize2D128N = ck_tile::QuantGroupShape<ck_tile::sequence<1, 128, 128>>; | ||
| // Type combinations for ABQuant tests | ||
| // Tuple format: <ALayout, BLayout, CLayout, AQLayout, ADataType, BDataType, QDataType, CDataType, | ||
| // QuantType, GemmConfig, AQuantGroupSize, BQuantGroupSize, BQLayout> | ||
| // clang-format off | ||
| using ABQuantTypes = ::testing::Types< | ||
| // PreshuffleQuant = false && TransposeC = false (RCR layout with RowMajor AQ) | ||
| std::tuple<RowMajor, ColumnMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize, ColumnMajor>, | ||
| std::tuple<ColumnMajor, RowMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize, ColumnMajor>, | ||
| std::tuple<RowMajor, RowMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize, ColumnMajor>, | ||
| std::tuple<RowMajor, ColumnMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize, ColumnMajor>, | ||
| std::tuple<ColumnMajor, RowMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize, ColumnMajor>, | ||
| std::tuple<RowMajor, RowMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize, ColumnMajor>, | ||
| std::tuple<RowMajor, ColumnMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize2D128N, ColumnMajor>, | ||
| std::tuple<ColumnMajor, RowMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize2D128N, ColumnMajor>, | ||
| std::tuple<RowMajor, RowMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize2D128N, ColumnMajor>, | ||
| std::tuple<RowMajor, ColumnMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize2D128N, ColumnMajor>, | ||
| std::tuple<ColumnMajor, RowMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize2D128N, ColumnMajor>, | ||
| std::tuple<RowMajor, RowMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase, GroupSize, GroupSize2D128N, ColumnMajor> | ||
| >; | ||
| // clang-format on | ||
| // Test suite for ABQuant | ||
| TYPED_TEST_SUITE(TestCkTileGemmABQuant, ABQuantTypes); | ||
| // AQuant tests | ||
| TYPED_TEST(TestCkTileGemmABQuant, ABQuantGroupedTest) | ||
| { | ||
| this->run_test_with_validation(1024, 1024, 1024); | ||
| } | ||
| // Copyright (c) Advanced Micro Devices, Inc., or its affiliates. | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| #include "ck_tile/host.hpp" | ||
| #include "ck_tile/ops/gemm.hpp" | ||
|
|
||
| #include <gtest/gtest.h> | ||
| #include <memory> | ||
|
|
||
| #include "test_gemm_quant_fixtures.hpp" | ||
|
|
||
| // Type aliases for readability | ||
| using RowMajor = ck_tile::tensor_layout::gemm::RowMajor; | ||
| using ColumnMajor = ck_tile::tensor_layout::gemm::ColumnMajor; | ||
| using FP8 = ck_tile::fp8_t; | ||
| using BF8 = ck_tile::bf8_t; | ||
| using Half = ck_tile::half_t; | ||
| using PkInt4 = ck_tile::pk_int4_t; | ||
| using ABQuantGrouped = | ||
| std::integral_constant<ck_tile::QuantType, ck_tile::QuantType::ABQuantGrouped>; | ||
| using GroupSize = ck_tile::QuantGroupShape<ck_tile::sequence<1, 1, 128>>; | ||
|
|
||
| // 2d block sizes for BQuant | ||
| using GroupSize2D128N = ck_tile::QuantGroupShape<ck_tile::sequence<1, 128, 128>>; | ||
|
|
||
| // Type combinations for ABQuant tests | ||
| // Tuple format: <ALayout, BLayout, CLayout, AQLayout, ADataType, BDataType, QDataType, CDataType, | ||
| // QuantType, GemmConfig, AQuantGroupSize, BQuantGroupSize, BQLayout> | ||
| // clang-format off | ||
| using ABQuantTypes = ::testing::Types< | ||
| // PreshuffleQuant = false && TransposeC = false (RCR layout with RowMajor AQ) | ||
| std::tuple<RowMajor, ColumnMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase<FP8>, GroupSize, GroupSize, ColumnMajor>, | ||
| std::tuple<ColumnMajor, RowMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase<FP8>, GroupSize, GroupSize, ColumnMajor>, | ||
| std::tuple<RowMajor, RowMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase<FP8>, GroupSize, GroupSize, ColumnMajor>, | ||
| std::tuple<RowMajor, ColumnMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase<BF8>, GroupSize, GroupSize, ColumnMajor>, | ||
| std::tuple<ColumnMajor, RowMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase<BF8>, GroupSize, GroupSize, ColumnMajor>, | ||
| std::tuple<RowMajor, RowMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase<BF8>, GroupSize, GroupSize, ColumnMajor>, | ||
|
|
||
| std::tuple<RowMajor, ColumnMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase<FP8>, GroupSize, GroupSize2D128N, ColumnMajor>, | ||
| std::tuple<ColumnMajor, RowMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase<FP8>, GroupSize, GroupSize2D128N, ColumnMajor>, | ||
| std::tuple<RowMajor, RowMajor, RowMajor, RowMajor, FP8, FP8, float, Half, ABQuantGrouped, GemmConfigBase<FP8>, GroupSize, GroupSize2D128N, ColumnMajor>, | ||
| std::tuple<RowMajor, ColumnMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase<BF8>, GroupSize, GroupSize2D128N, ColumnMajor>, | ||
| std::tuple<ColumnMajor, RowMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase<BF8>, GroupSize, GroupSize2D128N, ColumnMajor>, | ||
| std::tuple<RowMajor, RowMajor, RowMajor, RowMajor, BF8, BF8, float, Half, ABQuantGrouped, GemmConfigBase<BF8>, GroupSize, GroupSize2D128N, ColumnMajor> | ||
| >; | ||
| // clang-format on | ||
|
|
||
| // Test suite for ABQuant | ||
| TYPED_TEST_SUITE(TestCkTileGemmABQuant, ABQuantTypes); | ||
|
|
||
| // AQuant tests | ||
| TYPED_TEST(TestCkTileGemmABQuant, ABQuantGroupedTest) | ||
| { | ||
| this->run_test_with_validation(1024, 1024, 1024); | ||
| } |
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.
GetKBPerLoad()was simplified toWarpTile::N * WarpTile::K / get_warp_size(), butMakeBFlatDramTileDistribution()still setsKRepeatInWave = 2on__gfx11__and assertsTileShape::flatKPerWarp == KThdPerWave * KBPerLoad. With the new formula, that static_assert will fail on gfx11 (it effectively becomesN*K == (warp_size/2) * (N*K/warp_size)). Either foldKRepeatInWave(gfx11) into the KB-per-load calculation, or keep the previous scaling logic so the distribution invariants remain valid.