Updates the OpenVINO backend for wasi-nn to pre-configure all inputs as `NHWC`. This is not a long-term fix but no worse than the status quo, which configures all input tensors to the same layout. This change updates the CI script to use the latest version of OpenVINO. Closes #3948. Co-authored-by: Andrew Brown <andrew.brown@intel.com>
This commit is contained in:
@@ -17,7 +17,7 @@ anyhow = "1.0"
|
||||
wiggle = { path = "../wiggle", version = "=0.35.0" }
|
||||
|
||||
# These dependencies are necessary for the wasi-nn implementation:
|
||||
openvino = { version = "0.3.1", features = ["runtime-linking"] }
|
||||
openvino = { version = "0.3.3", features = ["runtime-linking"] }
|
||||
thiserror = "1.0"
|
||||
|
||||
[build-dependencies]
|
||||
|
||||
@@ -40,7 +40,15 @@ impl Backend for OpenvinoBackend {
|
||||
.0
|
||||
.as_mut()
|
||||
.expect("openvino::Core was previously constructed");
|
||||
let cnn_network = core.read_network_from_buffer(&xml, &weights)?;
|
||||
let mut cnn_network = core.read_network_from_buffer(&xml, &weights)?;
|
||||
|
||||
// TODO this is a temporary workaround. We need a more eligant way to specify the layout in the long run.
|
||||
// However, without this newer versions of OpenVINO will fail due to parameter mismatch.
|
||||
for i in 0..cnn_network.get_inputs_len()? {
|
||||
let name = cnn_network.get_input_name(i)?;
|
||||
cnn_network.set_input_layout(&name, Layout::NHWC)?;
|
||||
}
|
||||
|
||||
let exec_network =
|
||||
core.load_network(&cnn_network, map_execution_target_to_string(target))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user