Skip to content
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

[AMD] Enable pingpong scheduling by default #5696

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jungpark-mlir
Copy link
Contributor

@jungpark-mlir jungpark-mlir commented Jan 24, 2025

The pass selects possible pingpong options by the given problem. It's only enabled when we believe it improves the performance by applying the pingpong pattern. Now, we're enabling the pass by default on gfx942 arch where we believe it's beneficial.

N.B. Still it can slow down a kernel significantly when register spills. It tries to avoid spilling gemm config but cannot guarantee when additional logic is involved.

Now it the pass selects possible pingpong options by the given problem.
It's only enabled when we believe it improves the perfromance by
applying the pingpong pattern.

N.B. Still it can slow down a kernel significantly when register spills.
It tries to avoid spilling gemm config but cannot guarantee when
additional logic is involved.
third_party/amd/backend/compiler.py Outdated Show resolved Hide resolved
@jungpark-mlir
Copy link
Contributor Author

Test fails, will fix it.

@jungpark-mlir
Copy link
Contributor Author

#5718 fixes the failure.

@@ -36,6 +36,14 @@ def get_gfx9_limits(lhsType, rhsType):
return lambda lhsType, rhsType: (1, 1, 1) if is_fma_supported(lhsType.scalar, rhsType.scalar) else (16, 16, 16)


def is_pingpong_enabled(arch):
if arch == 'gfx942':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Actually I feel something like the following would be simpler:

default = "1" if arch == "gfx942" else "0"
return os.getenv("TRITON_HIP_USE_BLOCK_PINGPONG", default) == "1"

@antiagainst antiagainst marked this pull request as ready for review January 30, 2025 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants