Skip to content

Commit 529dff1

Browse files
Merge commit '52e7a4b1b170fed27be8a5851a47671bcda70a98'
2 parents 5e93df0 + 52e7a4b commit 529dff1

File tree

6 files changed

+99
-4
lines changed

6 files changed

+99
-4
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release/*
8+
tags:
9+
# Final Release tags look like: v1.11.0
10+
- v[0-9]+.[0-9]+.[0-9]+
11+
# Release candidate tags look like: v1.11.0-rc1
12+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
13+
release:
14+
types: [published]
15+
pull_request:
16+
paths: [.github/workflows/create_release.yml]
17+
18+
jobs:
19+
20+
release:
21+
if: ${{ github.repository == 'triton-lang/triton' }}
22+
name: Create Release
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: write
26+
outputs:
27+
release_name: "${{ steps.release_name.outputs.name }}"
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
show-progress: false
32+
submodules: 'recursive'
33+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
34+
- name: Fake name for PRs
35+
if: ${{ github.event_name == 'pull_request' }}
36+
run: echo "PT_GITHUB_REF=refs/tags/pr-tag" >> "$GITHUB_ENV"
37+
- name: Real name for non-PRs
38+
if: ${{ github.event_name != 'pull_request' }}
39+
run: echo "PT_GITHUB_REF=$GITHUB_REF" >> "$GITHUB_ENV"
40+
- name: Set filenames
41+
run: |
42+
tag_or_branch="${PT_GITHUB_REF#refs/tags/}"
43+
tag_or_branch="${tag_or_branch#refs/heads/}"
44+
# replace directory separators with _ in branch name
45+
tag_or_branch="${tag_or_branch//\//_}"
46+
echo "RELEASE_NAME=triton-$tag_or_branch" >> "$GITHUB_ENV"
47+
echo "RELEASE_FILE=triton-$tag_or_branch.tar.gz" >> "$GITHUB_ENV"
48+
- name: Create source distribution
49+
run: |
50+
# Create new folder with specified name so extracting the archive yields that
51+
rm -rf "/tmp/$RELEASE_NAME"
52+
cp -r "$PWD" "/tmp/$RELEASE_NAME"
53+
mv "/tmp/$RELEASE_NAME" .
54+
# Cleanup
55+
find "$RELEASE_NAME" -name '.git*' -exec rm -rv {} \; || true
56+
# Create archive
57+
tar -czf "$RELEASE_FILE" "$RELEASE_NAME"
58+
echo "Created source archive $RELEASE_FILE with content: $(ls -a "$RELEASE_NAME")"
59+
- name: Upload source distribution for release
60+
if: ${{ github.event_name == 'release' }}
61+
uses: softprops/action-gh-release@v2
62+
with:
63+
files: ${{env.RELEASE_FILE}}
64+
- name: Upload source distribution to GHA artifacts for release tags
65+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc') }}
66+
uses: actions/[email protected]
67+
with:
68+
name: ${{ env.RELEASE_FILE }}
69+
path: ${{ env.RELEASE_FILE }}
70+
- name: Set output
71+
id: release_name
72+
run: echo "name=release_name::${{ env.RELEASE_NAME }}.tar.gz" >> "${GITHUB_OUTPUT}"
73+
74+
concurrency:
75+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name }}
76+
cancel-in-progress: true

cmake/llvm-hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
71a977d0d611f3e9f6137a6b8a26b730b2886ce9
1+
1d4801f22ab1fd6205b1cf625b690aefc554cd4c

lib/Dialect/TritonGPU/Transforms/WarpSpecialization/AutomaticWarpSpecialization.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ void AutomaticWarpSpecialization::runOnOperation() {
3535
OpPassManager pm;
3636
pm.addPass(createTritonGPULoadMMASpecialization({numStages}));
3737
pm.addPass(createTritonGPURewritePartitionDependencies());
38-
// `int-range-optimizations` and SCCP are good at cleaning up loop arithmetic.
39-
// FIXME: Re-enable integer range analysis once it is fixed.
40-
// pm.addPass(arith::createIntRangeOptimizationsPass());
38+
// `int-range-optimizations` is good at cleaning up loop arithmetic involving
39+
// circular buffers.
40+
pm.addPass(arith::createIntRangeOptimizationsPass());
4141
pm.addPass(createSCCPPass());
4242
pm.addPass(createCSEPass());
4343
pm.addPass(createTritonGPUPartitionLoops());

third_party/amd/include/Analysis/RangeAnalysis.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,11 @@ struct TritonIntegerRangeAnalysis : dataflow::IntegerRangeAnalysis {
119119

120120
std::optional<SmallVector<ConstantIntRanges>>
121121
collectRanges(const DataFlowSolver &solver, ValueRange values);
122+
122123
bool cmpIIsStaticallyTrue(const DataFlowSolver &solver, arith::CmpIOp cmpOp);
123124

125+
bool isEmptyInitializedRange(ConstantIntRanges rv);
126+
124127
} // namespace mlir::triton::AMD
125128

126129
#endif

third_party/amd/lib/Analysis/RangeAnalysis.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ std::optional<ConstantIntRanges> maybeGetAssumedRange(Operation *assumption,
186186

187187
namespace mlir::triton::AMD {
188188

189+
bool isEmptyInitializedRange(ConstantIntRanges rv) {
190+
if (!rv.umin().getBitWidth() || !rv.umax().getBitWidth() ||
191+
!rv.smin().getBitWidth() || !rv.smax().getBitWidth())
192+
return true;
193+
return false;
194+
}
195+
189196
std::optional<SmallVector<ConstantIntRanges>>
190197
collectRanges(const DataFlowSolver &solver, ValueRange values) {
191198
SmallVector<ConstantIntRanges> ranges;
@@ -196,6 +203,8 @@ collectRanges(const DataFlowSolver &solver, ValueRange values) {
196203
return {};
197204
const ConstantIntRanges &inferredRange =
198205
maybeInferredRange->getValue().getValue();
206+
if (isEmptyInitializedRange(inferredRange))
207+
return {};
199208
ranges.push_back(inferredRange);
200209
}
201210
return ranges;

third_party/amd/test/lib/Analysis/TestAMDRangeAnalysis.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ struct TestAMDRangeAnalysisPass
3434
return signalPassFailure();
3535

3636
auto nonNegativePred = [&solver](Value v) -> bool {
37+
if (const auto *r =
38+
solver->lookupState<dataflow::IntegerValueRangeLattice>(v)) {
39+
if (r->getValue().isUninitialized())
40+
return false;
41+
if (AMD::isEmptyInitializedRange(r->getValue().getValue()))
42+
return false;
43+
}
3744
return succeeded(dataflow::staticallyNonNegative(*solver, v));
3845
};
3946

0 commit comments

Comments
 (0)