OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
Docs change csv to json file in benchmark graphs (#26494)
Andrzej Kopytko7557de47d14b
diff --git a/docs/sphinx_setup/_static/benchmarks_files/graph-config.json b/docs/sphinx_setup/_static/benchmarks_files/graph-config.jsonnew file mode 100644index 00000000000..8c71e304f7b--- /dev/null+++ b/docs/sphinx_setup/_static/benchmarks_files/graph-config.json@@ -0,0 +1,96 @@++{+ "PrecisionsMap": {+ "OV-INT8 (reference)": "ovmsint8",+ "OV-FP32 (reference)": "ovmsfp32",+ "INT4": "int4",+ "INT8": "int8",+ "FP16": "fp16",+ "FP32": "fp32",+ "BF16": "bf16"+ },+ "ParametersMap": {+ "Throughput": "throughput",+ "Latency": "latency"+ },+ "UnitDescription": {+ "msec.": "(lower is better)",+ "ms": "(lower is better)",+ "msec/token": "(lower is better)",+ "Generating time, sec.": "(lower is better)",+ "msec/token/TDP": "(lower is better)",+ "FPS": "(higher is better)",+ "FPS/$": "(higher is better)",+ "FPS/TDP": "(higher is better)",+ "No unit.": "Data not complete!"+ },+ "PrecisionData": {+ "int4": {+ "data": null,+ "color": "#5bd0f0",+ "label": "int4"+ },+ "int8": {+ "data": null,+ "color": "#00C7FD",+ "label": "int8"+ },+ "fp16": {+ "data": null,+ "color": "#009fca",+ "label": "fp16"+ },+ "fp32": {+ "data": null,+ "color": "#007797",+ "label": "fp32"+ },+ "bf16": {+ "data": null,+ "color": "#00536a",+ "label": "bf16"+ }+ },+ "Filters": [+ "PlatformType"+ ],+ "DefaultSelections": {+ "platformTypes": {+ "name": "ietype",+ "data": [+ "Client Platforms (Intel® Core™)"+ ]+ },+ "platforms": {+ "name": "platform",+ "data": [+ ]+ },+ "platformFilters": {+ "name": "coretype",+ "data": [+ "CPU"+ ]+ },+ "models": {+ "name": "networkmodel",+ "data": [+ "bert-base-cased"+ ]+ },+ "parameters": {+ "name": "parameters",+ "data": [+ "Throughput",+ "Latency"+ ]+ },+ "precision": {+ "name": "precision",+ "data": [+ "INT4",+ "INT8"+ ]+ }+ }+}\ No newline at end of filediff --git a/docs/sphinx_setup/_static/css/custom.css b/docs/sphinx_setup/_static/css/custom.cssindex 9f3d519ecd6..f13dc0706f5 100644--- a/docs/sphinx_setup/_static/css/custom.css+++ b/docs/sphinx_setup/_static/css/custom.css@@ -1,7 +1,7 @@/* Misc *//* =================================================== */.switcher-set {- margin-bottom:1rem;+ margin-bottom: 1rem;}main img {@@ -12,7 +12,7 @@ main img {margin-bottom: 0;}-main .searchForm {+main .searchForm {margin-bottom: 2rem;margin-top: 2rem;}@@ -22,7 +22,9 @@ pre {word-wrap: break-word;/*background-color: white;color: red !important; */-} /*confirm this is not necessary, if so, remove */+}++/*confirm this is not necessary, if so, remove */button.copybtn {opacity: 100;@@ -31,7 +33,9 @@ button.copybtn {}/* cookie wap requirement */-a#wap_dns {display: none;}+a#wap_dns {+ display: none;+}/* Sphinx replace a default github icon*/.fa-square-github {@@ -46,35 +50,35 @@ a#wap_dns {display: none;}/* Sphinx-design tabs override */.sd-tab-set>input:checked+label {- color: var(--sd-color-black)!important;- background-color: #f8f8f8!important;+ color: var(--sd-color-black) !important;+ background-color: #f8f8f8 !important;border: solid 1px #bdbdbd;border-bottom: solid 0px;margin-bottom: -1px;- border-color: #bdbdbd!important;+ border-color: #bdbdbd !important;}.sd-tab-set>input:checked+label:hover {color: --sd-color-info-text;- background-color: #f8f8f8!important;+ background-color: #f8f8f8 !important;}.sd-tab-set>input:not(:checked)+label:hover {- color: var(--sd-color-black)!important;- background-color: #cccccc!important;- border-color: var(--sd-color-card-header)!important;+ color: var(--sd-color-black) !important;+ background-color: #cccccc !important;+ border-color: var(--sd-color-card-header) !important;}.sd-tab-set>label {border-bottom: 0.125rem solid transparent;- margin-right: 10px!important;+ margin-right: 10px !important;margin-bottom: 0;- color: var(--sd-color-black)!important;+ color: var(--sd-color-black) !important;border-color: var(--sd-color-tabs-underline-inactive);cursor: pointer;font-size: var(--sd-fontsize-tabs-label);- font-weight: 400!important;- padding: 5px 16px 2px!important;+ font-weight: 400 !important;+ padding: 5px 16px 2px !important;transition: color 250ms;width: auto;z-index: 1;@@ -123,7 +127,7 @@ a#wap_dns {display: none;}/* Underline width */a:hover,.toc-entry a.nav-link:hover,-nav.bd-links li > a:hover {+nav.bd-links li>a:hover {text-decoration-thickness: 1px;}@@ -132,7 +136,7 @@ nav.bd-links li > a:hover {color: white;}-ul#navbar-main-elements > li:hover {+ul#navbar-main-elements>li:hover {text-decoration: underline;color: #fff;}@@ -144,11 +148,11 @@ nav.bd-links .current>a {}a.current {- background-color: #daf2ff!important;+ background-color: #daf2ff !important;}.bd-sidebar-primary label.toctree-toggle:hover {- background: #daf2ff!important;+ background: #daf2ff !important;}.bd-header .navbar-nav li a.nav-link {@@ -158,24 +162,26 @@ a.current {padding-right: 0;padding: 0 0.8rem;}+ul.bd-breadcrumbs li.breadcrumb-item:not(.breadcrumb-home):before {padding: .2rem .5rem 0 !important;}+li.breadcrumb-item {align-items: center !important;}.bd-sidebar-primary {- display:block !important;+ display: block !important;}a.nav-link:hover {- text-decoration:none !important;+ text-decoration: none !important;}/* Github icon size */.nav-link[data-bs-original-title="GitHub"] {- font-size: 2rem!important;+ font-size: 2rem !important;}.svg-inline--fa .fa-outdent {@@ -231,7 +237,7 @@ nav.bd-links li>a {details.sd-dropdown .sd-summary-up,details.sd-dropdown .sd-summary-down {left: 10px;- top: 10px!important;+ top: 10px !important;}@@ -257,7 +263,7 @@ details.sd-dropdown .sd-summary-title {}/* Second level items */-#bd-docs-nav > div > ul > li > ul {+#bd-docs-nav>div>ul>li>ul {padding-left: 0.3rem;}@@ -273,17 +279,17 @@ details.sd-dropdown .sd-summary-title {/* Doc version dropdown formatting override *//* =================================================== */-[aria-labelledby="version-selector"] {- min-width: 125px!important;- overflow-x: hidden!important;+[aria-labelledby="version-selector"] {+ min-width: 125px !important;+ overflow-x: hidden !important;}.sst-dropdown #version-selector {- min-width: 125px!important;+ min-width: 125px !important;}-[aria-labelledby="version-selector"] .dropdown-item {- padding: 0.25rem 0.5rem!important;+[aria-labelledby="version-selector"] .dropdown-item {+ padding: 0.25rem 0.5rem !important;}@@ -295,7 +301,7 @@ details.sd-dropdown .sd-summary-title {.column-two-col-content {flex: 50%;- padding-right: 10px!important;+ padding-right: 10px !important;}/* Code reference text formatting override */@@ -306,31 +312,35 @@ code {}.sd-btn {- border-radius:0px !important;+ border-radius: 0px !important;color: #0054AE !important;border-color: lightgray !important;}.sd-btn:hover {- border-radius:0px !important;+ border-radius: 0px !important;background-color: #0054AE !important;}-.admonition.tip, div.admonition.tip {+.admonition.tip,+div.admonition.tip {border-color: var(--pst-color-success) !important;background-color: #effdf6 !important;}-.admonition.important, div.admonition.important {+.admonition.important,+div.admonition.important {border-color: var(--pst-color-attention);background-color: #fbf5f0 !important;}-.admonition.warning, div.admonition.warning {+.admonition.warning,+div.admonition.warning {background-color: #fbf5f0 !important;}-.admonition.note, div.admonition.note {+.admonition.note,+div.admonition.note {background-color: #f1fafe;}@@ -346,15 +356,15 @@ details.sd-dropdown summary.sd-card-header+div.sd-summary-content {.sort-btn {content: "";- background-image:url('media/arrow-small-opposite-v.svg');+ background-image: url('media/arrow-small-opposite-v.svg');background-size: 100% 100%;background-position: center;background-repeat: no-repeat;display: inline-block;height: 1.5rem;- width:1.5rem;- position:relative;- top:0.5rem;+ width: 1.5rem;+ position: relative;+ top: 0.5rem;}.sort-btn.sort-active.ascending,@@ -375,15 +385,15 @@ div.highlight {}.highlight .err {- border:none;- color:inherit;+ border: none;+ color: inherit;}.opt-notice-wrapper {position: fixed;- bottom:0;+ bottom: 0;background: black;- width:100%;+ width: 100%;text-align: center;padding: 1rem;z-index: 1000;@@ -395,7 +405,7 @@ div.highlight {top: 50%;transform: translateY(-50%);text-align: center;- width:100%;+ width: 100%;color: #fff;}@@ -410,7 +420,7 @@ div.highlight {color: white;z-index: 1001;display: block;- padding:0 2rem;+ padding: 0 2rem;font-size: var(--pst-sidebar-font-size);border: none;border-radius: 0;@@ -420,14 +430,14 @@ div.highlight {margin-left: auto;}-.transition-banner > p {+.transition-banner>p {margin-bottom: 0;}.transition-banner .close-banner {- position:absolute;- top:0;- right:0;+ position: absolute;+ top: 0;+ right: 0;padding: 0 1.25rem;color: #000;background-color: transparent;@@ -441,8 +451,9 @@ div.highlight {}.hidden-banner {- display: none!important;+ display: none !important;}+/* Header */.bd-header label.primary-toggle {@@ -471,6 +482,7 @@ div.highlight {}@media (min-width: 1200px) {+.container,.container-lg,.container-md,@@ -478,14 +490,13 @@ div.highlight {.container-xl {max-width: 100%;}+.bd-main .bd-content .bd-article-container .bd-article {padding-left: 1rem !important;}}-/* Performance Benchmark Graphs */-/* =================================================== */.configure-graphs-header {padding-left: 16px;display: flex;@@ -496,10 +507,6 @@ div.highlight {float: left;}-.configure-graphs-content {- overflow: auto;-}-.header-inactive {color: lightgray;}@@ -534,12 +541,12 @@ div.highlight {}.empty-chart-container {- height: 80px;- line-height: 80px;- width: 100%;- text-align: center;- background-color: #f3f3f3;- border-radius: 5px;+ height: 80px;+ line-height: 80px;+ width: 100%;+ text-align: center;+ background-color: #f3f3f3;+ border-radius: 5px;}.graph-chart-title {@@ -619,7 +626,7 @@ div.highlight {.chart {height: 500px;- padding:0;+ padding: 0;}.chart-placeholder {@@ -627,10 +634,10 @@ div.highlight {}.build-benchmark-section {- background-color: #f9f9f9;- padding: 10px 30px 80px 30px;- display: flex;- flex-wrap: wrap;+ background-color: #f9f9f9;+ padding: 10px 30px 80px 30px;+ display: flex;+ flex-wrap: wrap;}.build-benchmark-section .title {@@ -652,21 +659,21 @@ div.highlight {}.platform-configurations {- font-size: larger;- display: flex;- flex-wrap: wrap;+ font-size: larger;+ display: flex;+ flex-wrap: wrap;}.platform-configurations div {- margin-bottom: 30px;+ margin-bottom: 30px;}.platform-configurations a {- padding-right: 24px;+ padding-right: 24px;}.platform-configurations a img {- padding-right: 24px;+ padding-right: 24px;}.efficiency-icon {@@ -699,8 +706,31 @@ div.highlight {background-color: rgba(0, 0, 0, 0.4);}-.modal-content {+/* The Modal (filters modal) */+.modal-filter {+ display: none;+ position: fixed;+ z-index: 2;+ left: 0;+ top: 0;+ width: 100%;+ height: 100%;overflow: auto;+ background-color: rgb(0, 0, 0);+ background-color: rgba(0, 0, 0, 0.4);+}++/* Modal Content/Box */+.modal-filters-content {+ background-color: #fefefe;+ margin: 5% auto;+ padding: 36px;+ border: 1px solid #888;+ width: 50%;+ border-radius: var(--bs-modal-border-radius)+}++.modal-content {background-color: #fefefe;margin: 3% auto;padding: 36px;@@ -708,6 +738,7 @@ div.highlight {width: 95%;max-width: 1140px;max-height: 85%;+ border-radius: var(--bs-modal-border-radius)}.modal-content h2 {@@ -747,13 +778,16 @@ div.highlight {}.modal-content-grid {+ max-height: 400px;+ ;display: grid;padding-top: .5rem;grid-template-columns: 1fr;+ overflow: auto;}.modal-content-grid-container .column {- min-width: 100px;+ min-width: 100px;}.modal-content-grid-container label {@@ -770,8 +804,17 @@ div.highlight {}.modal-content-grid-item h5 {+ display: inline-block;+ font-weight: 530;+ margin: 0;+ margin-left: 22px;+}++.modal-filters-content h5 {+ display: inline-block;font-weight: 530;margin: 0;+ margin-left: 22px;}.modal-footer {@@ -848,10 +891,6 @@ div.highlight {gap: .5rem;}- .clear-all-btn {- padding: 0;- }-.modal-content-grid-container {grid-template-columns: 1fr;grid-template-rows: auto;@@ -867,14 +906,21 @@ div.highlight {grid-template-columns: 1fr 1fr;column-gap: 1rem;}-- .span-element-big {- grid-column: 1 / span 2;-}}+.show-allcheckbox {+ cursor: pointer;+ float: left;+}+.close:hover,+.close:focus {+ color: black;+ text-decoration: none;+ cursor: pointer;+}/* Modal buttons */+.modal-close {color: #aaaaaa;float: right;@@ -898,9 +944,11 @@ div.highlight {}.build-graphs-btn {+ border: 1.5px solid black;border-color: #0054AE;background-color: #0054AE;color: #fff;+ padding: 4px 10px;}.build-graphs-btn:disabled {@@ -910,10 +958,14 @@ div.highlight {.clear-all-btn {cursor: pointer;+ padding: 0;+ /* Disabled Clear All button. It is temporary solution */+ display: none;}.clear-all-btn-content {border: 1.5px solid black;+ display: none;padding: 6px 10px;}@@ -933,18 +985,43 @@ div.highlight {content: url('media/edit-settings.svg');}+.arrow-back-icon {+ content: url('media/arrow-back.svg');+}++.filters-label {+ position: absolute;+ font-weight: 400;+ font-size: small;+ /* top: -2px; */+ right: 0px;+ width: 90px;+}++.show-filter {+ cursor: pointer;+ position: relative;+ float: right;+}++.show-filters-icon {+ content: url('media/show-filters.svg');+}+.close-btn {- padding: 4px 16px;- border-color: #0054AE;- background-color: #0054AE;+ padding: 12px 24px;+ cursor: pointer;color: #fefefe;float: right;align-self: flex-start;}+.close-filters{+ cursor: pointer;+ float: right;+}/* Content formatting for the benchmark pages */-/* =================================================== */.picker-options {margin: 15px 0;}@@ -1008,141 +1085,141 @@ div.highlight {.selectable-box.selected {color: #fff;background-color: #0054AE;- border-color:#0068B5;+ border-color: #0068B5;}.checkmark-container {- display: block;- position: relative;- padding-left: 20px;- margin-bottom: 12px;- cursor: pointer;- -webkit-user-select: none;- -moz-user-select: none;- -ms-user-select: none;- user-select: none;+ display: block;+ position: relative;+ padding-left: 20px;+ margin-bottom: 12px;+ cursor: pointer;+ -webkit-user-select: none;+ -moz-user-select: none;+ -ms-user-select: none;+ user-select: none;}/* Hide the browser's default checkbox */.checkmark-container input {- position: absolute;- opacity: 0;- cursor: pointer;- height: 0;- width: 0;+ position: absolute;+ opacity: 0;+ cursor: pointer;+ height: 0;+ width: 0;}/* Create a custom checkbox */.checkmark {- position: absolute;- top: 5px;- left: 0;- height: 15px;- width: 15px;- border: #0054AE 2px solid;+ position: absolute;+ top: 5px;+ left: 0;+ height: 15px;+ width: 15px;+ border: #0054AE 2px solid;}.checkmark.radiobutton {- border-radius: 50%;+ border-radius: 50%;}/* On mouse-over, add a grey background color */-.checkmark-container:hover input ~ .checkmark {- background-color: #ccc;+.checkmark-container:hover input~.checkmark {+ background-color: #ccc;}/* When the checkbox is checked, add a blue background */-.checkmark-container input:checked ~ .checkmark {- background-color: #0054AE;+.checkmark-container input:checked~.checkmark {+ background-color: #0054AE;}-.checkmark-container input:disabled ~ .checkmark {+.checkmark-container input:disabled~.checkmark {background: #d3d3d3;border: 2px solid #8C8C8C;}/* Create the checkmark/indicator (hidden when not checked) */.checkmark:after {- content: "";- position: absolute;- display: none;+ content: "";+ position: absolute;+ display: none;}/* Show the checkmark when checked */-.checkmark-container input:checked ~ .checkmark:after {- display: block;+.checkmark-container input:checked~.checkmark:after {+ display: block;}/* Style the checkmark/indicator */.checkmark-container .checkmark:after {- left: 3px;- top: 0;- width: 5px;- height: 9px;- border: solid white;- border-width: 0 2px 2px 0;- -webkit-transform: rotate(45deg);- -ms-transform: rotate(45deg);- transform: rotate(45deg);+ left: 3px;+ top: 0;+ width: 5px;+ height: 9px;+ border: solid white;+ border-width: 0 2px 2px 0;+ -webkit-transform: rotate(45deg);+ -ms-transform: rotate(45deg);+ transform: rotate(45deg);}.checkmark-container .checkmark.radiobutton:after {- border-radius: 50%;- top: 3px;- left: 3px;- width: 5px;- height: 5px;- background: white;- -webkit-transform: none;- -ms-transform: none;- transform: none;+ border-radius: 50%;+ top: 3px;+ left: 3px;+ width: 5px;+ height: 5px;+ background: white;+ -webkit-transform: none;+ -ms-transform: none;+ transform: none;}#performance-information-frequently-asked-questions section h2 {- cursor: pointer;- color: #0054AE;- font-size: larger;- margin-top: 12px;+ cursor: pointer;+ color: #0054AE;+ font-size: larger;+ margin-top: 12px;}#performance-information-frequently-asked-questions table tr:nth-child(even),table#model-accuracy-and-perf-int8-fp32-table tr:nth-child(even),table#model-accuracy-and-perf-int8-fp32-table .light-header {- background-color: #f9f9f9;+ background-color: #f9f9f9;}table#model-accuracy-and-perf-int8-fp32-table tr.header {- background-color: #e9eaeb;+ background-color: #e9eaeb;}table#model-accuracy-and-perf-int8-fp32-table td.data {- border-left: #e9eaeb solid 1px;+ border-left: #e9eaeb solid 1px;}#performance-information-frequently-asked-questions table {- overflow: auto;+ overflow: auto;}#performance-information-frequently-asked-questions table thead {- background-color: #e9eaeb;+ background-color: #e9eaeb;}#performance-information-frequently-asked-questions section h2::before {- content: url('media/chevron-right.svg');- vertical-align: -10px;- margin-left: -32px;+ content: url('media/chevron-right.svg');+ vertical-align: -10px;+ margin-left: -32px;}#performance-information-frequently-asked-questions section h2.expanded::before {- content: url('media/chevron-down.svg');- vertical-align: -10px;+ content: url('media/chevron-down.svg');+ vertical-align: -10px;}#performance-information-frequently-asked-questions section p,#performance-information-frequently-asked-questions section table {- display: none;- padding-left: 30px;+ display: none;+ padding-left: 30px;}@@ -1312,6 +1389,7 @@ table#model-accuracy-and-perf-int8-fp32-table td.data {opacity: 0;transform: translateY(20px);}+to {opacity: 1;transform: translateY(0);@@ -1322,6 +1400,7 @@ table#model-accuracy-and-perf-int8-fp32-table td.data {from {opacity: 0;}+to {opacity: 1;}@@ -1334,8 +1413,8 @@ input:-webkit-autofill {/* Scrollbox Extension *//* =================================================== */.scrollbox {- overflow-y:scroll;- height:300px;+ overflow-y: scroll;+ height: 300px;margin-bottom: 20px;}diff --git a/docs/sphinx_setup/_static/css/media/arrow-back.svg b/docs/sphinx_setup/_static/css/media/arrow-back.svgnew file mode 100644index 00000000000..70056f1cde4--- /dev/null+++ b/docs/sphinx_setup/_static/css/media/arrow-back.svg@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:57b21c7a79d58098d933dada0343b64d8d5e13d9d08c215f23ed361d1daee718+size 1128diff --git a/docs/sphinx_setup/_static/css/media/show-filters.svg b/docs/sphinx_setup/_static/css/media/show-filters.svgnew file mode 100644index 00000000000..a8213d4a52a--- /dev/null+++ b/docs/sphinx_setup/_static/css/media/show-filters.svg@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:d39fc6aa0c259ac20add01cef4038563ac49443c0be12ba50894d86b42ba71d8+size 678diff --git a/docs/sphinx_setup/_static/html/modal.html b/docs/sphinx_setup/_static/html/modal.htmlindex 581a27f71af..ac425599b82 100644--- a/docs/sphinx_setup/_static/html/modal.html+++ b/docs/sphinx_setup/_static/html/modal.html@@ -9,7 +9,7 @@<h3>Configure Graphs</h3><div class="buttons-nav"><div>- <button id="build-graphs-btn" disabled="disabled" class="build-graphs-btn">Build Graphs</button>+ <button id="build-graphs-btn" disabled="disabled" class="build-graphs-btn">Show Graphs</button></div><div class="clear-all-btn"><span class="clear-all-btn-content">Clear All</span>@@ -18,26 +18,30 @@</div><div class="configure-graphs-content"><div class="modal-content-grid-container">- <div class="modal-content-grid-item span-element-big">- <h5>Models</h5>- <div class="modal-line-divider"></div>- <div class="modal-content-grid modal-content-grid--cols-2">- <div class="models-column-one column"></div>- <div class="models-column-two column"></div>- </div>- </div><div class="modal-content-grid-item">- <h5>Platform Type</h5>+ <div title="Select\deselect all network model list" class="show-allcheckbox">+ <span class="models-selectall">+ </span>+ </div>+ <h5>Models</h5><div class="modal-line-divider"></div><div class="modal-content-grid">- <div class="ietype-column column"></div>+ <div class="models-column column"></div></div></div><div class="modal-content-grid-item">+ <div title="Select\deselect all platform list" class="show-allcheckbox">+ <span class="platforms-selectall">+ </span>+ </div><h5>Platforms</h5>+ <div id="filters" title="Filter the platform list" class="show-filter">+ <span class="filters-label">Show filters</span>+ <span class="show-filters-icon"></span>+ </div><div class="modal-line-divider"></div><div class="modal-content-grid">- <div class="client-platform-column column"></div>+ <div class="platforms-column column"></div></div></div><div class="modal-content-grid-item">@@ -46,13 +50,30 @@<div class="modal-content-grid"><div class="kpi-column column"></div></div>- </div>- <div class="modal-content-grid-item"><h5>Precision</h5><div class="modal-line-divider"></div><div class="modal-content-grid"><div class="precisions-column column"></div>- <p>(Use for Throughput and Latency parameters only)</p>+ </div>+ </div>+ </div>+ </div>+ <div class="configure-graphs-content">+ <div class="modal-content-grid-container">+ <div id="modal-filters" class="modal-filter">+ <div class="modal-filters-content">+ <div class="modal-header">+ <h2>Show\hide platform types</h2>+ <span class="close-filters"><span class="arrow-back-icon"></span></span>+ </div>+ <div class="show-allcheckbox">+ <span class="ietype-selectall"></span>+ </div>+ <h5>Platform Types</h5>+ <div class="modal-line-divider"></div>+ <div class="modal-content-grid">+ <div class="ietype-column column"></div>+ </div></div></div></div>@@ -71,4 +92,4 @@</section><div class="modal-footer"></div>-</div>+</div>\ No newline at end of filediff --git a/docs/sphinx_setup/_static/js/graphs.js b/docs/sphinx_setup/_static/js/graphs.jsindex ff54d6e6428..e745eca17c2 100644--- a/docs/sphinx_setup/_static/js/graphs.js+++ b/docs/sphinx_setup/_static/js/graphs.js@@ -1,316 +1,124 @@// =================== GENERAL OUTPUT CONFIG =========================-const chartDisclaimers = {- Value: 'Value: Performance/(No_of_sockets * Price_of_CPU_dGPU), where prices are in USD as of November 2023.',- Efficiency: 'Efficiency: Performance/(No_of_sockets * TDP_of_CPU_dGPU), where total power dissipation (TDP) is in Watt as of November 2023.'-}--const OVdefaultSelections = {- platformTypes: {name: 'ietype', data: ['core']},- platforms: {name: 'platform',- data: [- 'Intel® Core™ i5-10500TE ',- 'Intel® Core™ i7-1185G7 CPU',- 'Intel® Core™ i9-10900TE ',- ]- },- platformFilters: {name: 'coretype', data: ['CPU']},- models: {name: 'networkmodel',- data: [- 'bert-base-cased',- 'yolo_v3_tiny',- 'yolo_v8n',- 'resnet-50',- ]- },- parameters: {name: 'kpi', data: ['Throughput','Latency']},- pracision: {name: 'precision', data: ['INT8', 'FP32']}-}--const OVMSdefaultSelections = {- platforms: {name: 'platform',- data: [- 'Intel® Xeon® 8260M CPU-only',- 'Intel® Xeon® Gold 6238M CPU-only'- ]- },- models: {name: 'networkmodel',- data: [- 'bert-small-uncased-whole-word-masking-squad-0002',- 'mobilenet-ssd ',- 'resnet-50',- 'yolo_v3_tiny'- ]- },- parameters: {name: 'kpi', data: ['Throughput']},- pracision: {name: 'precision', data: ['OV-INT8 (reference)', 'INT8']}-}--// ====================================================--class Filter {// param: GraphData[], networkModels[]static FilterByNetworkModel(graphDataArr, networkModels) {- // This is a bit obtuse, collect all options from all models- // Some of them might return dupes, so convert them to a map, and get unique objects based on namesconst optionMap = new Map();- networkModels.map((model) => graphDataArr.filter((graphData => graphData.networkModel === model)))- .flat(1)- .forEach(item => optionMap.set(item.platformName, item));- // convert the option map back to an array with just the values+ networkModels.map((model) => graphDataArr.filter((graphData => graphData.Model === model)))+ .flat(1)+ .forEach(item => optionMap.set(item.Platform, item));return Array.from(optionMap.values());}// param: GraphData[], ieType- static FilterByIeType(graphDataArr, value) {- return graphDataArr.filter((data) => data.ieType && data.ieType.includes(value));- }-- // param: GraphData[], clientPlatforms[]- static FilterByClientPlatforms(graphDataArr, platformsArr) {- return graphDataArr.filter((data) => platformsArr.includes(data.platformName));+ static ByIeTypes(graphDataArr, ieTypes) {+ const optionMap = new Map();+ graphDataArr+ .filter(graphData => ieTypes.includes(graphData.PlatformType))+ .forEach(item => optionMap.set(item.Platform, item));+ return Array.from(optionMap.values());}- // param: GraphData[], coreTypes[]- static FilterByCoreTypes(graphDataArr, coreTypes) {- if (coreTypes) {- return graphDataArr.filter((data) => coreTypes.includes(data.ieType));- }- return graphDataArr;+ // param: GraphData[], ieType, networkModels+ static ByTypesAndModels(graphDataArr, ieTypes, models) {+ const optionMap = new Map();+ graphDataArr+ .filter(graphData => ieTypes.includes(graphData.PlatformType))+ .filter(graphData => models.includes(graphData.Model))+ .forEach(item => optionMap.set(item.Platform, item));+ return Array.from(optionMap.values());}- // param: GraphData[] (of one networkModel), key (throughput, latency, efficiency, value)- static getKpiData(graphDataArr, key) {- return graphDataArr.map((data) => {- return data[key];- });+ // param: GraphData[], clientPlatforms+ static ByIeKpis(graphDataArr, clientPlatforms) {+ var kpis = []+ clientPlatforms.forEach((platformName) => {+ graphDataArr.filter((data) => {+ if (data.Platform.includes(platformName)) {+ for (var key in data.Parameters) {+ if (!kpis.includes(key)) kpis.push(key)+ }+ }+ })+ })+ return kpis;}-}--class ExcelDataTransformer {-- static transform(csvdata, version) {- const entries = csvdata.filter((entry) => {- return !entry.includes('begin_rec') && !entry.includes('end_rec');- });- // do other purging and data massaging here-- // else generate- return entries.map((entry) => {- if (version == 'ovms')- return new GraphData(new OVMSExcelData(entry));- return new GraphData(new ExcelData(entry));- });+ // param: GraphData[]+ static getParameters(graphDataArr) {+ var parameters = []+ graphDataArr.filter((data) => {+ for (var key in data.Parameters) {+ if (!parameters.includes(Graph.capitalizeFirstLetter(key))) parameters.push(Graph.capitalizeFirstLetter(key))+ }+ })+ return parameters;}-}--class ExcelData {- constructor(csvdataline) {- if (!csvdataline) {- return;- }- this.networkModel = csvdataline[0].toLowerCase();- this.release = csvdataline[1];- this.ieType = csvdataline[2];- this.platformName = csvdataline[3];- this.throughputInt4 = csvdataline[22];- 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];- this.tdp = csvdataline[10];- this.sockets = csvdataline[11];- this.pricePerSocket = csvdataline[12];- this.tdpPerSocket = csvdataline[13];- this.latency = csvdataline[14];- 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];- this.latencyUnit = csvdataline[18];+ // param: GraphData[]+ static getIeTypes(graphDataArr) {+ var kpis = []+ graphDataArr.filter((data) => {+ for (var key in data.Parameters) {+ if (!kpis.includes(Graph.capitalizeFirstLetter(key))) kpis.push(Graph.capitalizeFirstLetter(key))+ }+ })+ return kpis;}-}--class OVMSExcelData extends ExcelData {- constructor(csvdataline) {- super(csvdataline);- this.throughputOVMSInt8 = csvdataline[5];- this.throughputInt8 = csvdataline[4];- this.throughputOVMSFP32 = csvdataline[7];- this.throughputFP32 = csvdataline[6];- this.throughputUnit = csvdataline[8]+ // param: GraphData[], clientPlatforms[]+ static ByClientPlatforms(graphDataArr, platformsArr) {+ return graphDataArr.filter((data) => {+ return platformsArr.includes(data.Platform)+ });}-}--class GraphData {- constructor(excelData) {- if (!excelData) {- return;+ // param: GraphData[], coreTypes[]+ static FilterByCoreTypes(graphDataArr, coreTypes) {+ if (coreTypes) {+ return graphDataArr.filter((data) => coreTypes.includes(data.PlatformType));}- this.networkModel = excelData.networkModel;- this.release = excelData.release;- this.ieType = excelData.ieType;- this.platformName = excelData.platformName;- this.kpi = new KPI(- {- 'ovmsint8': excelData.throughputOVMSInt8,- 'ovmsfp32': excelData.throughputOVMSFP32,- 'int4': excelData.throughputInt4,- 'int8': excelData.throughputInt8,- 'fp16': excelData.throughputFP16,- 'fp32': excelData.throughputFP32,- 'bf16': excelData.throughputBF16- },- excelData.value,- excelData.efficiency,- {- 'ovmsint8': excelData.throughputOVMSInt8,- 'ovmsfp32': excelData.throughputOVMSFP32,- 'int4': excelData.latency4,- 'int8': excelData.latency,- 'fp16': excelData.latency16,- 'fp32': excelData.latency32,- 'bf16': excelData.latencyBF16- },);-- this.price = excelData.price;- this.tdp = excelData.tdp;- this.sockets = excelData.sockets;- this.pricePerSocket = excelData.pricePerSocket;- this.tdpPerSocket = excelData.tdpPerSocket;- this.latency = excelData.latency;- this.throughputUnit = excelData.throughputUnit;- this.valueUnit = excelData.valueUnit;- this.efficiencyUnit = excelData.efficiencyUnit;- this.latencyUnit = excelData.latencyUnit;- }-}---class KPI {- constructor(precisions, value, efficiency, latencies) {- this.throughput = precisions;- this.value = value;- this.efficiency = efficiency;- this.latency = latencies;+ return graphDataArr;}}-class Modal {- static getIeTypeLabel(ietype) {- switch (ietype) {- case 'core':- return 'Client Platforms (Intel® Core™)';- case 'xeon':- return 'Server Platforms (Intel® Xeon®)';- case 'atom':- return 'Mobile Platforms (Intel® Atom™)';- case 'accel':- return 'Accelerator Platforms';- default:- return '';- }- }- static getCoreTypesLabels() {- return ['CPU', 'iGPU\\NPU', 'CPU+iGPU'];- }- static getKpisLabels(version) {- if (version == 'ovms')- return ['Throughput'];- return ['Throughput', 'Latency', 'Value', 'Efficiency'];- }- static getPrecisionsLabels(version) {- if (version == 'ovms')- return ['OV-INT8 (reference)', 'INT8', 'OV-FP32 (reference)', 'FP32'];- return ['INT4', 'INT8', 'FP16', 'FP32', 'BF16'];- }- static getCoreTypes(labels) {- return labels.map((label) => {- switch (label) {- case 'CPU':- return 'core';- case 'iGPU\\NPU':- return 'core-iGPU';- case 'CPU+iGPU':- return 'core-CPU+iGPU';- default:- return '';+ static getPrecisionsLabels(graphDataArr) {+ var kpis = []+ graphDataArr.filter((data) => {+ for (var key in data.Parameters) {+ data.Parameters[key].Precisions.forEach((key) => {+ Object.keys(key).forEach((key) => {+ if (!kpis.includes(key.toUpperCase())) kpis.push(key.toUpperCase())+ });+ })}- });+ })+ return kpis;}- static getPrecisions(labels) {++ static getPrecisions(appConfig, labels) {return labels.map((label) => {- switch (label) {- case 'OV-INT8 (reference)':- return 'ovmsint8';- case 'OV-FP32 (reference)':- return 'ovmsfp32';- case 'INT4':- return 'int4';- case 'INT8':- return 'int8';- case 'FP16':- return 'fp16';- case 'FP32':- return 'fp32';- case 'BF16':- return 'bf16';- default:- return '';+ var prec = appConfig.PrecisionsMap[label];+ if (prec !== undefined) {+ return prec;}- });- }- static getUnitDescription(unit) {- switch (unit) {- case 'msec.':- return '(lower is better)';- case 'msec/token':- return '(lower is better)';- case 'Generating time, sec.':- return '(lower is better)';- case 'msec/token/TDP':- return '(lower is better)';- case 'FPS':- return '(higher is better)';- case 'FPS/$':- return '(higher is better)';- case 'FPS/TDP':- return '(higher is better)';- default:- return '';+ else {+ return "no name";}+ });}}class Graph {- constructor(data) {- this.data = data;- }- data = new GraphData();-- // functions to get unique keys+ // functions to get unique keysstatic getNetworkModels(graphDataArr) {- return Array.from(new Set(graphDataArr.map((obj) => obj.networkModel)));+ return Array.from(new Set(graphDataArr.map((obj) => obj.Model)));}static getIeTypes(graphDataArr) {- return Array.from(new Set(graphDataArr.map((obj) => obj.ieType)));- }- static getPlatforms(graphDataArr) {- return Array.from(new Set(graphDataArr.map((obj) => obj.platformName)));+ return Array.from(new Set(graphDataArr.map((obj) => obj.PlatformType)));}static getCoreTypes(graphDataArr) {return Array.from(new Set(graphDataArr.map((obj) => obj.ieType)));@@ -318,121 +126,42 @@ class Graph {// param: GraphData[]static getPlatformNames(graphDataArr) {- return graphDataArr.map((data) => data.platformName);- }-- // param: GraphData[], kpi: string- static getDatabyKPI(graphDataArr, kpi) {- switch (kpi) {- case 'throughput':- return graphDataArr.map((data) => data.kpi.throughput);- case 'latency':- return graphDataArr.map((data) => data.kpi.latency);- case 'efficiency':- return graphDataArr.map((data) => data.kpi.efficiency);- case 'value':- return graphDataArr.map((data) => data.kpi.value);- default:- return [];- }+ return graphDataArr.map((data) => data.Platform);}+ // param: GraphData[], parameterName: string, precisions: list+ static getDatabyParameter(graphDataArr, parameterName, precisions) {+ var array = [];+ graphDataArr.forEach((item) => {+ if (item.Parameters[parameterName] !== undefined) {+ array.push(item.Parameters[parameterName].Precisions);+ }+ else {+ var obj = {};+ precisions.forEach((prec) => {+ obj[prec] = 0;+ })+ array.push([obj])+ }+ })+ return array;- // this returns an object that is used to ender the chart- static getGraphConfig(kpi, units, precisions) {- switch (kpi) {- case 'throughput':- return {- chartTitle: 'Throughput',- iconClass: 'throughput-icon',- unit: units.throughputUnit,- datasets: precisions.map((precision) => this.getPrecisionThroughputConfig(precision, units.throughputUnit)),- };- case 'latency':- return {- chartTitle: 'Latency',- iconClass: 'latency-icon',- unit: units.latencyUnit,- datasets: precisions.map((precision) => this.getPrecisionLatencyConfig(precision, units.latencyUnit)),- };- case 'value':- return {- chartTitle: 'Value',- iconClass: 'value-icon',- unit: units.valueUnit,- datasets: [{ data: null, color: '#8BAE46', label: `Value` }],- };- case 'efficiency':- return {- chartTitle: 'Efficiency',- iconClass: 'efficiency-icon',- unit: units.efficiencyUnit,- datasets: [{ data: null, color: '#E96115', label: `Efficiency` }],- };- default:- return {};- }- }-- static getPrecisionThroughputConfig(precision, unit) {- switch (precision) {- case 'ovmsint8':- return { data: null, color: '#FF8F51', label: `${unit} (OV Ref. INT8)` };- case 'ovmsfp32':- return { data: null, color: '#B24501', label: `${unit} (OV Ref. FP32)` };- case 'int4':- return { data: null, color: '#5bd0f0', label: `INT4` };- case 'int8':- return { data: null, color: '#00C7FD', label: `INT8` };- case 'fp16':- 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 {};- }}- static getPrecisionLatencyConfig(precision, unit) {- switch (precision) {- case 'ovmsint8':- return { data: null, color: '#FF8F51', label: `${unit} (OV Ref. INT8)` };- case 'ovmsfp32':- return { data: null, color: '#B24501', label: `${unit} (OV Ref. FP32)` };- case 'int4':- return { data: null, color: '#c197d1', label: `INT4` };- case 'int8':- return { data: null, color: '#b274ca', label: `INT8` };- case 'fp16':- 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 {};- }+ // this returns an object that is used to ender the chart+ static getGraphConfig(parameterName, item, precisions, appConfig) {+ return {+ chartTitle: Graph.capitalizeFirstLetter(parameterName),+ iconClass: parameterName + '-icon',+ unit: item.Parameters[parameterName]?.Unit,+ datasets: precisions.map((precision) => appConfig.PrecisionData[precision]),+ };}-- static getGraphPlatformText(platform) {- switch (platform) {- case 'atom':- return 'Mobile Platforms';- case 'core':- return 'Client Platforms';- case 'xeon':- return 'Server Platforms';- case 'accel':- return 'Accelerated Platforms';- default:- return '';- }+ static capitalizeFirstLetter(string) {+ return string.charAt(0).toUpperCase() + string.slice(1);}}-class ChartDisplay {constructor(mode, numberOfCharts) {this.mode = mode;@@ -440,14 +169,11 @@ class ChartDisplay {}}-$(document).ready(function () {- $('.ov-toolkit-benchmark-results').on('click', () => showModal('ov'));- $('.ovms-toolkit-benchmark-results').on('click', () => showModal('ovms'));-- function clickBuildGraphs(graph, networkModels, ietype, platforms, kpis, precisions) {- renderData(graph, networkModels, ietype, platforms, kpis, precisions);+ $('.ov-toolkit-benchmark-results').on('click', () => showModal());+ function clickBuildGraphs(graph, appConfig, networkModels, ieTypes, platforms, kpis, precisions) {+ renderData(graph, appConfig, networkModels, ieTypes, platforms, kpis, precisions);$('.modal-footer').show();$('#modal-display-graphs').show();$('.edit-settings-btn').off('click').on('click', (event) => {@@ -464,7 +190,6 @@ $(document).ready(function () {$(parent).children('.chart-wrap,.empty-chart-container').hide();$(parent).children('.chevron-right-btn').show();$(parent).children('.chevron-down-btn').hide();- $} else {$(parent).children('.chart-wrap,.empty-chart-container').show();$(parent).children('.chevron-down-btn').show();@@ -478,43 +203,44 @@ $(document).ready(function () {$('body').css('overflow', 'auto');}- function showModal(version) {+ function showModal() {$('body').css('overflow', 'hidden');- let dataPath = '../_static/benchmarks_files/OV-benchmark-data.csv';- if (version == 'ovms')- dataPath = '../_static/benchmarks_files/OVMS-benchmark-data.csv';- Papa.parse(dataPath, {- download: true,- complete: (result) => renderModal(result, version)- });+ fetch('../_static/benchmarks_files/graph-data-ov.json')+ .then((response) => response.json())+ .then((jsonData) => {+ fetch('../_static/benchmarks_files/graph-config.json')+ .then((configResponse) => configResponse.json())+ .then((appConfig) => {+ renderModal(jsonData, appConfig)+ })+ });}function getSelectedNetworkModels() {- return $('.models-column-one input:checked, .models-column-two input:checked').not('[data-networkmodel="Select All"]').map(function () {+ return $('.models-column input:checked, .platforms-column input:checked').not('[data-networkmodel="Select All"]').map(function () {return $(this).data('networkmodel');}).get();}- function getSelectedIeType() {++ function getSelectedIeTypes() {return $('.ietype-column input:checked').map(function () {return $(this).data('ietype');- }).get().pop();- }- function getSelectedCoreTypes() {- return $('.client-platform-column .selected').map(function () {- return $(this).data('coretype');}).get();}+function getSelectedClientPlatforms() {- return $('.client-platform-column input:checked').map(function () {+ return $('.platforms-column input:checked').map(function () {return $(this).data('platform');}).get();}+function getSelectedKpis() {return $('.kpi-column input:checked').map(function () {return $(this).data('kpi');}).get();}+function getSelectedPrecisions() {return $('.precisions-column input:checked').map(function () {return $(this).data('precision');@@ -523,209 +249,241 @@ $(document).ready(function () {function validateSelections() {if (getSelectedNetworkModels().length > 0- && getSelectedIeType()- && getSelectedClientPlatforms().length > 0- && getSelectedKpis().length > 0) {- if (getSelectedKpis().includes('Throughput')) {- if (getSelectedPrecisions().length > 0) {- $('#build-graphs-btn').prop('disabled', false);- return;- }- $('#build-graphs-btn').prop('disabled', true);+ && getSelectedIeTypes()+ && getSelectedClientPlatforms().length > 0+ && getSelectedKpis().length > 0) {+ if (getSelectedPrecisions().length > 0) {+ $('#build-graphs-btn').prop('disabled', false);return;}- $('#build-graphs-btn').prop('disabled', false);+ $('#build-graphs-btn').prop('disabled', true);return;}$('#build-graphs-btn').prop('disabled', true);}- function renderModal(result, version) {- // remove header from csv line- result.data.shift();- var graph = new Graph(ExcelDataTransformer.transform(result.data, version));-- var networkModels = Graph.getNetworkModels(graph.data);- var ieTypes = Graph.getIeTypes(graph.data);-+ function renderModal(graph, appConfig) {+ new Graph(graph);+ var networkModels = Graph.getNetworkModels(graph);+ var ieTypes = Graph.getIeTypes(graph);fetch('../_static/html/modal.html').then((response) => response.text()).then((text) => {// generate and configure modal containervar modal = $('<div>');modal.attr('id', 'graphModal');modal.addClass('modal');- // generate and configure modal content from html importvar modalContent = $(text);modalContent.attr('id', 'graphModalContent');modalContent.addClass('modal-content');modal.append(modalContent);const models = networkModels.map((networkModel) => createCheckMark(networkModel, 'networkmodel'));- const selectAllModelsButton = createCheckMark('Select All', 'networkmodel')- modal.find('.models-column-one').append(selectAllModelsButton).append(models.slice(0, models.length / 2));- modal.find('.models-column-two').append(models.slice(models.length / 2));+ modal.find('.models-column').append(models);- const precisions = Modal.getPrecisionsLabels(version).map((precision) => createCheckMark(precision, 'precision'));+ const selectAllModelsButton = createCheckMark('', 'networkmodel');+ modal.find('.models-selectall').append(selectAllModelsButton);++ const selectAllPlatformsButton = createCheckMark('', 'platform');+ modal.find('.platforms-selectall').append(selectAllPlatformsButton);++ const precisions = Modal.getPrecisionsLabels(graph).map((precision) => createCheckMark(precision, 'precision', false));modal.find('.precisions-column').append(precisions);+selectAllCheckboxes(precisions);disableAllCheckboxes(precisions);- const types = ieTypes.map((ieType) => {- var labelText = Modal.getIeTypeLabel(ieType);- if (labelText) {- const item = $('<label class="checkmark-container">');- const checkboxSpan = $('<span class="checkmark radiobutton">');- item.text(Modal.getIeTypeLabel(ieType));- const radio = $('<input type="radio" name="ietype"/>');- item.append(radio);- item.append(checkboxSpan);- radio.attr('data-ietype', ieType);- return item;- }- });- modal.find('#modal-display-graphs').hide();+ const selectAllTypesButton = createCheckMark('', 'ietype')+ modal.find('.ietype-selectall').append(selectAllTypesButton);- modal.find('.ietype-column').append(types);+ const iefilter = ieTypes.map((ieType) => createCheckMark(ieType, 'ietype'));+ modal.find('.ietype-column').append(iefilter);++ modal.find('#modal-display-graphs').hide();modal.find('.ietype-column input').first().prop('checked', true);- const kpiLabels = Modal.getKpisLabels(version).map((kpi) => createCheckMark(kpi, 'kpi'));+ const kpiLabels = Filter.getParameters(graph).map((parameter) => createCheckMark(parameter, 'kpi', false));modal.find('.kpi-column').append(kpiLabels);$('body').prepend(modal);- renderClientPlatforms(graph.data, modal, version, true);- preselectDefaultSettings(graph.data, modal, version);+ preselectDefaultSettings(graph, modal, appConfig);++ //is not generic solution :(+ if (appConfig.DefaultSelections.platformTypes?.data?.includes('Select All')) {+ selectAllCheckboxes(iefilter);++ };+ renderClientPlatforms(graph, modal);$('.clear-all-btn').on('click', clearAll);$('#build-graphs-btn').on('click', () => {$('#modal-configure-graphs').hide();- clickBuildGraphs(graph, getSelectedNetworkModels(), getSelectedIeType(), getSelectedClientPlatforms(), getSelectedKpis(), Modal.getPrecisions(getSelectedPrecisions()));+ clickBuildGraphs(graph, appConfig, getSelectedNetworkModels(), getSelectedIeTypes(), getSelectedClientPlatforms(), getSelectedKpis(), Modal.getPrecisions(appConfig, getSelectedPrecisions()));});$('.modal-close').on('click', hideModal);$('.close-btn').on('click', hideModal);- modal.find('.models-column-one input[data-networkmodel="Select All"]').on('click', function() {++ modal.find('.ietype-selectall input').on('click', function () {if ($(this).prop('checked'))- selectAllCheckboxes(models);+ selectAllCheckboxes(iefilter);+ else deSelectAllCheckboxes(iefilter);+ });++ modal.find('.models-selectall input').on('click', function () {+ if ($(this).prop('checked')) selectAllCheckboxes(models);else deSelectAllCheckboxes(models);++ renderClientPlatforms(graph, modal)+ });++ modal.find('.platforms-selectall input').on('click', function () {+ if ($(this).prop('checked'))+ renderClientPlatforms(graph, modal)+ else {+ var enabledPlatforms = modal.find('.platforms-column .checkmark-container');+ deSelectCheckbox(enabledPlatforms);+ };++ });++ modal.find('.models-column input').on('click', function () {+ if (!$(this)[0].checked) {+ deSelectCheckbox(selectAllModelsButton);+ }});- modal.find('.ietype-column input').on('click', () => renderClientPlatforms(graph.data, modal, version, true));- modal.find('.kpi-column input').on('click', validateThroughputSelection);+++ modal.find('.ietype-column input').on('click', function () {+ if (!$(this)[0].checked) {+ deSelectCheckbox(selectAllTypesButton);+ }+ });++ modal.find('.models-column input').on('click', () => renderClientPlatforms(graph, modal));+ modal.find('.ietype-column input').on('click', () => renderClientPlatforms(graph, modal));+ modal.find('.ietype-selectall input').on('click', () => renderClientPlatforms(graph, modal));+ modal.find('.platforms-column').on('click', () => enableParmeters(graph, getSelectedClientPlatforms()));++ modal.find('.kpi-column input').on('click', validatePrecisionSelection);modal.find('input').on('click', validateSelections);++ var modalFilters = document.getElementById("modal-filters");++ var showFiltersButton = document.getElementById("filters");+ showFiltersButton.onclick = function () {+ modalFilters.style.display = "block";+ }++ var closeFiltersButton = document.getElementsByClassName("close-filters")[0];+ closeFiltersButton.onclick = function () {+ modalFilters.style.display = "none";+ }++ window.onclick = function (event) {+ if (event.target == modalFilters) {+ modalFilters.style.display = "none";+ }+ }});}- function validateThroughputSelection() {+ function validatePrecisionSelection() {const precisions = $('.precisions-column').find('input')- if (getSelectedKpis().includes('Throughput') || getSelectedKpis().includes('Latency')) {- precisions.prop('disabled', false);- }- else {- precisions.prop('disabled', true);- }+ precisions.prop('disabled', false);}function clearAll() {$('.modal-content-grid-container input:checkbox').each((index, object) => $(object).prop('checked', false));- // Uncomment if you want the Clear All button to reset the Platform Type column as well- // modal.find('.ietype-column input').first().prop('checked', true);- validateThroughputSelection();+ validatePrecisionSelection();validateSelections();}- function preselectDefaultSettings(data, modal, version) {- const defaultSelections = (version == 'ov') ? OVdefaultSelections : OVMSdefaultSelections;- if (defaultSelections.platformTypes) {- const type = defaultSelections.platformTypes.data[0]- $(`input[data-ietype="${type}"]`).prop('checked', true);- renderClientPlatforms(data, modal, version);- }- if (defaultSelections.platformFilters) {- const filters = modal.find('.selectable-box-container').children('.selectable-box');- filters.removeClass('selected');- defaultSelections.platformFilters.data.forEach(selection => {- filters.filter(`[data-${defaultSelections.platformFilters.name}="${selection}"]`).addClass('selected');- });- renderClientPlatforms(data, modal, version);- }+ function preselectDefaultSettings(graph, modal, appConfig) {++ const defaultSelections = appConfig.DefaultSelections;++ selectDefaultPlatformType(defaultSelections.platformTypes, graph, modal);++ applyPlatformFilters(defaultSelections.platformFilters, modal, graph);++ clearAllSettings(defaultSelections);++ validateSelections();+ validatePrecisionSelection();+ }++ function selectDefaultPlatformType(platformTypes, graph, modal) {+ if (!platformTypes) return;++ const type = platformTypes.data[0];+ $(`input[data-ietype="${type}"]`).prop('checked', true);+ renderClientPlatforms(graph, modal);+ }++ function applyPlatformFilters(platformFilters, modal, graph) {+ if (!platformFilters) return;++ const filters = modal.find('.selectable-box-container').children('.selectable-box');+ filters.removeClass('selected');++ platformFilters.data.forEach(selection => {+ filters.filter(`[data-${platformFilters.name}="${selection}"]`).addClass('selected');+ });++ renderClientPlatforms(graph, modal);+ }++ function clearAllSettings(defaultSelections) {clearAll();- for (setting in defaultSelections) {- let name = defaultSelections[setting].name;- defaultSelections[setting].data.forEach(selection => {+ Object.keys(defaultSelections).forEach(setting => {+ const { name, data } = defaultSelections[setting];+ data.forEach(selection => {$(`input[data-${name}="${selection}"]`).prop('checked', true);});- }- validateThroughputSelection();- validateSelections();- }-- function showCoreSelectorTypes(coreTypes, graphDataArr, modal) {- if ($('.client-platform-column').find('.selectable-box-container').length) {- $('.client-platform-column').find('.selectable-box-container').show();- return;- }- var container = $('<div>');- container.addClass('selectable-box-container');- coreTypes.forEach((type) => {- var box = $('<div>' + type + '</div>');- box.attr('data-coretype', type);- box.addClass('selectable-box selected');- container.append(box);- });- $('.client-platform-column').prepend(container);- $('.client-platform-column .selectable-box').on('click', function () {- if ($(this).hasClass('selected')) {- $(this).removeClass('selected');- } else {- $(this).addClass('selected');- }- var fPlatforms = filterClientPlatforms(graphDataArr, getSelectedNetworkModels(), getSelectedIeType(), Modal.getCoreTypes(getSelectedCoreTypes()));- renderClientPlatformsItems(modal, Graph.getPlatformNames(fPlatforms), true);- validateSelections();});}- function hideCoreSelectorTypes() {- $('.client-platform-column').find('.selectable-box-container').hide();+ function filterClientPlatforms(graph, ietypes) {+ return Filter.ByIeTypes(graph, ietypes);}- function filterClientPlatforms(data, networkModels, ietype, coreTypes) {- // No longer filtering on the network type, if at some point we want the network type as a filter, uncomment this- // var first = Filter.FilterByNetworkModel(data, networkModels);- var second = Filter.FilterByIeType(data, ietype);- if (ietype === 'core') {- second = Filter.FilterByCoreTypes(second, coreTypes);- }- const optionMap = new Map();- second.forEach(item => optionMap.set(item.platformName, item));- return Array.from(optionMap.values());+ function filterPlatforms(graph, ietypes, models) {+ return Filter.ByTypesAndModels(graph, ietypes, models);}- function renderClientPlatforms(data, modal, version, preselectEveryItem) {- if (getSelectedIeType() === 'core') {- showCoreSelectorTypes(Modal.getCoreTypesLabels(), data, modal);- if (version === 'ovms')- hideCoreSelectorTypes();- }- else {- hideCoreSelectorTypes();- }- var fPlatforms = filterClientPlatforms(data, getSelectedNetworkModels(), getSelectedIeType(), Modal.getCoreTypes(getSelectedCoreTypes()));- renderClientPlatformsItems(modal, Graph.getPlatformNames(fPlatforms), preselectEveryItem);+ function renderClientPlatforms(graph, modal) {+ var fPlatforms = filterClientPlatforms(graph, getSelectedIeTypes());+ var platformNames = Graph.getPlatformNames(fPlatforms);+ $('.platforms-column .checkmark-container').remove();++ const clientPlatforms = platformNames.map((platform) => createCheckMark(platform, 'platform', true));++ var enabledPlatforms = filterPlatforms(graph, getSelectedIeTypes(), getSelectedNetworkModels());+ enableCheckBoxes(clientPlatforms, enabledPlatforms);+ modal.find('.platforms-column').append(clientPlatforms);++ enableParmeters(graph, getSelectedClientPlatforms());+ modal.find('.platforms-column input').on('click', validateSelections);}- function renderClientPlatformsItems(modal, platformNames, preselectEveryItem) {- $('.client-platform-column .checkmark-container').remove();- const clientPlatforms = platformNames.map((platform) => createCheckMark(platform, 'platform'));- if (preselectEveryItem)- selectAllCheckboxes(clientPlatforms);- modal.find('.client-platform-column').append(clientPlatforms);- modal.find('.client-platform-column input').on('click', validateSelections);+ function enableParmeters(graph, clientPlatforms) {+ var allKpis = Filter.getParameters(graph);++ allKpis.forEach((kpi) => {+ $(`input[data-kpi="${Graph.capitalizeFirstLetter(kpi)}"]`).prop('disabled', true);+ })++ var kpis = Filter.ByIeKpis(graph, clientPlatforms);+ kpis.forEach((kpi) => {+ $(`input[data-kpi="${Graph.capitalizeFirstLetter(kpi)}"]`).prop('disabled', false);+ })}- function createCheckMark(itemLabel, modelLabel) {+ function createCheckMark(itemLabel, modelLabel, disabled) {const item = $('<label class="checkmark-container">');item.text(itemLabel);const checkbox = $('<input type="checkbox"/>');+ checkbox.prop('disabled', disabled);const checkboxSpan = $('<span class="checkmark">');item.append(checkbox);item.append(checkboxSpan);@@ -740,9 +498,16 @@ $(document).ready(function () {});}- function enableAllCheckboxes(items) {- items.forEach((item) => {- item.find(':input').prop('disabled', false);+ function enableCheckBoxes(items, enabledItems) {+ items.forEach((item) => {+ item.find(':input').prop('disabled', true);+ enabledItems.forEach((platform) => {+ var tmp = item.find(':input');+ if(tmp[0].dataset.platform === platform.Platform){+ item.find(':input').prop('checked', true);+ item.find(':input').prop('disabled', false);+ }+ })})}@@ -757,85 +522,87 @@ $(document).ready(function () {item.find(':input').prop('checked', false);});}+ function deSelectCheckbox(item) {+ item.find(':input').prop('checked', false);+ }// =================== HTMLLEGEND =========================const getOrCreateLegendList = (chart, id) => {- const legendContainer = document.getElementById(id);- let listContainer = legendContainer.querySelector('ul');-- if (!listContainer) {- listContainer = document.createElement('ul');- listContainer.style.display = 'flex';- listContainer.style.flexDirection = 'row';- listContainer.style.margin = 0;- listContainer.style.padding = 0;- listContainer.style.paddingLeft = '0px';-- legendContainer.appendChild(listContainer);- }+ const legendContainer = document.getElementById(id);+ let listContainer = legendContainer.querySelector('ul');++ if (!listContainer) {+ listContainer = document.createElement('ul');+ listContainer.style.display = 'flex';+ listContainer.style.flexDirection = 'row';+ listContainer.style.margin = 0;+ listContainer.style.padding = 0;+ listContainer.style.paddingLeft = '0px';++ legendContainer.appendChild(listContainer);+ }- return listContainer;+ return listContainer;};const htmlLegendPlugin = {- id: 'htmlLegend',- afterUpdate(chart, args, options) {-- const ul = getOrCreateLegendList(chart, chart.options.plugins.htmlLegend.containerID);+ id: 'htmlLegend',+ afterUpdate(chart, args, options) {- // Remove old legend items- while (ul.firstChild) {- ul.firstChild.remove();- }+ const ul = getOrCreateLegendList(chart, chart.options.plugins.htmlLegend.containerID);- // Reuse the built-in legendItems generator- const items = chart.legend.legendItems;- items.forEach(item => {- const li = document.createElement('li');- li.style.alignItems = 'center';- li.style.display = 'block';- li.style.flexDirection = 'column';- li.style.marginLeft = '4px';-- li.onclick = () => {- const {type} = chart.config;- if (type === 'pie' || type === 'doughnut') {- // Pie and doughnut charts only have a single dataset and visibility is per item- chart.toggleDataVisibility(item.index);- } else {- chart.setDatasetVisibility(item.datasetIndex, !chart.isDatasetVisible(item.datasetIndex));+ // Remove old legend items+ while (ul.firstChild) {+ ul.firstChild.remove();}- chart.update();- };-- // Color box- const boxSpan = document.createElement('span');- boxSpan.style.background = item.fillStyle;- boxSpan.style.borderColor = item.strokeStyle;- boxSpan.style.borderWidth = item.lineWidth + 'px';- boxSpan.style.display = 'inline-block';- boxSpan.style.height = '10px';- boxSpan.style.marginRight = '4px';- boxSpan.style.width = '30px';-- // Text- const textContainer = document.createElement('p');- textContainer.style.color = '#666';- textContainer.style.margin = 0;- textContainer.style.padding = 0;- textContainer.style.fontSize = '0.6rem';- textContainer.style.marginLeft = '3px';- textContainer.style.textDecoration = item.hidden ? 'line-through' : '';-- const text = document.createTextNode(item.text);- textContainer.appendChild(text);-- li.appendChild(boxSpan);- li.appendChild(textContainer);- ul.appendChild(li);- });- }++ const items = chart.legend.legendItems;+ items.forEach(item => {+ const li = document.createElement('li');+ li.style.alignItems = 'center';+ li.style.display = 'block';+ li.style.flexDirection = 'column';+ li.style.marginLeft = '4px';++ li.onclick = () => {+ const { type } = chart.config;+ if (type === 'pie' || type === 'doughnut') {+ // Pie and doughnut charts only have a single dataset and visibility is per item+ chart.toggleDataVisibility(item.index);+ } else {+ chart.setDatasetVisibility(item.datasetIndex, !chart.isDatasetVisible(item.datasetIndex));+ }+ chart.update();+ };++ // Color box+ const boxSpan = document.createElement('span');+ boxSpan.style.background = item.fillStyle;+ boxSpan.style.borderColor = item.strokeStyle;+ boxSpan.style.borderWidth = item.lineWidth + 'px';+ boxSpan.style.display = 'inline-block';+ boxSpan.style.height = '10px';+ boxSpan.style.marginRight = '4px';+ boxSpan.style.width = '30px';++ // Text+ const textContainer = document.createElement('p');+ textContainer.style.color = '#666';+ textContainer.style.margin = 0;+ textContainer.style.padding = 0;+ textContainer.style.fontSize = '0.6rem';+ textContainer.style.marginLeft = '3px';+ textContainer.style.textDecoration = item.hidden ? 'line-through' : '';++ const text = document.createTextNode(item.text);+ textContainer.appendChild(text);++ li.appendChild(boxSpan);+ li.appendChild(textContainer);+ ul.appendChild(li);+ });+ }};function getChartOptions(title, containerId) {@@ -858,7 +625,7 @@ $(document).ready(function () {display: false,beginAtZero: true}- }+ }},plugins: {legend: {@@ -869,7 +636,7 @@ $(document).ready(function () {}}}- }+ } Throughputfunction getChartDataNew(labels, datasets) {return {@@ -886,17 +653,16 @@ $(document).ready(function () {}}- function renderData(graph, networkModels, ietype, platforms, kpis, precisions) {-+ function renderData(graph, appConfig, networkModels, ieTypes, platforms, kpis, precisions) {$('.chart-placeholder').empty();$('.modal-footer').empty();+const display = new ChartDisplay(getChartsDisplayMode(kpis.length), kpis.length);networkModels.forEach((networkModel) => {var chartName = networkModel;var chartSlug = chartName.replace(')', '').replace(' (', '-');var chartContainer = $('<div>');-var chevronDown = '<span class="chevron-down-btn"></span>';var chevronRight = '<span style="display:none" class="chevron-right-btn"></span>';$(chevronRight).hide();@@ -908,61 +674,44 @@ $(document).ready(function () {chartContainer.addClass('chart-container');- var filteredNetworkModels = Filter.FilterByNetworkModel(graph.data, [networkModel]);- var filteredIeTypes = Filter.FilterByIeType(filteredNetworkModels, ietype);- var filteredGraphData = Filter.FilterByClientPlatforms(filteredIeTypes, platforms);-+ var filteredNetworkModels = Filter.FilterByNetworkModel(graph, [networkModel]);+ var filteredIeTypes = Filter.ByIeTypes(filteredNetworkModels, ieTypes);+ var filteredGraphData = Filter.ByClientPlatforms(filteredIeTypes, platforms);$('.chart-placeholder').append(chartContainer);if (filteredGraphData.length > 0) {- createChartWithNewData(filteredGraphData, chartContainer, kpis, ietype, precisions, display);+ createChartWithNewData(filteredGraphData, appConfig, chartContainer, kpis, ieTypes, precisions, display);} else {- createEmptyChartContainer(chartContainer);+ createEmptyChartContainer(chartContainer);}})- if(kpis.includes('Value') || kpis.includes('Efficiency')){- $('.modal-footer').append($('<div class="modal-line-divider"></div>'))- }- $('.modal-footer').append($('<div class="modal-footer-content"><div class="modal-disclaimer-box"></div></div>'))- for (let kpi of kpis) {- if (chartDisclaimers[kpi])- $('.modal-disclaimer-box').append($('<p>').text(chartDisclaimers[kpi]))- }-$(window).off('resize');$(window).resize(() => resetChartsDisplay(display));};function createEmptyChartContainer(chartContainer) {- chartContainer.append($('<div>').addClass('empty-chart-container').text('No data for this configuration.'));+ chartContainer.append($('<div>').addClass('empty-chart-container').text('No data for this configuration.'));}// this function should take the final data set and turn it into graphs// params: GraphData, unused, chartContainer- function createChartWithNewData(model, chartContainer, kpis, ietype, precisions, display) {+ function createChartWithNewData(model, appConfig, chartContainer, parameters, ietype, precisions, display) {var chartWrap = $('<div>');chartWrap.addClass('chart-wrap');chartContainer.append(chartWrap);- var labels = Graph.getPlatformNames(model);- var graphConfigs = kpis.map((str) => {- var kpi = str.toLowerCase();+ var graphConfigs = parameters.map((parameter) => {var groupUnit = model[0];- if (kpi === 'throughput' || kpi === 'latency') {- var kpiData = Graph.getDatabyKPI(model, kpi);- var config = Graph.getGraphConfig(kpi, groupUnit, precisions);- precisions.forEach((prec, index) => {- config.datasets[index].data = kpiData.map(tData => tData[prec]);- });- return config;- // return removeEmptyLabel(config);- }- var config = Graph.getGraphConfig(kpi, groupUnit);- config.datasets[0].data = Graph.getDatabyKPI(model, kpi);+ var kpiData = Graph.getDatabyParameter(model, appConfig.ParametersMap[parameter], precisions);+ var config = Graph.getGraphConfig(appConfig.ParametersMap[parameter], groupUnit, precisions, JSON.parse(JSON.stringify(appConfig)));+ precisions.forEach((precision, index) => {+ config.datasets[index].data = kpiData.map(tData => tData[0][precision]+ );+ });return config;});--+// get the client platform labels and create labels for all the graphs+ var labels = Graph.getPlatformNames(model);var labelsContainer = $('<div>');labelsContainer.addClass('chart-labels-container');chartWrap.append(labelsContainer);@@ -974,6 +723,10 @@ $(document).ready(function () {graphConfigs.forEach((graphConfig, index) => {const id = getRandomNumber();+ if (graphConfig.unit === undefined) {+ graphConfig.unit = 'No unit.';+ }+var graphItem = $(`<div id=${id}>`);graphItem.addClass('graph-item');var columnHeaderContainer = $('<div>');@@ -983,9 +736,7 @@ $(document).ready(function () {columnHeaderContainer.append(columnIcon);var columnHeader = $('<div class="chart-header">');columnHeader.append($('<div class="title">' + graphConfig.chartTitle + '</div>'));- columnHeader.append($('<div class="title">' + Graph.getGraphPlatformText(ietype) + '</div>'));- columnHeader.append($('<div class="subtitle">' + graphConfig.unit + ' ' + Modal.getUnitDescription(graphConfig.unit) + '</div>'));-+ columnHeader.append($('<div class="subtitle">' + graphConfig.unit + ' ' + appConfig.UnitDescription[graphConfig.unit] + '</div>'));columnHeaderContainer.append(columnHeader);chartGraphsContainer.append(graphItem);var graphClass = $('<div>');@@ -1000,10 +751,8 @@ $(document).ready(function () {const labelsHeight = (labels.length * 55);const chartHeight = $(graphItem).outerHeight();const bottomPadding = (chartHeight - (topPadding + labelsHeight));-var labelsItem = $('<div>');labelsItem.addClass('chart-labels-item');-labels.forEach((label) => {labelsItem.append($('<div class="title">' + label + '</div>'));});@@ -1017,20 +766,6 @@ $(document).ready(function () {setChartsDisplayDirection(display.mode);adjustHeaderIcons(display.mode);}- function removeEmptyLabel(config, indexes) {- var 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@@ -1050,10 +785,10 @@ $(document).ready(function () {context.canvas.height = heightRatio;window.setTimeout(() => {new Chart(context, {- type: 'bar',- data: getChartDataNew(labels, datasets),- options: getChartOptions(chartTitle, containerId),- plugins: [htmlLegendPlugin]+ type: 'bar',+ data: getChartDataNew(labels, datasets),+ options: getChartOptions(chartTitle, containerId),+ plugins: [htmlLegendPlugin]});});}@@ -1116,17 +851,17 @@ $(document).ready(function () {switch (numberOfCharts) {case 4:return window.matchMedia('(max-width: 721px)').matches ? 'column'- : window.matchMedia('(max-width: 830px)').matches ? 'rowCompact'+ : window.matchMedia('(max-width: 830px)').matches ? 'rowCompact': 'row';case 3:return window.matchMedia('(max-width: 569px)').matches ? 'column'- : window.matchMedia('(max-width: 649px)').matches ? 'rowCompact'+ : window.matchMedia('(max-width: 649px)').matches ? 'rowCompact': 'row';case 2:return window.matchMedia('(max-width: 500px)').matches ? 'column'- : 'row';+ : 'row';default:return 'row';}}-});+});\ No newline at end of filediff --git a/docs/sphinx_setup/_templates/layout.html b/docs/sphinx_setup/_templates/layout.htmlindex 4c3775403f2..5ffe36826d3 100644--- a/docs/sphinx_setup/_templates/layout.html+++ b/docs/sphinx_setup/_templates/layout.html@@ -13,7 +13,6 @@<link rel="stylesheet" href="{{ pathto('_static/css/banner.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><script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-annotation/0.5.7/chartjs-plugin-annotation.min.js"></script>