Skip to content

Commit

Permalink
[inductor] Make load_mask() codegen determinstic (#126017)
Browse files Browse the repository at this point in the history
Pull Request resolved: #126017
Approved by: https://github.com/shunting314
  • Loading branch information
jansel authored and pytorchmergebot committed May 13, 2024
1 parent 82edc8b commit 6370749
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(sorted(map(str, mask_vars)))})"
)
return mask

Expand Down

0 comments on commit 6370749

Please sign in to comment.