You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Registering and deploying the model follows the same steps shown [here](https://pytorch.org/serve/use_cases.html).
108
109
109
-
## Benchmarking with Launcher
110
-
`intel_extension_for_pytorch.cpu.launch` launcher can be used with Torchserve official [benchmark](https://github.com/pytorch/serve/tree/master/benchmarks) to launch server and benchmark requests with optimal configuration on Intel hardware.
110
+
## Torchserve with Launcher
111
+
Launcher is a script to automate the process of tunining configuration setting on intel hardware to boost performance. Tuning configurations such as OMP_NUM_THREADS, thread affininty, memory allocator can have a dramatic effect on performance. Please refer to [here](https://github.com/intel/intel-extension-for-pytorch/blob/master/docs/tutorials/performance_tuning/tuning_guide.md) and [here](https://github.com/intel/intel-extension-for-pytorch/blob/master/docs/tutorials/performance_tuning/tuning_guide.md) for details on performance tuning with launcher.
112
+
113
+
All it needs to be done to use Torchserve with launcher is to set its configuration in `config.properties`.
111
114
112
-
In this section, we provde an example of using launcher to benchmark on a single socket and using all physical cores on that socket. This is to avoid thread oversupscription while using all resources.
113
115
114
-
### 1. Launcher configuration
115
-
All it needs to be done to use Torchserve with launcher is to set its configuration at `config.properties` in the benchmark directory. `ncore_per_instance` and other tunable configuration of launcher can be set as appropriately by checking the hardware configuration.
116
+
Add the following lines in `config.properties` to use launcher with its default configuration.
117
+
```
118
+
ipex_enable=true
119
+
cpu_launcher_enable=true
120
+
```
121
+
122
+
Launcher by default uses `numactl` if its installed to ensure socket is pinned and thus memory is allocated from local numa node. To use launcher without numactl, add the following lines in `config.properties`.
123
+
```
124
+
ipex_enable=true
125
+
cpu_launcher_enable=true
126
+
cpu_launcher_args=--disable_numactl
127
+
```
116
128
129
+
Launcher by default uses only non-hyperthreaded cores if hyperthreading is present to avoid core compute resource sharing. To use launcher with all cores, both physical and logical, add the following lines in `config.properties`.
130
+
```
131
+
ipex_enable=true
132
+
cpu_launcher_enable=true
133
+
cpu_launcher_args=--use_logical_core
134
+
```
117
135
Please refer to [here](https://github.com/intel/intel-extension-for-pytorch/blob/master/docs/tutorials/performance_tuning/launch_script.md) for a full list of tunable configuration of launcher.
118
136
119
-
Add the following lines to `config.properties` in the benchmark directory.
137
+
## Benchmarking with Launcher
138
+
Launcher can be used with Torchserve official [benchmark](https://github.com/pytorch/serve/tree/master/benchmarks) to launch server and benchmark requests with optimal configuration on Intel hardware.
139
+
140
+
In this section we provide examples of benchmarking with launcher with its default configuration.
141
+
142
+
Add the following lines to `config.properties` in the benchmark directory to use launcher with its default setting.
We recommend using launcher with single worker only.
156
+
```
157
+
$ cat logs/model_log.log
158
+
2021-12-01 21:22:40,096 - __main__ - WARNING - Both TCMalloc and JeMalloc are not found in $CONDA_PREFIX/lib or $VIRTUAL_ENV/lib or /.local/lib/ or /usr/local/lib/ or /usr/local/lib64/ or /usr/lib or /usr/lib64 or /home/<user>/.local/lib/ so the LD_PRELOAD environment variable will not be set. This may drop the performance
159
+
2021-12-01 21:22:40,096 - __main__ - INFO - OMP_NUM_THREADS=56
160
+
2021-12-01 21:22:40,096 - __main__ - INFO - Using Intel OpenMP
161
+
2021-12-01 21:22:40,096 - __main__ - INFO - KMP_AFFINITY=granularity=fine,compact,1,0
162
+
2021-12-01 21:22:40,096 - __main__ - INFO - KMP_BLOCKTIME=1
163
+
2021-12-01 21:22:40,096 - __main__ - INFO - LD_PRELOAD=<VIRTUAL_ENV>/lib/libiomp5.so
2021-12-02 06:15:03,981 - __main__ - WARNING - Both TCMalloc and JeMalloc are not found in $CONDA_PREFIX/lib or $VIRTUAL_ENV/lib or /.local/lib/ or /usr/local/lib/ or /usr/local/lib64/ or /usr/lib or /usr/lib64 or /home/<user>/.local/lib/ so the LD_PRELOAD environment variable will not be set. This may drop the performance
173
+
2021-12-02 06:15:03,981 - __main__ - INFO - OMP_NUM_THREADS=2
174
+
2021-12-02 06:15:03,982 - __main__ - INFO - Using Intel OpenMP
175
+
2021-12-02 06:15:03,982 - __main__ - INFO - KMP_AFFINITY=granularity=fine,compact,1,0
176
+
2021-12-02 06:15:03,982 - __main__ - INFO - KMP_BLOCKTIME=1
177
+
2021-12-02 06:15:03,982 - __main__ - INFO - LD_PRELOAD=<VIRTUAL_ENV>/lib/libiomp5.so
0 commit comments