-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Extend CPU Plugin with SegmentMax-16
reference implementation
#28979
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
…into segmentmax_core Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
…into segmentmax_core Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Signed-off-by: p-wysocki <[email protected]>
Co-authored-by: Pawel Raasz <[email protected]>
Co-authored-by: Pawel Raasz <[email protected]>
Co-authored-by: Pawel Raasz <[email protected]>
…max_shape_inference_test.cpp Co-authored-by: Pawel Raasz <[email protected]>
Co-authored-by: Pawel Raasz <[email protected]>
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.
Ok for src/core/reference
part.
|
||
template <typename T, | ||
typename T_idx, | ||
typename std::enable_if<std::is_same<typename std::decay<T_idx>::type, int64_t>::value>::type* = nullptr> |
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.
typename std::enable_if<std::is_same<typename std::decay<T_idx>::type, int64_t>::value>::type* = nullptr> | |
typename std::enable_if_t<std::is_same_v<typename std::decay_t<T_idx>, int64_t>>* = nullptr> |
|
||
template <typename T, | ||
typename T_idx, | ||
typename std::enable_if<!std::is_same<typename std::decay<T_idx>::type, int64_t>::value>::type* = nullptr> |
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.
typename std::enable_if<!std::is_same<typename std::decay<T_idx>::type, int64_t>::value>::type* = nullptr> | |
typename std::enable_if_t<!std::is_same_v<typename std::decay_t<T_idx>, int64_t>>* = nullptr> |
### Details: - Add reference implementation - Add tests ### Related PRs: - #28103 - #28698 - #28979 - #28999 ### Tickets: - CVS-158917 --------- Signed-off-by: p-wysocki <[email protected]> Co-authored-by: Roman Kazantsev <[email protected]> Co-authored-by: Pawel Raasz <[email protected]> Co-authored-by: Katarzyna Mitrus <[email protected]>
### Details: - The original PR (#28788) has been mistakenly force-merged due to a mistake in merge queue settings. It was later reverted, so this is the "new" Ref PR. - Add reference implementation - Add tests ### Related PRs: - #28103 - #28698 - #28979 - #28999 ### Tickets: - CVS-158917 --------- Signed-off-by: p-wysocki <[email protected]> Co-authored-by: Roman Kazantsev <[email protected]> Co-authored-by: Pawel Raasz <[email protected]> Co-authored-by: Katarzyna Mitrus <[email protected]>
if (useNumSegments) { | ||
auto numSegments = std::make_shared<ov::op::v0::Constant>(segmentIdsPrecision, ov::Shape{}, numSegmentsValue); | ||
segmentMax = std::make_shared<ov::op::v16::SegmentMax>(dataParameter, segmentIdsConst, numSegments, fillMode); |
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 a scenario with numSegments as Parameter be tested as well?
OV_CASE2(ov::element::f32, ov::element::i64, float, int64_t), | ||
OV_CASE2(ov::element::f16, ov::element::i32, ov::float16, int32_t), | ||
OV_CASE2(ov::element::f16, ov::element::i64, ov::float16, int64_t), | ||
OV_CASE2(ov::element::bf16, ov::element::i32, ov::bfloat16, int32_t), | ||
OV_CASE2(ov::element::bf16, ov::element::i64, ov::bfloat16, int64_t), |
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.
AFAIK i64 is converted by CPU plugin to i32, could you please verify that cases for i64 are correctly executed here?
template <class T, class T_idx> | ||
void SegmentMax::executeImpl() { | ||
const auto& data_shape = getSrcMemoryAtPort(0)->getStaticDims(); | ||
const auto& output_shape = getDstMemoryAtPort(0)->getShape().getStaticDims(); |
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.
As output shape can be related to the num_segments
input (if provided). Consider implementation of some additional logic and override the "needShapeInfer()" from CPU Node class.
Details:
SegmentMax-16
reference implementation #28788, it's currently merged into this PRRelated PRs:
SegmentMax-16
#28103SegmentMax-16
to Core #28698SegmentMax-16
reference implementation #28788SegmentMax-16
#28999Tickets: