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

✨[Feature] Expand index converter support to boolean masks #2518

Open
zewenli98 opened this issue Dec 6, 2023 · 3 comments
Open

✨[Feature] Expand index converter support to boolean masks #2518

zewenli98 opened this issue Dec 6, 2023 · 3 comments
Assignees
Labels
feature request New feature or request

Comments

@zewenli98
Copy link
Collaborator

Current index converter only supports int type while cannot handle bool mask indices.

We need to expand index support to boolean masks, since this is a valid usage in Torch and we already support something very similar in aten.where.

Reported in the bug: #2480

@zewenli98 zewenli98 added the feature request New feature or request label Dec 6, 2023
@zewenli98
Copy link
Collaborator Author

zewenli98 commented Dec 6, 2023

#2487

@zewenli98
Copy link
Collaborator Author

zewenli98 commented Dec 11, 2023

I think for this converter, the output shape is dynamic because it depends on the mask. It's similar to a bug reported in #2516. So let's wait for getting TRT bug fixed.

@zewenli98 zewenli98 assigned zewenli98 and unassigned narendasan Dec 12, 2023
@peri044
Copy link
Collaborator

peri044 commented Jan 18, 2024

I think for this converter, the output shape is dynamic because it depends on the mask. It's similar to a bug reported in #2516. So let's wait for getting TRT bug fixed.

@zewenli98 One thing to note in the case of x[mask] is that mask is a boolean tensor. And in the index converter implementation, https://github.com/pytorch/TensorRT/blob/main/py/torch_tensorrt/dynamo/conversion/impl/select.py#L130
the indices tensor received would be a boolean mask. This boolean mask should be converted to indices (where the non zero valued indices should be extracted. I'm not sure if TRT has such an operator)

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

No branches or pull requests

3 participants