[FRONTEND] Fix issues with atomics (#849)
This commit is contained in:
@@ -118,6 +118,10 @@ struct CoalescePass : public TritonGPUCoalesceBase<CoalescePass> {
|
||||
builder.setInsertionPoint(curr);
|
||||
if (auto load = dyn_cast<triton::LoadOp>(curr))
|
||||
coalesceOp<triton::LoadOp>(axisInfo, curr, load.ptr(), builder);
|
||||
if (auto op = dyn_cast<triton::AtomicRMWOp>(curr))
|
||||
coalesceOp<triton::AtomicRMWOp>(axisInfo, curr, op.ptr(), builder);
|
||||
if (auto op = dyn_cast<triton::AtomicCASOp>(curr))
|
||||
coalesceOp<triton::AtomicCASOp>(axisInfo, curr, op.ptr(), builder);
|
||||
if (auto load = dyn_cast<triton::gpu::InsertSliceAsyncOp>(curr))
|
||||
coalesceOp<triton::gpu::InsertSliceAsyncOp>(axisInfo, curr, load.src(),
|
||||
builder);
|
||||
|
@@ -200,7 +200,7 @@ inline bool expensive_to_remat(Operation *op) {
|
||||
return true;
|
||||
if (isa<triton::gpu::ExtractSliceOp, triton::gpu::AllocTensorOp,
|
||||
triton::gpu::InsertSliceAsyncOp, triton::LoadOp, triton::StoreOp,
|
||||
triton::DotOp>(op))
|
||||
triton::AtomicRMWOp, triton::AtomicCASOp, triton::DotOp>(op))
|
||||
return true;
|
||||
if (isa<scf::YieldOp, scf::ForOp>(op))
|
||||
return true;
|
||||
@@ -478,7 +478,9 @@ public:
|
||||
|
||||
SetVector<Operation *> cvtSlices;
|
||||
auto filter = [&](Operation *op) {
|
||||
return isInLoop(op) && !isa<triton::LoadOp>(op) &&
|
||||
return isInLoop(op) &&
|
||||
!isa<triton::LoadOp, triton::StoreOp, triton::AtomicRMWOp,
|
||||
triton::AtomicCASOp>(op) &&
|
||||
!isa<triton::DotOp>(op) && !isa<scf::YieldOp>(op) &&
|
||||
!isa<triton::gpu::ConvertLayoutOp>(op);
|
||||
};
|
||||
|
Reference in New Issue
Block a user