Skip to content

Commit ebb2716

Browse files
authored
[backend] Ensure a deterministic allocation order of scratch smem buffers (triton-lang#5595)
I was seeing non-deterministic SMEM allocation sizes and offsets across compilations with same source and compiler. It seems due to scratch buffers processed in a non-deterministic order, due to the use of `DenseMap`. Using `MapVector` should fix it.
1 parent d045eda commit ebb2716

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/triton/Analysis/Allocation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class Allocation {
209209
};
210210

211211
/// Op -> Scratch Buffer
212-
using OpScratchMapT = DenseMap<Operation *, BufferT *>;
212+
using OpScratchMapT = llvm::MapVector<Operation *, BufferT *>;
213213
/// Value -> Explicit Buffer
214214
using ValueBufferMapT = llvm::MapVector<Value, BufferT *>;
215215
/// Value -> Alias Buffer

0 commit comments

Comments
 (0)