-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Codegen] Support broadcast op with symbolic shape #3389
Conversation
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 for the RFC, I like the idea. Sorry that I didn't get enough time to comment specifically about the behavior, can you please open an RFC issue? So we can discuss it a bit more. The things to be improved are
|
I do think it is proper to introduce |
@were Could you review this PR? |
LGTM, too. |
@tqchen modified per suggestion. |
python/tvm/api.py
Outdated
auto_broadcast buffer allows one to implement broadcast computation | ||
without considering whether dimension size equals to one. | ||
TVM will insert `strides[i] = shape[i] == 1 ? 0 : strides[i]` during arg binding. | ||
See src/pass/arg_binder.cc for reference. |
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.
Let us avoid refer to c++ code in the python side, would be great if python doc can stand by itself
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.
addressed
Thanks @tqchen @junrushao1994 @were for review. |
* [Codegen] Support broadcast op with symbolic shape * fix case where last dim = 1 * use enum; simplify stride calculation; improve doc * fix lint * improve py doc
* [Codegen] Support broadcast op with symbolic shape * fix case where last dim = 1 * use enum; simplify stride calculation; improve doc * fix lint * improve py doc
* [Codegen] Support broadcast op with symbolic shape * fix case where last dim = 1 * use enum; simplify stride calculation; improve doc * fix lint * improve py doc
Per https://discuss.tvm.ai/t/rfc-codegen-broadcast-ops-with-symbolic-shape/2908
@tqchen @reminisce @junrushao1994 Please review.