Skip to content

Commit 5259d19

Browse files
bdmoore1JoeOster
andauthored
LPOT get started update for Devcloud node and mode (oneapi-src#520)
* LPOT get started update for Devcloud node and mode * Update README.md * Update README.md * Update README.md * fixed (R) and table alignment Co-authored-by: JoeOster <[email protected]>
1 parent e7e0fae commit 5259d19

File tree

1 file changed

+36
-23
lines changed
  • AI-and-Analytics/Getting-Started-Samples/LPOT-Sample-for-Tensorflow

1 file changed

+36
-23
lines changed

AI-and-Analytics/Getting-Started-Samples/LPOT-Sample-for-Tensorflow/README.md

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# `Intel(R) Low Precision Optimization Tool (LPOT)` Sample for Tensorflow
1+
# `Intel&reg; Low Precision Optimization Tool (LPOT)` Sample for TensorFlow*
22

33
## Background
4-
Low-precision inference can speed up inference obviously, by converting the fp32 model to int8 or bf16 model. Intel provides Intel(R) Deep Learning Boost technology in the Second Generation Intel(R) Xeon(R) Scalable Processors and newer Xeon(R), which supports to speed up int8 and bf16 model by hardware.
4+
Low-precision inference can speed up inference obviously, by converting the fp32 model to int8 or bf16 model. Intel provides Intel&reg; Deep Learning Boost technology in the Second Generation Intel&reg; Xeon&reg; Scalable Processors and newer Xeon&reg;, which supports to speed up int8 and bf16 model by hardware.
55

6-
Intel(R) Low Precision Optimization Tool (LPOT) helps the user to simplify the processing to convert the fp32 model to int8/bf16.
6+
Intel&reg; Low Precision Optimization Tool (LPOT) helps the user to simplify the processing to convert the fp32 model to int8/bf16.
77

88
At the same time, LPOT will tune the quanization method to reduce the accuracy loss, which is a big blocker for low-precision inference.
99

10-
LPOT is released in Intel(R) AI Analytics Toolkit and works with Intel(R) Optimization of Tensorflow*.
10+
LPOT is released in Intel&reg; AI Analytics Toolkit and works with Intel&reg; Optimization of TensorFlow*.
1111

1212
Please refer to the official website for detailed info and news: [https://github.com/intel/lp-opt-tool](https://github.com/intel/lp-opt-tool)
1313

@@ -21,20 +21,20 @@ Third party program Licenses can be found here: [third-party-programs.txt](https
2121
## Purpose
2222
This sample will show a whole process to build up a CNN model to recognize handwriting number and speed up it by LPOT.
2323

24-
We will learn how to train a CNN model based on Keras with Tensorflow, use LPOT to quantize the model and compare the performance to understand the benefit of LPOT.
24+
We will learn how to train a CNN model based on Keras with TensorFlow, use LPOT to quantize the model and compare the performance to understand the benefit of LPOT.
2525

2626
## Key Implementation Details
2727

28-
- Use Keras on Tensorflow to build and train the CNN model.
28+
- Use Keras on TensorFlow to build and train the CNN model.
2929

3030

3131
- Define function and class for LPOT to quantize the CNN model.
3232

33-
The LPOT can run on any Intel(R) CPU to quantize the AI model.
33+
The LPOT can run on any Intel&reg; CPU to quantize the AI model.
3434

3535
The quantized AI model has better inference performance than the FP32 model on Intel CPU.
3636

37-
Specifically, it could be speeded up by the Second Generation Intel(R) Xeon(R) Scalable Processors and newer Xeon(R).
37+
Specifically, it could be speeded up by the Second Generation Intel&reg; Xeon&reg; Scalable Processors and newer Xeon&reg;.
3838

3939

4040
- Test the performance of the FP32 model and INT8 (quantization) model.
@@ -45,22 +45,35 @@ We will learn how to train a CNN model based on Keras with Tensorflow, use LPOT
4545
| Optimized for | Description
4646
|:--- |:---
4747
| OS | Linux* Ubuntu* 18.04
48-
| Hardware | The Second Generation Intel(R) Xeon(R) Scalable processor family or newer
49-
| Software | Intel(R) oneAPI AI Analytics Toolkit 2021.1 or newer
50-
| What you will learn | How to use LPOT tool to quantize the AI model based on Tensorflow and speed up the inference on Intel(R) Xeon(R) CPU
48+
| Hardware | The Second Generation Intel&reg; Xeon&reg; Scalable processor family or newer
49+
| Software | Intel&reg; oneAPI AI Analytics Toolkit 2021.1 or newer
50+
| What you will learn | How to use LPOT tool to quantize the AI model based on TensorFlow and speed up the inference on Intel&reg; Xeon&reg; CPU
5151
| Time to complete | 10 minutes
5252

5353
## Running Environment
5454

55-
### Running in Devcloud
55+
### Running Samples In DevCloud (Optional)
5656

57-
If running a sample in the Intel DevCloud, please follow the below steps to build the python environment. Also, remember that you must specify the compute node (CPU) as well as whether to run in batch or interactive mode. For more information, see the [Intel(R) oneAPI AI Analytics Toolkit Get Started Guide](https://devcloud.intel.com/oneapi/get-started/analytics-toolkit/)
57+
### Run in Interactive Mode
58+
This sample runs in a Jupyter notebook. See [Running the Sample](#running-the-sample).
59+
60+
### Request a Compute Node
61+
In order to run on the DevCloud, you need to request a compute node using node properties such as: `gpu`, `xeon`, `fpga_compile`, `fpga_runtime` and others. For more information about the node properties, execute the `pbsnodes` command.
62+
This node information must be provided when submitting a job to run your sample in batch mode using the qsub command. When you see the qsub command in the Run section of the [Hello World instructions](https://devcloud.intel.com/oneapi/get_started/aiAnalyticsToolkitSamples/), change the command to fit the node you are using. Nodes which are in bold indicate they are compatible with this sample:
63+
64+
<!---Mark each compatible Node in BOLD-->
65+
| Node | Command |
66+
| ----------------- | ------------------------------------------------------- |
67+
| GPU | qsub -l nodes=1:gpu:ppn=2 -d . hello-world.sh |
68+
| __CPU__ | __qsub -l nodes=1:xeon:ppn=2 -d . hello-world.sh__ |
69+
| FPGA Compile Time | qsub -l nodes=1:fpga\_compile:ppn=2 -d . hello-world.sh |
70+
| FPGA Runtime | qsub -l nodes=1:fpga\_runtime:ppn=2 -d . hello-world.sh |
5871

5972
### Running in Local Server
6073

6174
Please make sure the local server is installed with Ubuntu 18.04 and the following software as below guide.
6275

63-
For hardware, it's recommended to choose the Second Generation Intel(R) Xeon(R) Scalable Processors and newer Xeon(R). It will speed up the quantized model significantly.
76+
For hardware, it's recommended to choose the Second Generation Intel&reg; Xeon&reg; Scalable Processors and newer Xeon&reg; processors. It will speed up the quantized model significantly.
6477

6578
## Prepare Software Environment
6679

@@ -69,15 +82,15 @@ For hardware, it's recommended to choose the Second Generation Intel(R) Xeon(R)
6982

7083
For the devcloud user, it is already installed. Please skip it.
7184

72-
Please install Intel(R) AI Analytics Toolkit by referring to [Intel(R) AI Analytics Toolkit Powered by oneAPI](
85+
Please install Intel&reg; AI Analytics Toolkit by referring to [Intel&reg; AI Analytics Toolkit Powered by oneAPI](
7386
https://software.intel.com/content/www/us/en/develop/articles/installation-guide-for-intel-oneapi-toolkits.html).
7487

7588

76-
Intel(R) Optimization of Tensorflow* are included in Intel(R) AI Analytics Toolkit. So, no need to install them separately.
89+
Intel&reg; Optimization of TensorFlow* are included in Intel&reg; AI Analytics Toolkit. So, no need to install them separately.
7790

78-
This sample depends on **Tensorflow* 2.2** or newer.
91+
This sample depends on **TensorFlow* 2.2** or newer.
7992

80-
### Activate Intel(R) AI Analytics Toolkit
93+
### Activate Intel&reg; AI Analytics Toolkit
8194

8295
Please change the oneAPI installed path in the following cmd, according to your installation.
8396

@@ -89,7 +102,7 @@ In this case, we use "/opt/intel/oneapi" as exapmle.
89102
source /opt/intel/oneapi/setvars.sh
90103
```
91104

92-
- Activate Conda Env. of Intel(R) Optimization of Tensorflow*
105+
- Activate Conda Env. of Intel&reg; Optimization of TensorFlow*
93106

94107
1. Show Conda Env.
95108

@@ -106,7 +119,7 @@ tensorflow-2.3.0 /opt/intel/oneapi/intelpython/latest/envs/tensorflow-2.
106119
/opt/intel/oneapi/tensorflow/2.3.0
107120
```
108121

109-
2. Activate Tensorflow Env.
122+
2. Activate TensorFlow Env.
110123

111124
```
112125
conda activate tensorflow
@@ -132,7 +145,7 @@ python -m pip install notebook
132145
python -m pip install matplotlib
133146
```
134147

135-
## Running the Sample
148+
## Running the Sample <a name="running-the-sample"></a>
136149

137150
### Startup Jupyter Notebook
138151

@@ -165,8 +178,8 @@ conda activate /opt/intel/oneapi/intelpython/latest/envs/tensorflow
165178

166179
### Open Sample Code File
167180

168-
In a web browser, open link: **http://yyy:8888/?token=146761d9317552c43e0d6b8b6b9e1108053d465f6ca32fca**. Click 'lpot_sample_tensorflow.ipynb' to start up the sample.
181+
In a web browser, open link: **http://yyy:8888/?token=146761d9317552c43e0d6b8b6b9e1108053d465f6ca32fca**. Click 'lpot_sample_TensorFlow.ipynb' to start up the sample.
169182

170183
### Run
171184

172-
Next, all of pratice of the sample is running in Jupyter Notebook.
185+
Next, all of practice of the sample is running in Jupyter Notebook.

0 commit comments

Comments
 (0)