Skip to content

Commit

Permalink
Merge branch 'openvinotoolkit:master' into documentation-update
Browse files Browse the repository at this point in the history
  • Loading branch information
SANTHOSH-MAMIDISETTI authored Jan 11, 2024
2 parents 58f39f7 + 0ad75bd commit 69c58e9
Show file tree
Hide file tree
Showing 12 changed files with 1,318 additions and 456 deletions.
862 changes: 431 additions & 431 deletions docs/sphinx_setup/_static/benchmarks_files/OV-benchmark-data.csv

Large diffs are not rendered by default.

48 changes: 37 additions & 11 deletions docs/sphinx_setup/_static/js/graphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class ExcelData {
this.throughputInt8 = csvdataline[4];
this.throughputFP16 = csvdataline[5];
this.throughputFP32 = csvdataline[6];
this.throughputBF16 = csvdataline[24];
this.value = csvdataline[7];
this.efficiency = csvdataline[8];
this.price = csvdataline[9];
Expand All @@ -132,6 +133,7 @@ class ExcelData {
this.latency16 = csvdataline[19];
this.latency32 = csvdataline[20];
this.latency4 = csvdataline[21];
this.latencyBF16 = csvdataline[23];
this.throughputUnit = csvdataline[15];
this.valueUnit = csvdataline[16];
this.efficiencyUnit = csvdataline[17];
Expand Down Expand Up @@ -168,7 +170,8 @@ class GraphData {
'int4': excelData.throughputInt4,
'int8': excelData.throughputInt8,
'fp16': excelData.throughputFP16,
'fp32': excelData.throughputFP32
'fp32': excelData.throughputFP32,
'bf16': excelData.throughputBF16
},
excelData.value,
excelData.efficiency,
Expand All @@ -178,7 +181,8 @@ class GraphData {
'int4': excelData.latency4,
'int8': excelData.latency,
'fp16': excelData.latency16,
'fp32': excelData.latency32
'fp32': excelData.latency32,
'bf16': excelData.latencyBF16
},);

this.price = excelData.price;
Expand Down Expand Up @@ -231,7 +235,7 @@ class Modal {
static getPrecisionsLabels(version) {
if (version == 'ovms')
return ['OV-INT8 (reference)', 'INT8', 'OV-FP32 (reference)', 'FP32'];
return ['INT4', 'INT8', 'FP16', 'FP32'];
return ['INT4', 'INT8', 'FP16', 'FP32', 'BF16'];
}
static getCoreTypes(labels) {
return labels.map((label) => {
Expand Down Expand Up @@ -262,13 +266,14 @@ class Modal {
return 'fp16';
case 'FP32':
return 'fp32';
case 'BF16':
return 'bf16';
default:
return '';
}
});
}
static getUnitDescription(unit) {
console.log(unit)
switch (unit) {
case 'msec.':
return '(lower is better)';
Expand Down Expand Up @@ -383,6 +388,8 @@ class Graph {
return { data: null, color: '#009fca', label: `FP16` };
case 'fp32':
return { data: null, color: '#007797', label: `FP32` };
case 'bf16':
return { data: null, color: '#00536a', label: `BF16` };
default:
return {};
}
Expand All @@ -402,6 +409,8 @@ class Graph {
return { data: null, color: '#8424a9', label: `FP16` };
case 'fp32':
return { data: null, color: '#5b037d', label: `FP32` };
case 'bf16':
return { data: null, color: '#37014c', label: `BF16` };
default:
return {};
}
Expand Down Expand Up @@ -787,7 +796,7 @@ $(document).ready(function () {
li.style.alignItems = 'center';
li.style.display = 'block';
li.style.flexDirection = 'column';
li.style.marginLeft = '10px';
li.style.marginLeft = '4px';

li.onclick = () => {
const {type} = chart.config;
Expand All @@ -806,7 +815,7 @@ $(document).ready(function () {
boxSpan.style.borderColor = item.strokeStyle;
boxSpan.style.borderWidth = item.lineWidth + 'px';
boxSpan.style.display = 'inline-block';
boxSpan.style.height = '12px';
boxSpan.style.height = '10px';
boxSpan.style.marginRight = '4px';
boxSpan.style.width = '30px';

Expand All @@ -815,7 +824,8 @@ $(document).ready(function () {
textContainer.style.color = item.fontColor;
textContainer.style.margin = 0;
textContainer.style.padding = 0;
textContainer.style.fontSize = '0.8rem';
textContainer.style.fontSize = '0.6rem';
textContainer.style.marginLeft = '3px';
textContainer.style.textDecoration = item.hidden ? 'line-through' : '';

const text = document.createTextNode(item.text);
Expand Down Expand Up @@ -871,7 +881,7 @@ $(document).ready(function () {
data: item.data,
backgroundColor: item.color,
borderColor: 'rgba(170,170,170,0)',
barThickness: 12
barThickness: 10
}
})
}
Expand Down Expand Up @@ -938,26 +948,29 @@ $(document).ready(function () {
var graphConfigs = kpis.map((str) => {
var kpi = str.toLowerCase();
var groupUnit = model[0];
var indexes = [];
if (kpi === 'throughput') {
var throughputData = Graph.getDatabyKPI(model, kpi);
var config = Graph.getGraphConfig(kpi, groupUnit, precisions);
precisions.forEach((prec, index) => {
config.datasets[index].data = throughputData.map(tData => tData[prec]);
});
return config;
return removeEmptyLabel(config, indexes);
}
else if(kpi === 'latency'){
var latencyData = Graph.getDatabyKPI(model, kpi);
var config = Graph.getGraphConfig(kpi, groupUnit, precisions);
precisions.forEach((prec, index) => {
config.datasets[index].data = latencyData.map(tData => tData[prec]);
config.datasets[index].data = latencyData.map(tData => tData[prec]);
});
return config;
return removeEmptyLabel(config, indexes);
}
var config = Graph.getGraphConfig(kpi, groupUnit);
config.datasets[0].data = Graph.getDatabyKPI(model, kpi);
return config;
});


// get the client platform labels and create labels for all the graphs
var labelsContainer = $('<div>');
labelsContainer.addClass('chart-labels-container');
Expand Down Expand Up @@ -1013,6 +1026,19 @@ $(document).ready(function () {
setChartsDisplayDirection(display.mode);
adjustHeaderIcons(display.mode);
}
function removeEmptyLabel(config, indexes) {
config.datasets.forEach((item, index) =>{
if(item.data[0] == '') {
indexes.push(index);
}
})
var sorted = indexes.sort(function(a, b){return b-a});

sorted.forEach((index)=>{
config.datasets.splice(index,1);
})
return config;
}

function processMetricNew(labels, datasets, chartTitle, container, widthClass, id) {
// ratio for consistent chart label height
Expand Down
10 changes: 8 additions & 2 deletions src/bindings/c/tests/ov_infer_request_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,14 @@ TEST_P(ov_infer_request_test, infer_async_wait_for) {
OV_ASSERT_OK(ov_infer_request_start_async(infer_request));

if (!HasFatalFailure()) {
OV_EXPECT_OK(ov_infer_request_wait_for(infer_request, 10));

ov_status_e ret = ov_status_e::OK;
EXPECT_NO_THROW(ret = ov_infer_request_wait_for(infer_request, 10));
size_t max_times = 10;
// Random timeout in some platform, increase wait() times if timeout occurr.
while (ret != ov_status_e::OK && max_times-- > 0) {
EXPECT_NO_THROW(ret = ov_infer_request_wait_for(infer_request, 10));
}
EXPECT_EQ(ret, ov_status_e::OK);
OV_EXPECT_OK(ov_infer_request_get_output_tensor_by_index(infer_request, 0, &output_tensor));
EXPECT_NE(nullptr, output_tensor);
}
Expand Down
14 changes: 14 additions & 0 deletions src/bindings/python/src/pyopenvino/graph/ops/if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ void regclass_graph_op_If(py::module m) {
:rtype: openvino.impl.op.If
)");

cls.def(
"get_then_body",
[](ov::op::v8::If& self) {
auto model = self.get_then_body();
py::type model_class = py::module_::import("openvino.runtime").attr("Model");
return model_class(py::cast(model));
},
R"(
Gets then_body as Model object.
:return: then_body as Model object.
:rtype: openvino.Model
)");

cls.def(
"get_else_body",
[](ov::op::v8::If& self) {
Expand Down
20 changes: 20 additions & 0 deletions src/bindings/python/tests/test_graph/test_if.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

import pytest
import numpy as np
import openvino.runtime.opset8 as ov
from openvino import Model
Expand Down Expand Up @@ -178,6 +179,25 @@ def test_simple_if_without_body_parameters():
check_if(simple_if_without_parameters, False, ["Relu", 1, []])


def check_if_getters(if_model, cond_val):
if_op = if_model(cond_val)
assert isinstance(if_op.get_then_body(), Model)
assert if_op.get_function(0)._get_raw_address() == if_op.get_then_body()._get_raw_address()
assert compare_models(if_op.get_function(0), if_op.get_then_body())

assert isinstance(if_op.get_else_body(), Model)
assert if_op.get_function(1)._get_raw_address() == if_op.get_else_body()._get_raw_address()
assert compare_models(if_op.get_function(1), if_op.get_else_body())


@pytest.mark.parametrize(("cond_val"), [
True,
False,
])
def test_if_getters(cond_val):
check_if_getters(create_simple_if_with_two_outputs, cond_val)


def test_simple_if_basic():
condition = ov.constant(True, dtype=bool)
# then_body
Expand Down
Loading

0 comments on commit 69c58e9

Please sign in to comment.