Skip to content

Commit

Permalink
Merge branch 'master' into ywang2/fix_issue_of_memory_cost_so_much_wi…
Browse files Browse the repository at this point in the history
…th_specify_device_candidate_list
  • Loading branch information
yangwang201911 authored Dec 30, 2024
2 parents 1ce251c + 2ef42d4 commit 0cc5c00
Show file tree
Hide file tree
Showing 89 changed files with 2,524 additions and 232 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ models from OpenVINO-supported frameworks may also work properly but have not be

**AI Models that run on Intel® Core Ultra™ Processors with OpenVINO™ toolkit:**

.. raw:: html

<link rel="stylesheet" type="text/css" href="../../_static/css/openVinoDataTables.css">


.. csv-table::
.. data-table::
:class: modeldata stripe
:name: supportedModelsTable
:header-rows: 1
:file: ../../_static/download/supported_models.csv
:data-column-hidden: []
:data-order: [[ 0, "asc" ]]
:data-page-length: 10


| Marked cells indicate models that passed inference with no errors. Empty cells indicate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,36 @@ Data as of OpenVINO 2024.4, 18 Oct. 2024.

.. tab-item:: PyTorch

.. csv-table::
.. data-table::
:class: modeldata stripe
:name: TensorFlow ops
:name: TensorFlow_ops_v1
:header-rows: 1
:file: ../../_static/conformance_files/pytorch_ops.csv
:data-column-hidden: []
:data-order: [[ 0, "asc" ]]
:data-page-length: 10

.. tab-item:: TensorFlow

.. csv-table::
.. data-table::
:class: modeldata stripe
:name: TensorFlow ops
:name: TensorFlow_ops_v2
:header-rows: 1
:file: ../../_static/conformance_files/tensorflow_ops.csv
:data-column-hidden: []
:data-order: [[ 0, "asc" ]]
:data-page-length: 10

.. tab-item:: PaddlePaddle

.. csv-table::
.. data-table::
:class: modeldata stripe
:name: Paddle ops
:name: Paddle_ops
:header-rows: 1
:file: ../../_static/conformance_files/paddlepaddle_ops.csv
:data-column-hidden: []
:data-order: [[ 0, "asc" ]]
:data-page-length: 10

.. tab-item:: ONNX

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ The current data is as of OpenVINO 2024.4, 20 Nov. 2024.
The tables below list the key performance indicators for inference on built-in GPUs.


.. raw:: html

<label><link rel="stylesheet" type="text/css" href="../../_static/css/openVinoDataTables.css"></label>


.. tab-set::

Expand All @@ -22,7 +18,9 @@ The tables below list the key performance indicators for inference on built-in G
:name: supportedModelsTable_V1
:header-rows: 1
:file: ../../_static/benchmarks_files/llm_models_9-288V.csv
:hidden: [3,4,6]
:data-column-hidden: [3,4,6]
:data-order: [[ 0, "asc" ]]
:data-page-length: 10

.. tab-item:: 7-268V

Expand All @@ -31,7 +29,8 @@ The tables below list the key performance indicators for inference on built-in G
:name: supportedModelsTable_V2
:header-rows: 1
:file: ../../_static/benchmarks_files/llm_models_7-258V.csv
:hidden: [3,4,6]
:data-column-hidden: [3,4,6]
:data-order: [[ 0, "asc" ]]

.. tab-item:: 7-155H

Expand All @@ -40,7 +39,8 @@ The tables below list the key performance indicators for inference on built-in G
:name: supportedModelsTable_V3
:header-rows: 1
:file: ../../_static/benchmarks_files/llm_models_7-155H.csv
:hidden: [3,4,6]
:data-column-hidden: [3,4,6]
:data-order: [[ 0, "asc" ]]


.. grid:: 1 1 2 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import requests
import re
import json

import html
import csv

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -147,7 +147,9 @@ class DataTable(Directive):
'file': directives.path,
'class': directives.unchanged,
'name': directives.unchanged,
'hidden': directives.unchanged
'data-column-hidden': directives.unchanged,
'data-page-length': directives.unchanged,
'data-order': directives.unchanged
}

