[Nano] Update installation panel to include stock TensorFlow (#7622)

* Update installation panel for Nano to include stock TensorFlow

* Update nano installation table styles

* Fix selector which is too wide, and other small fixes
This commit is contained in:
Yuwen Hu 2023-02-22 17:55:03 +08:00 committed by GitHub
parent 33306da4d4
commit d4c46a011c
3 changed files with 122 additions and 182 deletions

View file

@ -7,34 +7,32 @@
#table-1 { #table-1 {
border-bottom-width: 0px; border-bottom-width: 0px;
margin:auto; margin: auto;
font-size: var(--pst-font-size-base);
font-family: Verdana;
color: var(--pst-color-text-base);
} }
#table-1 tr, td{ #table-1 tr, td{
padding: 0.5rem;
background-color: var(--pst-color-on-surface); background-color: var(--pst-color-on-surface);
height: 30px; }
border-width: 2px;
border-style: solid; #table-1 td{
border-color: white ; border: 0.25rem solid var(--pst-color-background);
padding: 5px; width: 150px;
} }
#table-1 tr td:first-child{ #table-1 tr td:first-child{
font-weight: 600; font-weight: 600;
} background-color: var(--pst-color-background);
border-left: 0.2rem solid var(--pst-color-on-surface);
#table-1 td{ text-align: left;
font-size: 16px; width: 170px;
font-family: Verdana; font-size: 13.5px;
color: var(--pst-color-text-base);
text-align: center;
/* height: 56px;
line-height: 56px; */
width: 160px;
} }
#table-1 button { #table-1 button {
font-size: 16px;
border-color: transparent; border-color: transparent;
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -43,10 +41,6 @@
} }
#table-1 #cmd { #table-1 #cmd {
height: 2em;
text-align: left; text-align: left;
} padding: 0.5rem 0.25rem
#table-1 .taller_tr {
height: 71px;
} }

View file

