Skip to content

Commit

Permalink
Fix LSU bug. (#778)
Browse files Browse the repository at this point in the history
  • Loading branch information
hcman2 committed May 28, 2024
1 parent c3821a5 commit 96fcda2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tensilelite/Tensile/Components/GlobalWriteBatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,11 @@ def _emitNonatomicAdd(self, module: Module):
else:
gradientInput = self.ss.elementSumIdx[elementIdx]
enableValuC = True
if self.kernel["LocalSplitU"] > 1:
# When LSU > 1, the VGPRs are from LSU output.
# the elementSumIdx has indicated the VGPRs from LSU.
# Don't use the ValuC prefix here.
enableValuC = False
if self.kernel["ActivationFuncCall"]:
if (activationCDataType == self.kernel["ProblemType"]["DestDataType"]) and \
(activationCDataType != self.kernel["ProblemType"]["ComputeDataType"]) and ((self.kernel["ProblemType"]["UseScaleCD"] == False) or (self.kernel["ProblemType"]["UseScaleAlphaVec"] == False)):
Expand Down
9 changes: 8 additions & 1 deletion tensilelite/Tensile/Tests/common/gemm/lsu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ BenchmarkProblems:
- GlobalSplitU: [1,2,9]
- GlobalSplitUAlgorithm: ["MultipleBuffer", "MultipleBufferSingleKernel"]
- SourceSwap: [0, 1]
- ActivationFuncCall: [0, 1]
BenchmarkJoinParameters:
BenchmarkFinalParameters:
- ProblemSizes:
Expand All @@ -409,6 +410,9 @@ BenchmarkProblems:
TransposeB: 0
UseBeta: True
Batched: True
Activation: True
ActivationHPA: True
UseScaleAlphaVec: True
- # BenchmarkProblemSizeGroup - Standard - All problem
InitialSolutionParameters:
BenchmarkCommonParameters:
Expand Down Expand Up @@ -450,7 +454,10 @@ BenchmarkProblems:
- GlobalSplitU: [1]
- GlobalSplitUAlgorithm: ["MultipleBuffer"]
- SourceSwap: [1]
- ActivationFuncCall: [0, 1]
BenchmarkJoinParameters:
BenchmarkFinalParameters:
- ProblemSizes:
- Exact: [128, 128, 1, 128]
- Exact: [128, 128, 1, 128]
- ActivationArgs:
- [Enum: tanh]

0 comments on commit 96fcda2

Please sign in to comment.