def run(self) -> List[Node]:
Expand All @@ -159,10 +161,12 @@ def run(self) -> List[Node]:
csv_node = []
with open(csv_file, 'r') as j:
csv_data = list(csv.reader(j))
class_table_tag = ' class="' + "".join(c for c in str(self.options['class']) + '"') if 'class' in self.options is not None else ""
id_table_tag = ' id="' + "".join(c for c in str(self.options['name']) + '"') if 'name' in self.options is not None else ""
hidden_table_tag = ' data-columns-hidden="' + "".join(c for c in str(self.options['hidden']) + '"') if 'hidden' in self.options is not None else ""
csv_table_html = '<table' + class_table_tag + id_table_tag + hidden_table_tag + '>'
class_table_tag = f' class="{html.escape(self.options["class"])}"' if "class" in self.options else ""
id_table_tag = f' id="{html.escape(self.options["name"])}"' if "name" in self.options else ""
data_column_hidden_tag = f' data-column-hidden="{html.escape(self.options["data-column-hidden"])}"' if "data-column-hidden" in self.options else ""
data_order_tag = f' data-order="{html.escape(self.options["data-order"])}"' if "data-order" in self.options else ""
data_page_length_tag = f' data-page-length="{html.escape(self.options["data-page-length"])}"' if "data-page-length" in self.options else ""
csv_table_html = f'<table{class_table_tag}{id_table_tag}{data_column_hidden_tag}{data_order_tag}{data_page_length_tag}>'
head_rows = 0
head_rows += self.options.get('header-rows', 0)
row_count = 0
Expand Down
5 changes: 2 additions & 3 deletions docs/sphinx_setup/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ a#wap_dns {
/* Sphinx-design tabs override */
.sd-tab-set>input:checked+label {
color: var(--sd-color-black) !important;
background-color: #f8f8f8 !important;
background-color: white !important;
border: solid 1px #bdbdbd;
border-bottom: solid 0px;
margin-bottom: -1px;
Expand All @@ -96,7 +96,7 @@ a#wap_dns {
cursor: pointer;
font-size: var(--sd-fontsize-tabs-label);
font-weight: 400 !important;
padding: 5px 16px 2px !important;
padding: 5px 16px 0px !important;
transition: color 250ms;
width: auto;
z-index: 1;
Expand All @@ -110,7 +110,6 @@ a#wap_dns {
box-shadow: 0 0 0 0;
border: solid 1px var(--sd-color-tabs-overline);
border-color: #bdbdbd;
background-color: #f8f8f8;
padding-right: 4px;
padding-left: 4px;
padding-bottom: 6px;
Expand Down
6 changes: 2 additions & 4 deletions docs/sphinx_setup/_static/css/openVinoDataTables.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ div.dt-buttons>.dt-button, div.dt-buttons>div.dt-button-split .dt-button {
}

div.dt-container .dt-paging .dt-paging-button:hover {
color: white !important;
border: 1px solid #aaa;
border: 1px solid #aaa !important;
background:none !important;
background-color: var(--bttn-act-bg-hover) !important
}
Expand Down Expand Up @@ -190,10 +189,9 @@ div.dt-container .dt-paging .dt-paging-button {

div.dt-container .dt-paging .dt-paging-button.current, div.dt-container .dt-paging .dt-paging-button.current:hover {
background: none !important;
background-color: var(--bttn-act-bg-active) !important;
background-color: var(--bttn-sec-border-color) !important;
border-color: var(--bttn-act-bg-active) !important;
border-radius: 0px !important;
color: white !important;
border: 1px !important
}
table.dataTable thead>tr>th.dt-orderable-asc span.dt-column-order:before, table.dataTable thead>tr>th.dt-orderable-asc span.dt-column-order:after, table.dataTable thead>tr>th.dt-orderable-desc span.dt-column-order:before, table.dataTable thead>tr>th.dt-orderable-desc span.dt-column-order:after, table.dataTable thead>tr>th.dt-ordering-asc span.dt-column-order:before, table.dataTable thead>tr>th.dt-ordering-asc span.dt-column-order:after, table.dataTable thead>tr>th.dt-ordering-desc span.dt-column-order:before, table.dataTable thead>tr>th.dt-ordering-desc span.dt-column-order:after, table.dataTable thead>tr>td.dt-orderable-asc span.dt-column-order:before, table.dataTable thead>tr>td.dt-orderable-asc span.dt-column-order:after, table.dataTable thead>tr>td.dt-orderable-desc span.dt-column-order:before, table.dataTable thead>tr>td.dt-orderable-desc span.dt-column-order:after, table.dataTable thead>tr>td.dt-ordering-asc span.dt-column-order:before, table.dataTable thead>tr>td.dt-ordering-asc span.dt-column-order:after, table.dataTable thead>tr>td.dt-ordering-desc span.dt-column-order:before, table.dataTable thead>tr>td.dt-ordering-desc span.dt-column-order:after {
Expand Down
5 changes: 2 additions & 3 deletions docs/sphinx_setup/_static/js/openVinoDataTables.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
$(document).ready(function () {
var columnDefs = [];

var tables = $('table.modeldata');
for (let table of tables) {
var hidden = table.getAttribute('data-columns-hidden');
var hidden = table.getAttribute('data-column-hidden');
columnDefs = [{ "visible": false, "targets": JSON.parse(hidden) }]
$(table).DataTable({
responsive: true,
"autoWidth": false,
language: {
buttons: {
colvisRestore: "Restore default"
colvisRestore: "Restore default selection"
}
},
lengthMenu: [
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx_setup/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" href="{{ pathto('_static/css/viewer.min.css', 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/css/custom.css', 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/css/banner.css', 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/css/openVinoDataTables.css', 1) }}" type="text/css" />
<link href="https://cdn.datatables.net/v/dt/jq-3.7.0/dt-2.0.8/b-3.0.2/b-colvis-3.0.2/b-print-3.0.2/datatables.min.css" rel="stylesheet">
<link rel="stylesheet" href="{{ pathto('_static/css/coveo_custom.css', 1) }}" type="text/css" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.umd.min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (C) 2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#pragma once

#include "openvino/pass/matcher_pass.hpp"
#include "transformations_visibility.hpp"

namespace ov {
namespace pass {

class TRANSFORMATIONS_API FakeConvertDecomposition;

} // namespace pass
} // namespace ov

/**
* @ingroup ov_transformation_common_api
* @brief FakeConvertDecomposition transformation decomposes FakeConvert layer.
* f8: f8e4m3, f8e5m2
* downconvert: f32->f8, f16->f8, bf16->f8
* upconvert: f8->f32, f8->f16, f8->bf16
* output = (upconvert(downconvert(input * scale - shift)) + shift) / scale
*
*/

class ov::pass::FakeConvertDecomposition : public ov::pass::MatcherPass {
public:
OPENVINO_MATCHER_PASS_RTTI("FakeConvertDecomposition");
FakeConvertDecomposition();
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Copyright (C) 2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include "transformations/op_conversions/fake_convert_decomposition.hpp"

#include "itt.hpp"
#include "openvino/core/rt_info.hpp"
#include "openvino/op/add.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/convert.hpp"
#include "openvino/op/divide.hpp"
#include "openvino/op/fake_convert.hpp"
#include "openvino/op/multiply.hpp"
#include "openvino/op/subtract.hpp"
#include "openvino/pass/pattern/op/wrap_type.hpp"

ov::pass::FakeConvertDecomposition::FakeConvertDecomposition() {
MATCHER_SCOPE(FakeConvertDecomposition);
auto data = pattern::any_input();

auto fake_convert = ov::pass::pattern::wrap_type<ov::op::v13::FakeConvert>();

matcher_pass_callback callback = [OV_CAPTURE_CPY_AND_THIS](ov::pass::pattern::Matcher& m) {
auto& pattern_to_output = m.get_pattern_value_map();
const auto fake_convert_node =
ov::as_type_ptr<ov::op::v13::FakeConvert>(pattern_to_output.at(fake_convert).get_node_shared_ptr());

if (fake_convert_node == nullptr || transformation_callback(fake_convert_node)) {
return false;
}

Output<Node> data{fake_convert_node->input_value(0)};
const Output<Node> input_scale{fake_convert_node->input_value(1)};
auto input_type = data.get_element_type();

ov::pass::NodeRegistry decomp_ops;
if (input_type != input_scale.get_element_type()) {
input_type = input_scale.get_element_type();
data = std::make_shared<ov::op::v0::Convert>(data, input_type);
data = decomp_ops.add(data.get_node_shared_ptr());
}

std::shared_ptr<Node> result;
const auto scale = decomp_ops.make<ov::op::v1::Multiply>(data, input_scale);
if (fake_convert_node->get_input_size() == 2) {
const auto downconvert =
decomp_ops.make<ov::op::v0::Convert>(scale, fake_convert_node->get_destination_element_type());
const auto upconvert = decomp_ops.make<ov::op::v0::Convert>(downconvert, input_type);

result = decomp_ops.make<ov::op::v1::Divide>(upconvert, input_scale);
} else {
const Output<Node> input_shift{fake_convert_node->input_value(2)};
const auto shift = decomp_ops.make<ov::op::v1::Subtract>(scale, input_shift);

const auto downconvert =
decomp_ops.make<ov::op::v0::Convert>(shift, fake_convert_node->get_destination_element_type());
const auto upconvert = decomp_ops.make<ov::op::v0::Convert>(downconvert, input_type);

const auto deshift = decomp_ops.make<ov::op::v1::Add>(upconvert, input_shift);
result = decomp_ops.make<ov::op::v1::Divide>(deshift, input_scale);
}

if (result->get_output_element_type(0) != fake_convert_node->get_output_element_type(0)) {
result = decomp_ops.make<ov::op::v0::Convert>(result, fake_convert_node->get_output_element_type(0));
}

result->set_friendly_name(m.get_match_root()->get_friendly_name());
ov::copy_runtime_info(fake_convert_node, decomp_ops.get());
ov::replace_node(m.get_match_root(), result);
return true;
};

auto m = std::make_shared<ov::pass::pattern::Matcher>(fake_convert, matcher_name);
register_matcher(m, callback);
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,19 @@ ov::pass::PositionIDsReplacerQwen::PositionIDsReplacerQwen(const Output<Node>& p
auto p_opt_convert = optional<v0::Convert>(p_max_context_len);
auto p_opt_reshape = optional<v1::Reshape>({p_opt_convert, any_input()});

// current seg len
auto p_input_ids = wrap_type<v0::Parameter>();
auto p_unsqueeze = wrap_type<v0::Unsqueeze>({p_input_ids, _const()});
auto p_shape_of = wrap_type<v3::ShapeOf>({p_unsqueeze});
// current seq len:
// it might be present in 2 different ways:
// input_ids -> unsqueeze -> reshape -> convert -> shape_of -> gather
// QKV -> variadic_split(Q or K) -> rope Q/K -> shape_of -> gather
// Probably we can use the symbols to re-use one of these ways.
// Currently, "any_input" is used to detect the both places.
auto p_shape_of = wrap_type<v3::ShapeOf>({any_input()});
auto p_current_len = wrap_type<v8::Gather>({p_shape_of, _const(), _const()});

auto p_rotary_emb_sincos = wrap_type<v0::Constant>();
auto p_neg_const = wrap_type<v0::Constant>();
auto p_neg_mul = wrap_type<v1::Multiply>({p_current_len, p_neg_const});
// the rotary_emb_cos/rotary_emb_sin are sliced by the total length [1,..4096,1,128]
auto p_rotary_emb_sincos = wrap_type<v0::Constant>();
auto p_slice_1 = wrap_type<v8::Slice>({p_rotary_emb_sincos, _const(), p_opt_reshape, _const(), _const()});
auto p_slice_2 = wrap_type<v8::Slice>({p_slice_1, p_neg_mul, _const(), _const(), _const()});

Expand Down
Loading

0 comments on commit 0cc5c00

Please sign in to comment.