Skip to content
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

Reference implementation for ScatterUpdate #1678

Merged

Conversation

arogowie-intel
Copy link
Contributor

No description provided.

@arogowie-intel arogowie-intel added the category: Core OpenVINO Core (aka ngraph) label Aug 7, 2020
@arogowie-intel arogowie-intel requested review from postrational, tomdol and a team August 7, 2020 08:50
@arogowie-intel arogowie-intel self-assigned this Aug 7, 2020
//
// for i_coord in indices[m, n, ..., p]:
// i_idx = index(i_coord)
// for d_coord in slice data[..., i_idx, ...] &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment makes understanding the algorithm harder. What does "slice data" mean? And how should we understand two for-loops joined with &&?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slice here has NumPy meaning so, data[..., i_idx, ....] is a shortcut for a slice of n-dimensional tensor of input data. The ellipsis stands for : symbol, which gets all values from respective axis, for all dimensions up to i_idx (the axis at which we have update indexes) and following it till the end.

ngraph/src/ngraph/runtime/reference/scatter_update.hpp Outdated Show resolved Hide resolved
@postrational postrational requested review from tomdol and mbencer August 10, 2020 11:50
@ilyachur
Copy link
Contributor

Could you measure the impact on binary size?

Also I see a lot of template code. Can we reduce it and use template code only when it is needed?

ngraph/src/ngraph/op/scatter_update.cpp Outdated Show resolved Hide resolved
@ilyachur ilyachur self-assigned this Aug 10, 2020
@arogowie-intel arogowie-intel removed their assignment Aug 11, 2020
@arogowie-intel
Copy link
Contributor Author

@postrational Please feel free to assign this PR to anyone if more work would be needed I think my part here is done.

@mitruska mitruska self-assigned this Aug 24, 2020
@mitruska
Copy link
Contributor

mitruska commented Aug 24, 2020

Could you measure the impact on binary size?

Also I see a lot of template code. Can we reduce it and use template code only when it is needed?

I see that in the meantime other reference implementation for ScatterUpdate #1494 was merged into master but with a template approach and without the evaluate method.

As @ilyachur requested, I removed the template code (diff) from the reference implementation proposed in this PR what decreased libngraph.so by 32 768 bytes.
But comparing to the current master branch, this PR will add 12 288 bytes to libngraph.so anyway.

Please rereview these changes.

@mitruska mitruska requested review from ilyachur and tomdol August 24, 2020 13:12
@mitruska mitruska requested a review from postrational August 24, 2020 13:17
@ilyachur
Copy link
Contributor

I see that in the meantime other reference implementation for ScatterUpdate #1494 was merged into master but with a template approach and without the evaluate method.

As @ilyachur requested, I removed the template code (diff) from the reference implementation proposed in this PR what decreased libngraph.so by 32 768 bytes.
But comparing to the current master branch, this PR will add 12 288 bytes to libngraph.so anyway.

Please rereview these changes.

Thanks, I will take a look. At the current moment we use ScatterUpdate implementation only for tests and it don't affect the size of nGraph library. If we add evaluate methods and start to use reference implementations we need to think about binary size.

@ilyachur ilyachur merged commit 393e929 into openvinotoolkit:master Aug 25, 2020
mryzhov pushed a commit to mryzhov/openvino that referenced this pull request Aug 26, 2020
* Reference implementation for ScatterUpdate and use of it in evaluate.

* Review comments. Clarify comments.

* Update file directory.

* Replace scatter_update reference implementation in ngraph/core/reference/

* Remove template code from ScatterUpdate reference implementation

* Apply review requests

Co-authored-by: mitruska <[email protected]>
RomanZm pushed a commit to RomanZm/openvino that referenced this pull request Aug 28, 2020
* Reference implementation for ScatterUpdate and use of it in evaluate.

* Review comments. Clarify comments.

* Update file directory.

* Replace scatter_update reference implementation in ngraph/core/reference/

* Remove template code from ScatterUpdate reference implementation

* Apply review requests

Co-authored-by: mitruska <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Core OpenVINO Core (aka ngraph)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants