Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backend] Ensure a deterministic allocation order of scratch smem buf…
Browse files Browse the repository at this point in the history
…fers (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.
htyu authored and sfzhu93 committed Jan 13, 2025
1 parent 3c2bb27 commit e708150
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/triton/Analysis/Allocation.h
Original file line number Diff line number Diff line change
@@ -209,7 +209,7 @@ class Allocation {
};

/// Op -> Scratch Buffer
using OpScratchMapT = DenseMap<Operation *, BufferT *>;
using OpScratchMapT = llvm::MapVector<Operation *, BufferT *>;
/// Value -> Explicit Buffer
using ValueBufferMapT = llvm::MapVector<Value, BufferT *>;
/// Value -> Alias Buffer

0 comments on commit e708150

Please sign in to comment.