Skip to content

[G-API] IE backend convert fp32 to fp16#20106

Merged
alalek merged 3 commits intoopencv:masterfrom
TolyaTalamanov:at/auto-convert-fp16
May 18, 2021
Merged

[G-API] IE backend convert fp32 to fp16#20106
alalek merged 3 commits intoopencv:masterfrom
TolyaTalamanov:at/auto-convert-fp16

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
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.3.0:20.04
build_image:Custom Win=openvino-2021.3.0
build_image:Custom Mac=openvino-2021.3.0

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
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@dmatveev Have a look, please

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 but please but the native FP16 handling in our backlog

if (output.second->getPrecision() == IE::Precision::FP16) {
output.second->setPrecision(IE::Precision::FP32);
}
}
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.

Does it simply works like this? One can set this precision and IE will be forced to provide it?

Copy link
Copy Markdown
Contributor Author

@TolyaTalamanov TolyaTalamanov May 17, 2021

Choose a reason for hiding this comment

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

Does it simply works like this? One can set this precision and IE will be forced to provide it?

Must work if corresponding plugin implement it, because preprocessing is done on IE core, but postprocessing like this is plugin responsibility so far.

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.

I believe we can provide API to configure input/output descriptor in future.

@dmatveev dmatveev self-assigned this May 17, 2021
@dmatveev dmatveev added this to the 4.5.3 milestone May 17, 2021
@dmatveev
Copy link
Copy Markdown
Contributor

Maybe exposing FP16 as output type is a better & more straightforward solution

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@alalek Can it be merged ?

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@alalek

@alalek alalek merged commit 70d1ff7 into opencv:master May 18, 2021
@alalek alalek mentioned this pull request Jun 4, 2021
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
[G-API] IE backend convert fp32 to fp16

* Support FP16 in IE backend
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