-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add support for bucketize #18040
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
Add support for bucketize #18040
Conversation
|
for operators like this one, we also need legalization rule to know how to lower them. We don;t want to be end up in a situation where we have the ops but canot lower/compile them. cc @tlopex |
@tqchen I came across the PyTorch implementation of this operation and noticed that they used |
|
Thanks, would be good to go through the checklist below. Some checklist for adding a new op.
|
|
I think the main question is how to make sure it runs on cuda |
|
@tqchen Thank you. I understood the high-level idea you suggested, but I have a few specific questions regarding the design choices:
|
Given this is relax importer, we can chose either options as long as the correctness match. When possible, if we can decompose via relax then legalize, it gives most opportunities for possible choice of lowering path. We should aim to reduce total number of core relax ops
yes ideally we should have a nightly test validating the correctness We can add such tests to https://github.com/apache/tvm/tree/main/tests/python/nightly nightly/relax/test_relax_op_numeric.py |
|
@tqchen Thanks for your response. I'll make sure the checklists are satisfied. But I'm not sure what i should do if C2 is not met. |
6bd491f to
1545a3e
Compare
|
@tqchen I've updated the op to compile and run on CUDA as you requested. Can you please review it. |
|
Please resolve the conflicts so that we can merge it:) |
|
@tlopex I've resolved the conflicts. Can you please take a look? |
tlopex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
* add support for bucketize * fix lint issue * Fix lint issue * Add GPU code for bucketize * Resolve merge conflict * Fix lint issue
This PR adds support for bucketize op which is used in many vision models like Phi4, SmolVLM etc.,