Skip to content

Commit

Permalink
[inductor] Make load_mask() codegen determinstic
Browse files Browse the repository at this point in the history
ghstack-source-id: 73dc80fea9237898d8527898e94ab2abb6e991e9
Pull Request resolved: #126017
  • Loading branch information
jansel committed May 12, 2024
1 parent 02093b6 commit 6758dc6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torch/_inductor/codegen/triton.py
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,8 @@ def load_mask(self, var):
mask = (
f"{next(iter(mask_vars))}"
if len(mask_vars) == 1
else f"({' & '.join(str(v) for v in mask_vars)})"
# sorted for deterministic order
else f"({' & '.join(str(v) for v in sorted(mask_vars, key=str))})"
)
return mask

Expand Down

0 comments on commit 6758dc6

Please sign in to comment.