Skip to content

Tensor::get_byte_size returns incorrect result with v2024.4.0 #143

@abrown

Description

@abrown

TLDR: this issue describes how an breaking change in the upstream C bindings results in incorrect behavior in these Rust bindings; the solution is to use a newer version of OpenVINO (v2024.2 and up) along with a recent version of these bindings (v0.8.0 and up).


#142 adds an easier way to update the bindings to use the latest OpenVINO C headers; as I used it I discovered the Tensor::get_byte_size is returning a different result than previously. I ran:

$ cargo xtask update 2024.4.0
$ cargo xtask codegen
$ cargo test

And the memory_safety test promptly failed with:

thread 'memory_safety' panicked at crates/openvino/tests/memory-safety.rs:26:40:
source slice length (13956476) does not match destination slice length (111651808)

Interestingly enough, 111651808 / 13956476 = 8 so it could be that some internal data type was unwittingly changed upstream. It's notable that the weights buffer we pass in contains 13956476 bytes and has had that size since the mobilenet test fixture was added. And I am running the test with the OpenVINO 2024.1.0 library installed; the only thing that changes here is the OpenVINO C header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions