-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INTERPRETER] Fix scalar mask when the value is False (#3880)
We hacked scalar tensor's `__bool__` method so that `if (scalar tensor)` can be executed in the interpreter mode. https://github.com/openai/triton/blob/main/python/triton/runtime/interpreter.py#L700 But scalar tensors shouldn't be evaluated in `semantic.py`. We could have `tl.load(..., mask=tl.tensor([False]), other=tl.tensor([1.0])`. It is still valid. Only when `mask=None, other!=None` it is invalid. Without this PR, `not tl.tensor([False])` is evaluated as True and raises the wrong `ValueError`. So we should instead check if the tensor is None or not.
- Loading branch information
Showing
2 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters