Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[core] Improve ov::element::Type to support constexpr where possible #28643

Merged
merged 11 commits into from
Jan 31, 2025

Conversation

praasz
Copy link
Contributor

@praasz praasz commented Jan 23, 2025

Details:

  • Make Type class members constexpr if possible

  • Make function ov::element::from constexpr instead templtae specialization which allowe use it in compile time

  • Make global element types as inline to use single address

  • Refactor internals of element Type class

  • Deprecate function Type fundamental_type_for(const Type& type); as not used in project and there element traits can be used as alternative

  • Reduce code maintenance as add new types requires update less places in code.

  • This changes have positive impact on binary size of most of OV libraries (negative value means reduced size)

    Library Diff [KiB]
    OV -12.825
    CPU -0.709
    NPU -1.188
    IR FE -0.114
    JAX FE 0.013
    ONNX FE -1.954
    Paddle FE -0.907
    pytorch FE -0.947
    TF FE -2.313
    TF LITE FE -0.738

Tickets:

- add common util make_array
- element type internals refactoring

Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
@praasz praasz added this to the 2025.1 milestone Jan 23, 2025
@praasz praasz requested review from a team as code owners January 23, 2025 13:12
@github-actions github-actions bot added category: inference OpenVINO Runtime library - Inference category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings labels Jan 23, 2025
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
@praasz praasz added the WIP work in progress label Jan 23, 2025
@praasz praasz force-pushed the improve-ov-element-type-impl branch from f2a5029 to 196e898 Compare January 23, 2025 16:19
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
@praasz praasz force-pushed the improve-ov-element-type-impl branch from 196e898 to 95cebc8 Compare January 23, 2025 18:43
@praasz praasz removed the WIP work in progress label Jan 23, 2025
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
@praasz praasz requested review from a team as code owners January 24, 2025 10:37
@github-actions github-actions bot added the category: IE Tests OpenVINO Test: plugins and common label Jan 24, 2025
Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
Co-authored-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
@praasz praasz requested a review from t-jankowski January 28, 2025 06:49
Copy link
Contributor

@olpipi olpipi left a comment

Choose a reason for hiding this comment

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

LGTM in general but there is 1 comment

Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
@praasz praasz requested a review from olpipi January 30, 2025 07:21
@praasz praasz enabled auto-merge January 31, 2025 13:47
@praasz praasz added this pull request to the merge queue Jan 31, 2025
Merged via the queue into openvinotoolkit:master with commit a7fe2a2 Jan 31, 2025
185 checks passed
@praasz praasz deleted the improve-ov-element-type-impl branch January 31, 2025 18:35
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings category: IE Tests OpenVINO Test: plugins and common category: inference OpenVINO Runtime library - Inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants