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

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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

  • 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
    GPU 0.000
    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 <[email protected]>
@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
@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
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings category: inference OpenVINO Runtime library - Inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant