Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
【PaddlePaddle Hackathon 3 No.102】support paddle elementwise_floordiv #13059
【PaddlePaddle Hackathon 3 No.102】support paddle elementwise_floordiv #13059
Changes from all commits
b814dc6
3ef653a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Hi @taixiurong could add the test case with negative value, seems Paddle's implementation is aligned with Torch.
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.
but the paddle give a response:
PaddlePaddle/Paddle#46379
2. in this test case , i use a = -2, b = 1, is ok. a = -4, b = 3, z = floor_div(a/b), z = -1。 so want to modiy this logic in openvino?
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.
@ceciliapeng2011 @meiyang-intel what's your opinion ?
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.
@OpenVINO-dev-contest hi paddle fix this bug,
doc: https://github.com/PaddlePaddle/Paddle/pull/46419/files
code: https://github.com/PaddlePaddle/Paddle/pull/45051/files
i fix the code in openvino, tese code like:
the tese result:
do want to push new code ?
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.
of course, you can try it
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.
update
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.
Can you test float to check if OpenVINO and Paddle can have the same result too? I am afraid they won't.
OpenVINO divide op has an attribute "pythondiv", but works with integer only. That's why the integer tests pass.
openvino/src/core/reference/include/ngraph/runtime/reference/divide.hpp
Line 30 in 7bbd428
openvino/src/core/include/openvino/op/divide.hpp
Line 29 in 7bbd428
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.
@jane-intel Do you have comments about the algorithm discrepancy of openvino divide and paddle floor_divide? Thanks.
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.
https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/elementwise_kernel.cc#L144
https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/floor_divide_cn.html#floor-divide
paddle support int and int64, not support float.
the paddle finally to call static_cast(a / b).
https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/funcs/elementwise_functor.h#L573
in openvino if pythondiv is false , to call out[i] = arg0[i] / arg1[i]
openvino/src/core/reference/include/ngraph/runtime/reference/divide.hpp
Line 48 in 7bbd428
the logic is same.