Skip to content

[G-API] Support multiple asynchronous requests#19487

Merged
alalek merged 11 commits intoopencv:masterfrom
TolyaTalamanov:at/support-nireq-option
Feb 26, 2021
Merged

[G-API] Support multiple asynchronous requests#19487
alalek merged 11 commits intoopencv:masterfrom
TolyaTalamanov:at/support-nireq-option

Conversation

@TolyaTalamanov
Copy link
Copy Markdown
Contributor

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Build configuration

Xforce_builders_only=linux,docs
force_builders=Custom,Custom Win,Custom Mac
build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f

Xbuild_image:Custom=centos:7
Xbuildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f

build_image:Custom=ubuntu-openvino-2021.1.0:20.04
build_image:Custom Win=openvino-2021.1.0
build_image:Custom Mac=openvino-2021.1.0

test_modules:Custom=gapi
test_modules:Custom Win=gapi
test_modules:Custom Mac=gapi

buildworker:Custom=linux-1
# disabled due high memory usage: test_opencl:Custom=ON
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

@dmatveev
Copy link
Copy Markdown
Contributor

It seems a rebase is required

@dmatveev
Copy link
Copy Markdown
Contributor

@TolyaTalamanov can you please rebase to make the changeset clear?

Copy link
Copy Markdown
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.

Reviewed ~40%, but didn't review the actual asynchronous pool part. Please clean-up code first (and, if possible, isolate changes for a single infer only.

IEConfig config;

// NB: Number of asyncrhonious infer requests
size_t nireq;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just wondering why this and the above variables are not initialized by default.

Initially it was just num_in / num_out I've left empty for some reason (as those are always initialized in ctor), but now it doesn't looks so good.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Didn't get your point, now it is initialized in ctor. What's the problem ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The problem is when a new ctor is added (who knows), these fields may left uninitialized

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Partial initialization isn't supported in C++11

@TolyaTalamanov TolyaTalamanov force-pushed the at/support-nireq-option branch 2 times, most recently from 2ada749 to 13d7c1b Compare February 19, 2021 09:56
@TolyaTalamanov TolyaTalamanov force-pushed the at/support-nireq-option branch from 13d7c1b to 5db2378 Compare February 19, 2021 11:22
@TolyaTalamanov TolyaTalamanov force-pushed the at/support-nireq-option branch 2 times, most recently from 19be9a6 to 3a97e94 Compare February 19, 2021 12:24
@TolyaTalamanov TolyaTalamanov force-pushed the at/support-nireq-option branch from 3a97e94 to 161a880 Compare February 19, 2021 13:02
Copy link
Copy Markdown
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.

Let's setup an overview call tomorrow.

What can be done for sure now is moving the async worker pool into something generic and unit-testable

@TolyaTalamanov TolyaTalamanov force-pushed the at/support-nireq-option branch 2 times, most recently from ff27092 to 115231f Compare February 24, 2021 13:35
@TolyaTalamanov TolyaTalamanov force-pushed the at/support-nireq-option branch from 115231f to ea0cf6f Compare February 24, 2021 13:47
Copy link
Copy Markdown
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.

Approved if tests pass

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@alalek

return requests;
}

class cv::gimpl::ie::RequestPool {
Copy link
Copy Markdown
Member

@alalek alalek Feb 26, 2021

Choose a reason for hiding this comment

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

class cv::gimpl::ie::RequestPool {
struct RequestPool;

Warning on "Custom Win" builder:

C:\build\precommit_custom_windows\opencv\modules\gapi\src\backends\ie\giebackend.cpp(497): warning C4099: 'cv::gimpl::ie::RequestPool': type name first seen using 'struct' now seen using 'class' [C:\build\precommit_custom_windows\build\modules\gapi\opencv_gapi.vcxproj]

"Custom Mac":

/build/precommit_custom_mac/opencv/modules/gapi/src/backends/ie/giebackend.cpp:497:1: warning: 'RequestPool' defined as a class here but previously declared as a struct; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@alalek

@alalek alalek merged commit 28c064f into opencv:master Feb 26, 2021
@alalek alalek mentioned this pull request Apr 9, 2021
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…option

[G-API] Support multiple asynchronous requests

* Support nireq option

* Disable tests to check CI

* Fix bug with hanging

* WA to green CI

* Snapshot

* Simplify RequestPool

* Add default values to id

* Fix win warning
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.

3 participants