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

[Op][Topi] 5 ops can accept unsigned integers as indices #10098

Merged
merged 7 commits into from
Jan 30, 2022

Conversation

yuanfz98
Copy link
Contributor

Hello community,

This PR links to #10064. 5 ops (scatter, scatter_add, scatter_nd, unravel_index, adv_index) accept unsigned integers as indices. Somehow unravel_index with uint indices may raise

Check failed: y != 0 (0 vs. 0) 

in function

ICHECK_NE(y, 0);
.

I tried to figure out why shape[v] can be 0 in

cur_val = indexdiv(indices_divs.back(), shape[v]);
,
but I failed to understand.

Thank reviewers for your help and your time speeding in CR.

cc @AndrewZhaoLuo

@AndrewZhaoLuo
Copy link
Contributor

AndrewZhaoLuo commented Jan 28, 2022

Debugging I've worked the issue to likely src/tir/transforms/narrow_datatype.cc, my guess analysis here does not take into account uint types

@AndrewZhaoLuo
Copy link
Contributor

#10102 <-- fix here. There is another error now with unravel index now though. You can try digging more, or you can drop unravel_index for later PR (which I recommend)

Copy link
Contributor

@AndrewZhaoLuo AndrewZhaoLuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM mostly, just lmk the plan to deal with unravel_index

@yuanfz98
Copy link
Contributor Author

yuanfz98 commented Jan 29, 2022

LGTM mostly, just lmk the plan to deal with unravel_index

Thanks for your help! I prefer to drop unravel_index and open a PR later.

Copy link
Contributor

@AndrewZhaoLuo AndrewZhaoLuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AndrewZhaoLuo AndrewZhaoLuo merged commit 1f9c76b into apache:main Jan 30, 2022
ylc pushed a commit to ylc/tvm that referenced this pull request Feb 16, 2022
* tests passed

* reformat

* add uint test for unravel_index
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

Successfully merging this pull request may close these issues.

2 participants