Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
- Check operand type instead of dotop which returns accum type.
- Fix medium size typo
- Enable pingpong by default, still can disable it by using `TRITON_HIP_USE_BLOCK_PINGPONG=0`
  • Loading branch information
jungpark-mlir committed Jan 3, 2025
1 parent 6f7f0a9 commit 5c862f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion third_party/amd/backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def make_ttgir(mod, metadata, options):
passes.ttgpuir.add_reduce_data_duplication(pm)
if amd.has_matrix_core_feature(options.arch):
amd.passes.ttgpuir.add_reorder_instructions(pm)
use_block_pingpong = os.getenv("TRITON_HIP_USE_BLOCK_PINGPONG", "0") == "1"
use_block_pingpong = os.getenv("TRITON_HIP_USE_BLOCK_PINGPONG", "1") == "1"
if use_block_pingpong and options.num_stages == 2:
amd.passes.ttgpuir.add_block_pingpong(pm)

Expand Down
4 changes: 2 additions & 2 deletions third_party/amd/lib/TritonAMDGPUTransforms/BlockPingpong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,11 @@ void Pingponger::getDotPingponged() {
auto dotShape = dotType.getShape();
auto AType = dotOps[0].getA().getType();
auto AShape = AType.getShape();
auto elemWidth = dotType.getElementType().getIntOrFloatBitWidth();
auto elemWidth = AType.getElementType().getIntOrFloatBitWidth();
int64_t tileSize = dotShape[0] * dotShape[1] * AShape[1] * elemWidth;

const int64_t SmallTile = 16777216; // e.g. 128x128x64x16bit
const int64_t MediumTile = 35554432; // SmallTile x 2
const int64_t MediumTile = 33554432; // SmallTile x 2
const int64_t LargeTile = 67108864; // e.g. 256x256x64x16bit

auto encoding = cast<RankedTensorType>(AType).getEncoding();
Expand Down

0 comments on commit 5c862f7

Please sign in to comment.