@ -1,149 +1,94 @@
var inferences=["inferenceyes", "inferenceno"]; var frameworks = ["pytorch", "tensorflow"];
var frameworks=["pytorch", "tensorflow"]; var versions = ["pytorch_110", "pytorch_111", "pytorch_112", "pytorch_113",
var versions=["pytorch_110", "pytorch_111", "pytorch_112", "pytorch_113", "tf2_27", "tf2_28", "tf2_29", "tf2_210"]; "tensorflow_27", "tensorflow_28", "tensorflow_29", "tensorflow_210"];
var releases=["stable", "nightly"]; var intel_tensorflow_options = ["intel_tensorflow_yes", "intel_tensorflow_no"]
var inferences = ["inference_yes", "inference_no"];
var releases = ["stable", "nightly"];
var inference="inferenceyes"; var framework = "pytorch";
var framework="pytorch"; var version = "pytorch_113";
var version="pytorch_113"; var intel_tensorflow_option = "intel_tensorflow_yes"
var release="nightly"; var inference = "inference_yes";
var release = "nightly";
function refresh_cmd(){ function refresh_cmd(){
$("#version").empty();
$("#intel_tensorflow").remove();
if(framework == "pytorch"){
$("#version").append("<td colspan='1'>PT Version</td>\
<td colspan='1'><button id='pytorch_113' class='install_option_button'>1.13</button></td>\
<td colspan='1'><button id='pytorch_112' class='install_option_button'>1.12</button></td>\
<td colspan='1'><button id='pytorch_111' class='install_option_button'>1.11</button></td>\
<td colspan='1'><button id='pytorch_110' class='install_option_button'>1.10</button></td>");
}
else if(framework == "tensorflow"){
$("#version").append("<td colspan='1'>TF Version</td>\
<td colspan='1'><button id='tensorflow_210' class='install_option_button'>2.10</button></td>\
<td colspan='1'><button id='tensorflow_29' class='install_option_button'>2.9</button></td>\
<td colspan='1'><button id='tensorflow_28' class='install_option_button'>2.8</button></td>\
<td colspan='1'><button id='tensorflow_27' class='install_option_button'>2.7</button></td>");
$("#version").after("<tr id='intel_tensorflow'>\
<td colspan='1'>Intel TensorFlow</td>\
<td colspan='2'><button id='intel_tensorflow_yes' class='install_option_button'>Yes</button></td>\
<td colspan='2'><button id='intel_tensorflow_no' class='install_option_button'>No</button></td>\
</tr>");
}
reset_color(frameworks); reset_color(frameworks);
reset_color(versions);
reset_color(intel_tensorflow_options);
reset_color(inferences); reset_color(inferences);
reset_color(releases); reset_color(releases);
set_color(framework); set_color(framework);
set_color(version);
set_color(intel_tensorflow_option);
set_color(inference); set_color(inference);
set_color(release); set_color(release);
var cmd="NA"; // disable buttons for options that cannot be selected together
if (release == "stable"){
disable(["intel_tensorflow_no"])
} else {
enable(["intel_tensorflow_no"])
}
$("#version").empty(); if (intel_tensorflow_option == "intel_tensorflow_no" &&
if(framework=="pytorch"){ framework == "tensorflow"){
$("#version").append("<td colspan='1'>Pytorch Version</td>\ disable(["stable"])
<td colspan='1'><button id='pytorch_113'>1.13</button></td>\ } else {
<td colspan='1'><button id='pytorch_112'>1.12</button></td>\ enable(["stable"])
<td colspan='1'><button id='pytorch_111'>1.11</button></td>\
<td colspan='1'><button id='pytorch_110'>1.10</button></td>");
} }
else if(framework=="tensorflow"){
$("#version").append("<td colspan='1'>Tensorflow Version</td>\
<td colspan='1'><button id='tf2_210'>2.10</button></td>\
<td colspan='1'><button id='tf2_29'>2.9</button></td>\
<td colspan='1'><button id='tf2_28'>2.8</button></td>\
<td colspan='1'><button id='tf2_27'>2.7</button></td>");
}
reset_color(versions);
set_color(version);
// if (framework=="pytorch"){ // whether to include pre-release version
// document.getElementById("cmd").style.whiteSpace = "normal"; var cmd_pre = (release == "nightly") ? " --pre --upgrade" : "";
// }
// else{ // decide on the bigdl-nano install option for framework
// document.getElementById('cmd').style.whiteSpace = "nowrap"; var cmd_options_framework = version;
// }
if(framework=="pytorch"){ if (intel_tensorflow_option == "intel_tensorflow_no"){
if(release=="stable"){ cmd_options_framework = "stock_" + cmd_options_framework;
if(inference=="inferenceyes"){
if(version=="pytorch_110"){
cmd="pip install bigdl-nano[pytorch_110,inference] -f https://software.intel.com/ipex-whl-stable";
}else if(version=="pytorch_111"){
cmd="pip install bigdl-nano[pytorch_111,inference]";
}else if(version=="pytorch_112"){
cmd="pip install bigdl-nano[pytorch_112,inference]";
}else if(version=="pytorch_113"){
cmd="pip install bigdl-nano[pytorch,inference]";
}
}else if(inference="inferenceno"){
if(version=="pytorch_110"){
cmd="pip install bigdl-nano[pytorch_110] -f https://software.intel.com/ipex-whl-stable";
}else if(version=="pytorch_111"){
cmd="pip install bigdl-nano[pytorch_111]";
}else if(version=="pytorch_112"){
cmd="pip install bigdl-nano[pytorch_112]";
}else if(version=="pytorch_113"){
cmd="pip install bigdl-nano[pytorch]";
}
}
}else if(release=="nightly"){
if(inference=="inferenceyes"){
if(version=="pytorch_110"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch_110,inference] -f https://software.intel.com/ipex-whl-stable";
}else if(version=="pytorch_111"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch_111,inference]";
}else if(version=="pytorch_112"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch_112,inference]";
}else if(version=="pytorch_113"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch,inference]";
}
}else if(inference="inferenceno"){
if(version=="pytorch_110"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch_110] -f https://software.intel.com/ipex-whl-stable";
}else if(version=="pytorch_111"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch_111]";
}else if(version=="pytorch_112"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch_112]";
}else if(version=="pytorch_113"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch]";
}
}
}
}else if(framework="tensorflow"){
if(inference=="inferenceyes"){
if (version=="tf2_27"){
if (release=="nightly"){
cmd="pip install --pre --upgrade bigdl-nano[tensorflow_27,inference]";
}else if(release=="stable"){
cmd="pip install bigdl-nano[tensorflow_27,inference]";
}
}else if(version=="tf2_28"){
if (release=="nightly"){
cmd="pip install --pre --upgrade bigdl-nano[tensorflow_28,inference]";
}else if(release=="stable"){
cmd="pip install bigdl-nano[tensorflow_28,inference]";
}
}else if(version=="tf2_29"){
if (release=="nightly"){
cmd="pip install --pre --upgrade bigdl-nano[tensorflow,inference]";
}else if(release=="stable"){
cmd="pip install bigdl-nano[tensorflow,inference]";
}
}else if(version=="tf2_210"){
if (release=="nightly"){
cmd="pip install --pre --upgrade bigdl-nano[tensorflow_210,inference]";
}else if(release=="stable"){
cmd="pip install bigdl-nano[tensorflow_210,inference]";
}
}
}else if(inference=="inferenceno"){
if(version=="tf2_27"){
if(release=="nightly"){
cmd="pip install --pre --upgrade bigdl-nano[tensorflow_27]";
}else if(release=="stable"){
cmd="pip install bigdl-nano[tensorflow_27]";
}
}else if(version=="tf2_28"){
if(release=="nightly"){
cmd="pip install --pre --upgrade bigdl-nano[tensorflow_28]";
}else if(release=="stable"){
cmd="pip install bigdl-nano[tensorflow_28]";
}
}else if(version=="tf2_29"){
if(release=="nightly"){
cmd="pip install --pre --upgrade bigdl-nano[tensorflow]";
}else if(release=="stable"){
cmd="pip install bigdl-nano[tensorflow]";
}
}else if(version=="tf2_210"){
if(release=="nightly"){
cmd="pip install --pre --upgrade bigdl-nano[tensorflow_210]";
}else if(release=="stable"){
cmd="pip install bigdl-nano[tensorflow_210]";
}
} }
// for default version
if (version == "pytorch_113"){
cmd_options_framework = "pytorch";
} else if (version == "tensorflow_29" && intel_tensorflow_option == "intel_tensorflow_yes"){
cmd_options_framework = "tensorflow";
} }
// decide on the bigdl-nano install option for including inference or not
var cmd_options_inference = (inference == "inference_yes") ? ",inference" : "";
// other options needed at the end of the installation command
var cmd_other = "";
if (version == "pytorch_110"){
cmd_other = " -f https://software.intel.com/ipex-whl-stable";
} }
var cmd = "pip install" + cmd_pre + " bigdl-nano[" + cmd_options_framework
+ cmd_options_inference + "]" + cmd_other;
$("#cmd").html(cmd); $("#cmd").html(cmd);
} }
@ -183,27 +128,29 @@ function enable(list){
} }
//when clicked a button, update variables //when clicked a button, update variables
$(document).on('click',"button",function(){ $(document).on('click',".install_option_button",function(){
var id = $(this).attr("id"); var id = $(this).attr("id");
if (frameworks.indexOf(id)>=0){ if (frameworks.includes(id)){
framework=id; framework = id;
if (framework=="tensorflow"){ if (framework == "tensorflow"){
version="tf2_29"; version = "tensorflow_29";
}else{ }else{
version="pytorch_113"; version="pytorch_113";
} }
} }
else if (releases.indexOf(id)>=0){ else if (versions.includes(id)){
release=id; version = id;
} }
else if (inferences.indexOf(id)>=0){ else if (intel_tensorflow_options.includes(id)){
inference=id; intel_tensorflow_option = id;
} }
else if (versions.indexOf(id)>=0){ else if (inferences.includes(id)){
version=id; inference = id;
}
else if (releases.includes(id)){
release = id;
} }
refresh_cmd(); refresh_cmd();
}) })
@ -221,6 +168,6 @@ $(document).on({
$(this).css("color","var(--pst-color-text-base)"); $(this).css("color","var(--pst-color-text-base)");
} }
} }
}, "button"); }, ".install_option_button");
refresh_cmd(); refresh_cmd();

