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

GAPI Fluid SIMD:Add support of new several types for the Merge3. #21797

Merged

Conversation

anna-khakimova
Copy link
Member

@anna-khakimova anna-khakimova commented Mar 30, 2022

  • Support of the new several types was added.
  • Fixes for the Split/Merge and ConvertTo issues.
force_builders=Linux AVX2,Linux32,Win32,Custom,Custom Win,Custom Mac
build_gapi_standalone:Linux x64=ade-0.1.2a
build_gapi_standalone:Win64=ade-0.1.2a
Xbuild_gapi_standalone:Mac=ade-0.1.2a
build_gapi_standalone:Linux x64 Debug=ade-0.1.2a

build_image:Custom=centos:7
buildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.2a

Xbuild_image:Custom=ubuntu-openvino-2021.3.0:20.04
build_image:Custom Win=openvino-2021.4.1
build_image:Custom Mac=openvino-2021.2.0

buildworker:Custom Win=windows-3

test_modules:Custom=gapi,python2,python3,java
test_modules:Custom Win=gapi,python2,python3,java
test_modules:Custom Mac=gapi,python2,python3,java

buildworker:Custom=linux-1
# disabled due high memory usage: test_opencl:Custom=ON
Xtest_opencl:Custom=OFF
Xtest_bigdata:Custom=1
Xtest_filter:Custom=*

CPU_BASELINE:Custom Win=AVX512_SKX
CPU_BASELINE:Custom=SSE4_2

@@ -86,6 +86,25 @@ using cv::gapi::own::rintd;
return; \
}

#define MERGE3_(T, OP, ...) \
Copy link
Contributor

Choose a reason for hiding this comment

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

Cannot find place where is it used, could you point me out?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. It is used here.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

discussed offline:
to move out repeated conditions into beginning of function to simplify condition calculation complexity in actual type dispatching routing

Copy link
Contributor

@sivanov-work sivanov-work left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -86,6 +86,25 @@ using cv::gapi::own::rintd;
return; \
}

#define MERGE3_(T, OP, ...) \
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks

@@ -86,6 +86,25 @@ using cv::gapi::own::rintd;
return; \
}

#define MERGE3_(T, OP, ...) \
Copy link
Contributor

Choose a reason for hiding this comment

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

discussed offline:
to move out repeated conditions into beginning of function to simplify condition calculation complexity in actual type dispatching routing

@@ -252,6 +252,7 @@ INSTANTIATE_TEST_CASE_P(Split4PerfTestCPU, Split4PerfTest,
INSTANTIATE_TEST_CASE_P(Merge3PerfTestCPU, Merge3PerfTest,
Combine(Values(AbsExact().to_compare_f()),
Values(szSmall128, szVGA, sz720p, sz1080p),
Values(CV_8U),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should other types be listed here?

Copy link
Contributor

Choose a reason for hiding this comment

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

..and in GPU tests, too.

\
OP<T>(__VA_ARGS__); \
return; \
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Macro function bodies considered harmful, is there any reasonable issues with rewriting it to templates?

Comment on lines +93 to +95
GAPI_DbgAssert(dst.length() == src1.length()); \
GAPI_DbgAssert(dst.length() == src2.length()); \
GAPI_DbgAssert(dst.length() == src3.length()); \
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the reason to verify this?
normally in the framework we rely on our output buffers which are allocated per our needs.
it is not coming somewhere from the outside.

@asmorkalov
Copy link
Contributor

@anna-khakimova @dmatveev Do you plan to finish the PR in meantime?

@asmorkalov
Copy link
Contributor

@dmatveev @TolyaTalamanov Friendly reminder.

1 similar comment
@asmorkalov
Copy link
Contributor

@dmatveev @TolyaTalamanov Friendly reminder.

@asmorkalov asmorkalov removed this from the 4.8.0 milestone May 5, 2023
@dmatveev
Copy link
Contributor

Will have a look at this one too.

@dmatveev dmatveev added this to the 4.8.0 milestone May 23, 2023
@dmatveev
Copy link
Contributor

@rgarnov can you please have a look?

@dmatveev dmatveev force-pushed the ak/merge3_extend_supported_types branch from 753c404 to 42653f5 Compare May 29, 2023 09:38
Copy link
Contributor

@dmatveev dmatveev left a comment

Choose a reason for hiding this comment

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

Tested locally, these changes don't bring any regressions on my end but so far extend Fluid's merge3 with extra data types.

Can be merged IMO

Geometric mean (ms)

                                               Name of Test                                                  4x   anna     anna
                                                                                                                  simd     simd
                                                                                                                            vs
                                                                                                                            4x
                                                                                                                        (x-factor)
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 128x128, 8UC1, { gapi.kernel_package })      -   0.016     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 128x128, 16UC1, { gapi.kernel_package })     -   0.019     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 128x128, 16SC1, { gapi.kernel_package })     -   0.019     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 128x128, 32FC1, { gapi.kernel_package })     -   0.025     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 128x128, { gapi.kernel_package })          0.016   -       -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 640x480, 8UC1, { gapi.kernel_package })      -   0.099     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 640x480, 16UC1, { gapi.kernel_package })     -   0.175     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 640x480, 16SC1, { gapi.kernel_package })     -   0.178     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 640x480, 32FC1, { gapi.kernel_package })     -   0.347     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 640x480, { gapi.kernel_package })          0.103   -       -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 1280x720, 8UC1, { gapi.kernel_package })     -   0.255     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 1280x720, 16UC1, { gapi.kernel_package })    -   0.621     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 1280x720, 16SC1, { gapi.kernel_package })    -   0.613     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 1280x720, 32FC1, { gapi.kernel_package })    -   1.729     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 1280x720, { gapi.kernel_package })         0.258   -       -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 1920x1080, 8UC1, { gapi.kernel_package })    -   0.781     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 1920x1080, 16UC1, { gapi.kernel_package })   -   1.985     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 1920x1080, 16SC1, { gapi.kernel_package })   -   1.975     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 1920x1080, 32FC1, { gapi.kernel_package })   -   4.211     -
TestPerformance::Merge3PerfTestFluid/Merge3PerfTest::(compare_f, 1920x1080, { gapi.kernel_package })        0.744   -       -
TestPerformance::Merge4PerfTestFluid/Merge4PerfTest::(compare_f, 128x128, { gapi.kernel_package })          0.019 0.020    0.96
TestPerformance::Merge4PerfTestFluid/Merge4PerfTest::(compare_f, 640x480, { gapi.kernel_package })          0.127 0.129    0.98
TestPerformance::Merge4PerfTestFluid/Merge4PerfTest::(compare_f, 1280x720, { gapi.kernel_package })         0.361 0.348    1.04
TestPerformance::Merge4PerfTestFluid/Merge4PerfTest::(compare_f, 1920x1080, { gapi.kernel_package })        1.228 1.221    1.01

@asmorkalov
Copy link
Contributor

@opencv-alalek Could you take a look on CI failures. It looks like some update is required.

@dmatveev
Copy link
Contributor

Yep the main build runs ok:

-- ADE: Downloading v0.1.2a.zip from https://github.com/opencv/ade/archive/v0.1.2a.zip

But there's a separate ADE step where another (older) version is mentioned:

CMake Error: The source directory "/build/precommit_linux64_no_opt/build/3rdparty/ade/ade-0.1.1f" does not exist.

@opencv-alalek
Copy link
Contributor

0.1.1f

Because it is mentioned in CI configuration section of PR's description.

@dmatveev
Copy link
Contributor

Because it is mentioned in CI configuration section of PR's description.

Cool! Didn't know it still works given that there's Github Actions :)

@asmorkalov asmorkalov merged commit 6d3dd24 into opencv:4.x May 31, 2023
21 checks passed
@asmorkalov asmorkalov mentioned this pull request Jul 12, 2023
thewoz pushed a commit to thewoz/opencv that referenced this pull request Jan 4, 2024
…supported_types

GAPI Fluid SIMD:Add support of new several types for the Merge3

- Support of the new several types was added.
- Fixes for the Split/Merge and ConvertTo issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants