-
Notifications
You must be signed in to change notification settings - Fork 359
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 dynamic shape support for cumsum/grid #3051
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, pending CI.
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, just a few minor comments.
# the trip_limit has to be a 0D shape tensor, however this impl.shape.shape gives a 1D shape | ||
# for example if the trip limit is 3, it wants a tensor(3), not a tensor([3]) | ||
# in order to reduce it from 1D to 0D, i have to use this impl.reduce.sum | ||
trip_limit = impl.reduce.sum( | ||
ctx, target, source_ir, name, trip_limit, 0, keepdim=False | ||
) |
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.
Another way to create a 0D shape tensor you can refer to: https://github.com/pytorch/TensorRT/blob/main/py/torch_tensorrt/dynamo/conversion/impl/embedding.py#L191
Description
Add dynamic shape support for cumsum/grid
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: