Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tags: v2.1] Error behaviorfor 'flag_gems.masked_fill(inp, mask, value)' #266

Open
Dayrker opened this issue Oct 29, 2024 · 2 comments
Open

Comments

@Dayrker
Copy link

Dayrker commented Oct 29, 2024

Describe the bug

位置:
FlagGems/tests/test_unary_pointwise_ops.py::test_accuracy_masked_fill
FlagGems/src/flag_gems/ops/masked_fill.py

现象1:
在masked_fill.py中加打印, with flag_gems.use_gems():使用时不会出现打印,flag_gems.masked_fill(inp, mask, value)使用时才会走打印引处
怀疑原因:
算子没替换好

现象2:
flag_gems.masked_fill(inp, mask, value)使用时,‘line61: value = value.contiguous()’出错
怀疑原因:
value一般输入是int,不需要.contiguous()

@StrongSpoon
Copy link
Collaborator

@GwokHiujin please take a look. I think we need another kernel to deal with scalar-type value.

@GwokHiujin
Copy link
Collaborator

@GwokHiujin please take a look. I think we need another kernel to deal with scalar-type value.

Indeed, PyTorch includes the aten::masked_fill.Scalar(Tensor self, Tensor mask, Scalar value) -> (Tensor) operation. I will proceed with this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants