Skip to content

Add support for single wave stream-k kernels #1975

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
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

AlexBrownAMD
Copy link
Contributor

Allow wavegroup to be less than 4 in stream-k kernels. This change updates the partials and fixup code to tkae number of waves into account.

Added new test cases to the hgemm stream-k unit tests for wave groups (2,1), (1,2), and (1,1).

@@ -265,6 +268,9 @@ BenchmarkProblems:
- [16, 16, 16, 1, 1, 1,4, 2,2]
- [16, 16, 16, 1, 1, 1,2, 2,2]
- [16, 16, 16, 1, 1, 1,1, 2,2]
- [16, 16, 16, 1, 1, 1,1, 2,1]
- [16, 16, 16, 1, 1, 1,1, 1,2]
- [16, 16, 16, 1, 1, 1,1, 1,1]
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this change support this MFMA but with LSU=4 (e.g., - WorkGroup:[4,4,4]?
If so, pls add test with 2x1 or 1x2 waves with LSU=2 and 1x1 waves with LSU=2 and 4.

@@ -756,6 +756,11 @@ def partialsWriteBatch(self, writer, kernel, ss, batchIdx, applyAlpha, beta, edg
module.add(VMovB32(vgpr(cvtVgprStruct.vgprBF8Max), "0x47600000", comment="BF8 Max value 57344 as float32" ))
module.add(VMovB32(vgpr(cvtVgprStruct.vgprBF8Min), "0xc7600000", comment="BF8 Min value -57344 as float32" ))

if kernel["EnableMatrixInstruction"]:
WaveNum = kernel["MIWaveGroup"][0] * kernel["MIWaveGroup"][1]
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to consider LSU to compute wave count here as well?

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.

3 participants