View file

@ -12,28 +12,27 @@ You can select bigdl-nano along with some dependencies specific to PyTorch or Te
<tbody> <tbody>
<tr> <tr>
<td colspan="1">FrameWork</td> <td colspan="1">FrameWork</td>
<td colspan="2"><button id="pytorch">Pytorch</button></td> <td colspan="2"><button id="pytorch" class="install_option_button">PyTorch</button></td>
<td colspan="2"><button id="tensorflow">Tensorflow</button></td> <td colspan="2"><button id="tensorflow" class="install_option_button">TensorFlow</button></td>
</tr> </tr>
<tr id="version" class="taller_tr"> <tr id="version">
<td colspan="1">Version</td> <td colspan="1">Version</td>
<td colspan="1"><button id="pytorch_113">1.13</button></td> <td colspan="1"><button id="pytorch_113" class="install_option_button">1.13</button></td>
<td colspan="1"><button id="pytorch_112">1.12</button></td> <td colspan="1"><button id="pytorch_112" class="install_option_button">1.12</button></td>
<td colspan="1"><button id="pytorch_111">1.11</button></td> <td colspan="1"><button id="pytorch_111" class="install_option_button">1.11</button></td>
<td colspan="1"><button id="pytorch_110">1.10</button></td> <td colspan="1"><button id="pytorch_110" class="install_option_button">1.10</button></td>
</tr> </tr>
<tr> <tr>
<td colspan="1">Inference Optimization</td> <td colspan="1">Inference Opt</td>
<td colspan="2"><button id="inferenceyes">Yes</button></td> <td colspan="2"><button id="inference_yes" class="install_option_button">Yes</button></td>
<td colspan="2"><button id="inferenceno">No</button></td> <td colspan="2"><button id="inference_no" class="install_option_button">No</button></td>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="1">Release</td> <td colspan="1">Release</td>
<td colspan="2"><button id="nightly">Nightly</button></td> <td colspan="2"><button id="nightly" class="install_option_button">Nightly</button></td>
<td colspan="2"><button id="stable">Stable</button></td> <td colspan="2"><button id="stable" class="install_option_button">Stable</button></td>
</tr> </tr>
<tr class="tallet_tr"> <tr>
<td colspan="1">Install CMD</td> <td colspan="1">Install CMD</td>
<td colspan="4" id="cmd">NA</td> <td colspan="4" id="cmd">NA</td>
</tr> </tr>