Nano: Update the Nano installation panel (#7015)

* update installation panel

* fix typo

* fix typo again

* fix typo

* experimental change

* fix typo

* fix known issues

* update

* update subsections

* update typo

* update according to comment

Co-authored-by: TheaperDeng <theaperdeng@outlook.com>
This commit is contained in:
liangs6212 2022-12-26 15:43:36 +08:00 committed by GitHub
parent 37b0c6fa50
commit da7b30529b
2 changed files with 88 additions and 30 deletions

View file

@ -1,6 +1,6 @@
var inferences=["inferenceyes", "inferenceno"]; var inferences=["inferenceyes", "inferenceno"];
var frameworks=["pytorch", "tensorflow"]; var frameworks=["pytorch", "tensorflow"];
var versions=["pytorch_110", "pytorch_111", "pytorch_112", "pytorch_113", "tf2_270"]; var versions=["pytorch_110", "pytorch_111", "pytorch_112", "pytorch_113", "tf2_27", "tf2_28", "tf2_29", "tf2_210"];
var releases=["stable", "nightly"]; var releases=["stable", "nightly"];
var inference="inferenceyes"; var inference="inferenceyes";
@ -29,7 +29,10 @@ function refresh_cmd(){
} }
else if(framework=="tensorflow"){ else if(framework=="tensorflow"){
$("#version").append("<td colspan='1'>Tensorflow Version</td>\ $("#version").append("<td colspan='1'>Tensorflow Version</td>\
<td colspan='4'><button id='tf2_270'>2.7</button></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); reset_color(versions);
set_color(version); set_color(version);
@ -43,20 +46,19 @@ function refresh_cmd(){
enable(inferences); enable(inferences);
} }
if (framework=="pytorch"){ // if (framework=="pytorch"){
document.getElementById("cmd").style.whiteSpace = "normal"; // document.getElementById("cmd").style.whiteSpace = "normal";
} // }
else{ // else{
document.getElementById('cmd').style.whiteSpace = "nowrap"; // document.getElementById('cmd').style.whiteSpace = "nowrap";
} // }
if(framework=="pytorch"){ if(framework=="pytorch"){
if(release=="stable"){ if(release=="stable"){
cmd="pip install bigdl-nano[pytorch]==2.1.0"; cmd="pip install bigdl-nano[pytorch]==2.1.0";
}else if(release=="nightly"){ }else if(release=="nightly"){
if(inference=="inferenceyes"){ if(inference=="inferenceyes"){
if(version=="pytorch_110"){ if(version=="pytorch_110"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch_110,inference]"; cmd="pip install --pre --upgrade bigdl-nano[pytorch_110,inference] -f https://software.intel.com/ipex-whl-stable";
}else if(version=="pytorch_111"){ }else if(version=="pytorch_111"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch_111,inference]"; cmd="pip install --pre --upgrade bigdl-nano[pytorch_111,inference]";
}else if(version=="pytorch_112"){ }else if(version=="pytorch_112"){
@ -66,7 +68,7 @@ function refresh_cmd(){
} }
}else if(inference="inferenceno"){ }else if(inference="inferenceno"){
if(version=="pytorch_110"){ if(version=="pytorch_110"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch_110]"; cmd="pip install --pre --upgrade bigdl-nano[pytorch_110] -f https://software.intel.com/ipex-whl-stable";
}else if(version=="pytorch_111"){ }else if(version=="pytorch_111"){
cmd="pip install --pre --upgrade bigdl-nano[pytorch_111]"; cmd="pip install --pre --upgrade bigdl-nano[pytorch_111]";
}else if(version=="pytorch_112"){ }else if(version=="pytorch_112"){
@ -78,20 +80,56 @@ function refresh_cmd(){
} }
}else if(framework="tensorflow"){ }else if(framework="tensorflow"){
if(inference=="inferenceyes"){ if(inference=="inferenceyes"){
if (version=="tf2_270"){ 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]==2.1.0";
}
}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]==2.1.0";
}
}else if(version=="tf2_29"){
if (release=="nightly"){ if (release=="nightly"){
cmd="pip install --pre --upgrade bigdl-nano[tensorflow,inference]"; cmd="pip install --pre --upgrade bigdl-nano[tensorflow,inference]";
}else if(release=="stable"){ }else if(release=="stable"){
cmd="pip install bigdl-nano[tensorflow]==2.1.0"; cmd="pip install bigdl-nano[tensorflow]==2.1.0";
} }
}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]==2.1.0";
}
} }
}else if(inference=="inferenceno"){ }else if(inference=="inferenceno"){
if(version=="tf2_270"){ 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]==2.1.0";
}
}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]==2.1.0";
}
}else if(version=="tf2_29"){
if(release=="nightly"){ if(release=="nightly"){
cmd="pip install --pre --upgrade bigdl-nano[tensorflow]"; cmd="pip install --pre --upgrade bigdl-nano[tensorflow]";
}else if(release=="stable"){ }else if(release=="stable"){
cmd="pip install bigdl-nano[tensorflow]==2.1.0"; cmd="pip install bigdl-nano[tensorflow]==2.1.0";
} }
}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]==2.1.0";
}
} }
} }
} }
@ -140,7 +178,7 @@ $(document).on('click',"button",function(){
if (frameworks.indexOf(id)>=0){ if (frameworks.indexOf(id)>=0){
framework=id; framework=id;
if (framework=="tensorflow"){ if (framework=="tensorflow"){
version="tf2_270"; version="tf2_29";
}else{ }else{
version="pytorch_112"; version="pytorch_112";
} }

View file

@ -1,10 +1,5 @@
# Nano Installation # Nano Installation
Note: For windows users, we recommend using Windows Subsystem for Linux 2 (WSL2) to run BigDL-Nano. Please refer to [Nano Windows install guide](../Howto/windows_guide.md) for instructions.
BigDL-Nano can be installed using pip and we recommend installing BigDL-Nano in a conda environment.
You can select bigdl-nano along with some dependencies specific to PyTorch or Tensorflow using the following panel. You can select bigdl-nano along with some dependencies specific to PyTorch or Tensorflow using the following panel.
```eval_rst ```eval_rst
@ -49,15 +44,6 @@ You can select bigdl-nano along with some dependencies specific to PyTorch or Te
<script src="../../../_static/js/nano_installation_guide.js"></script> <script src="../../../_static/js/nano_installation_guide.js"></script>
``` ```
We also partially support M-series chip users with no guarantee of acceleration with same API. Currently only tensorflow is experimentally supported.
```bash
conda create -n env python=3.8
conda activate env
conda install -c apple tensorflow-deps
pip install --pre --upgrade bigdl-nano[tensorflow]
```
```eval_rst ```eval_rst
.. note:: .. note::
Since bigdl-nano is still in the process of rapid iteration, we highly recommend that you install nightly build version through the above command to facilitate your use of the latest features. Since bigdl-nano is still in the process of rapid iteration, we highly recommend that you install nightly build version through the above command to facilitate your use of the latest features.
@ -65,11 +51,16 @@ pip install --pre --upgrade bigdl-nano[tensorflow]
For stable version, please refer to the document and installation guide `here <https://bigdl.readthedocs.io/en/v2.1.0/doc/Nano/Overview/nano.html>`_ . For stable version, please refer to the document and installation guide `here <https://bigdl.readthedocs.io/en/v2.1.0/doc/Nano/Overview/nano.html>`_ .
``` ```
## Environment Management
### Install in conda environment (Recommended)
```bash ```bash
conda create -n env conda create -n env
conda activate env conda activate env
# select your preference in above panel to find the proper command to replace the below command, e.g. # select your preference in above panel to find the proper command to replace the below command, e.g.
pip install --pre --upgrade bigdl-chronos[pytorch] pip install --pre --upgrade bigdl-nano[pytorch]
# after installing bigdl-nano, you can run the following command to setup a few environment variables. # after installing bigdl-nano, you can run the following command to setup a few environment variables.
source bigdl-nano-init source bigdl-nano-init
``` ```
@ -78,6 +69,35 @@ The `bigdl-nano-init` scripts will export a few environment variable according t
In a conda environment, when you run `source bigdl-nano-init` manually, this command will also be added to `$CONDA_PREFIX/etc/conda/activate.d/`, which will automaticly run when you activate your current environment. In a conda environment, when you run `source bigdl-nano-init` manually, this command will also be added to `$CONDA_PREFIX/etc/conda/activate.d/`, which will automaticly run when you activate your current environment.
### Install in pure pip environment
In a pure pip environment, you need to run `source bigdl-nano-init` every time you open a new shell to get optimal performance and run `source bigdl-nano-unset-env` if you want to unset these environment variables. In a pure pip environment, you need to run `source bigdl-nano-init` every time you open a new shell to get optimal performance and run `source bigdl-nano-unset-env` if you want to unset these environment variables.
--- ## Python Version
`bigdl-nano` is validated on Python 3.7.x.
## Operating System
Some specific note should be awared of when installing `bigdl-nano`.`
### Install on Linux
For Linux, Ubuntu (22.04/20.04/18.04) is recommended.
### Install on Windows
For Windows OS, users could only run `bigdl-nano-init` every time they open a new cmd terminal.
We recommend using Windows Subsystem for Linux 2 (WSL2) to run BigDL-Nano. Please refer to [Nano Windows install guide](../Howto/windows_guide.md) for instructions.
### Install on MacOS
#### MacOS with Intel Chip
Same usage as Linux, while some of the funcions now rely on lower version dependencies.
#### MacOS with M-series chip
Currently, only tensorflow is supported for M-series chip Mac.
```bash
# any way to install tensorflow on macos
pip install --pre --upgrade bigdl-nano[tensorflow]
```