-
Notifications
You must be signed in to change notification settings - Fork 987
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
rfc: align corners in resampling primitive #1651
base: rfcs
Are you sure you want to change the base?
Conversation
Hi @isuruf, thank you for the RFC. I have several questions:
Based on 3) and 4), the other option might be to extend existing list of algorithms - it's less flexible, but no API change. It would be good to write it down, too. Thanks. |
Yes, pytorch does and opencv too.
There's no particular performance benefit. This is a new feature addition.
It's only for linear algorithm.
An option to remove half pixel centers to match tensorflow 1.x series might be another option. I've added all of these to the RFC doc. |
Well, there are a bunch of AI solutions out there. If this functionality to be built for a specific one, this definitely decreases its priority and chances for implementation/promotion since each new feature comes with maintenance and validation cost.
So... the feature is built to achieve something. If this "something" can't be measured, why doing it? Framework fallback code should be enough then. Thanks. |
We have several requests from framework developers on this topic as fallback code for GPU creates some duplication and does not handle blocked formats. Unless this mode adds complexity beyond changing the grid I believe it has value.
One more thing that recently landed on my desk is |
@isuruf, could you please also look at differences between Pytorch nearest/nearest-exact algorithms and oneDNN's implementation? |
@vpirogov, Pytorch's oneDNN's nearest (Pytorch's static inline float linear_map(dim_t y, dim_t y_max, dim_t x_max) {
return ((y + 0.5f) * x_max / y_max) - 0.5f;
}
static inline dim_t nearest_idx(dim_t y, dim_t y_max, dim_t x_max) {
return (dim_t)roundf(linear_map(y, y_max, x_max));
} Pytorch's static inline dim_t nearest_exact_idx(dim_t y, dim_t y_max, dim_t x_max) {
return (dim_t)roundf(y * x_max / y_max);
} |
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.
Approving Option 2.
Option 1 can be considered when the next major API release happens if there are enough evidences flags provide better support over stack of algorithms.
Link to a rendered document.