forked from intel/neural-compressor
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NeuralCoder JupyterLab extension update (intel#1281)
* nc * add copyright * fix spelling * restore Co-authored-by: mengfeil <[email protected]>
- Loading branch information
Showing
135 changed files
with
34,781 additions
and
32,853 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright (c) 2022 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
transformation: | ||
location: | ||
- insert_below_model_definition_line | ||
content: | ||
- |- | ||
[+] from neural_compressor.experimental import Quantization, common | ||
[+] from neural_compressor import options, conf | ||
[+] conf.model.framework = 'onnxrt_qlinearops' | ||
[+] conf.quantization.approach = 'post_training_static_quant' | ||
[+] quantizer = Quantization(conf) | ||
[+] quantizer.model = common.Model(MODEL_NAME) | ||
[+] quantizer.calib_dataloader = DATALOADER_NAME | ||
[+] quantizer.eval_func = EVAL_FUNCTION_NAME | ||
[+] MODEL_NAME = quantizer() | ||
order: | ||
- below: | ||
above: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
## Intel CPU Platforms: Best Performance Setting | ||
### Install MKL, OpenMP and JEMALLOC | ||
Through CONDA is the simplest way: | ||
```python | ||
conda install -y mkl mkl-include jemalloc | ||
``` | ||
|
||
### Environment Variables | ||
Check if your ```CONDA_PREFIX``` has a value by: | ||
``` | ||
echo ${CONDA_PREFIX} | ||
``` | ||
If it's empty, it means that you're not in a traditional CONDA environment, you need to find the location of the ```.so.``` files by: | ||
``` | ||
find / -name "libjemalloc.so" | ||
find / -name "libiomp5.so" | ||
``` | ||
It will show the path these file were installed into, for example: | ||
``` | ||
/home/name/lib/libjemalloc.so | ||
/home/name/lib/libiomp5.so | ||
``` | ||
And then you should export this path as ```CONDA_PREFIX```: | ||
``` | ||
export CONDA_PREFIX="/home/name" | ||
``` | ||
Finally: | ||
```bash | ||
export LD_PRELOAD=${LD_PRELOAD}:${CONDA_PREFIX}/lib/libjemalloc.so | ||
export LD_PRELOAD=${LD_PRELOAD}:${CONDA_PREFIX}/lib/libiomp5.so | ||
export MALLOC_CONF="oversize_threshold:1,background_thread:true,metadata_thp:auto,dirty_decay_ms:9000000000,muzzy_decay_ms:9000000000" | ||
export KMP_AFFINITY="granularity=fine,compact,1,0" | ||
export KMP_BLOCKTIME=1 | ||
export DNNL_PRIMITIVE_CACHE_CAPACITY=1024 | ||
``` | ||
|
||
### Frequency Governers | ||
Check frequency governer state on your machine: | ||
```bash | ||
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | ||
``` | ||
If is shows ```powersave``` instead of ```performance```, execute: | ||
``` | ||
echo "performance" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | ||
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | ||
``` |
Oops, something went wrong.