|
1 |
| -# neural_compressor_ext_lab |
| 1 | +Intel® Neural Compressor as JupyterLab Extension |
| 2 | +=========================== |
| 3 | +A JupyterLab Extension library supporting Neural Coder, a novel feature powered by Intel® Neural Compressor providing automatic quantization to further simplify computing performance optimizations of Deep Learning models. |
2 | 4 |
|
3 |
| -A JupyterLab extension. |
| 5 | +## Installation |
| 6 | +**By Extension Manager in JupyterLab** |
4 | 7 |
|
5 |
| -## Requirements |
| 8 | +Search for ```jupyter-lab-neural-compressor``` in the Extension Manager in JupyterLab. Note that this works for the stable version of JupyterLab 3. |
6 | 9 |
|
7 |
| -- JupyterLab >= 3.0 |
8 |
| - |
9 |
| -## Install |
10 |
| - |
11 |
| -To install the extension, execute: |
12 |
| - |
13 |
| -```bash |
14 |
| -pip install neural_compressor_ext_lab |
15 |
| -``` |
16 |
| - |
17 |
| -## Uninstall |
18 |
| - |
19 |
| -To remove the extension, execute: |
20 |
| - |
21 |
| -```bash |
22 |
| -pip uninstall neural_compressor_ext_lab |
23 |
| -``` |
24 |
| - |
25 |
| -## Contributing |
26 |
| - |
27 |
| -### Development install |
28 |
| - |
29 |
| -Note: You will need NodeJS to build the extension package. |
30 |
| - |
31 |
| -The `jlpm` command is JupyterLab's pinned version of |
32 |
| -[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use |
33 |
| -`yarn` or `npm` in lieu of `jlpm` below. |
34 |
| - |
35 |
| -```bash |
36 |
| -# Clone the repo to your local environment |
37 |
| -# Change directory to the neural_compressor_ext_lab directory |
38 |
| -# Install package in development mode |
39 |
| -pip install -e . |
40 |
| -# Link your development version of the extension with JupyterLab |
41 |
| -jupyter labextension develop . --overwrite |
42 |
| -# Rebuild extension Typescript source after making changes |
43 |
| -jlpm build |
| 10 | +**By Linux Terminal** |
| 11 | +```Shell |
| 12 | +jupyter labextension install jupyter-lab-neural-compressor |
44 | 13 | ```
|
45 | 14 |
|
46 |
| -You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension. |
| 15 | +## Getting Started! |
47 | 16 |
|
48 |
| -```bash |
49 |
| -# Watch the source directory in one terminal, automatically rebuilding when needed |
50 |
| -jlpm watch |
51 |
| -# Run JupyterLab in another terminal |
52 |
| -jupyter lab |
53 |
| -``` |
| 17 | +As shown in the drop-down list, the supported features include "INT8 (Static Quantization)", "INT8 (Dynamic Quantization)", "BF16", and "Auto Enable & Benchmark". Each of the first three options enables a specific quantization feature into your Deep Learning scripts. The last option automatically enables all quantization features on a Deep Learning script and automatically evaluates the best performance on the model. It is a code-free solution that can help users enable quantization algorithms on a Deep Learning model with no manual coding needed. |
54 | 18 |
|
55 |
| -With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt). |
| 19 | +<img src="../screenshots/1.png" alt="Architecture" width="75%" height="75%"> |
56 | 20 |
|
57 |
| -By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command: |
| 21 | +### Auto-enable a feature |
| 22 | +Click the run button on the left side of the drop-down list to start. After finishing, you can see the code changes for the specific optimization enabling as shown in the figure below: |
58 | 23 |
|
59 |
| -```bash |
60 |
| -jupyter lab build --minimize=False |
61 |
| -``` |
62 |
| - |
63 |
| -### Development uninstall |
64 |
| - |
65 |
| -```bash |
66 |
| -pip uninstall neural_compressor_ext_lab |
67 |
| -``` |
| 24 | +<img src="../screenshots/2.png" alt="Architecture" width="75%" height="75%"> |
68 | 25 |
|
69 |
| -In development mode, you will also need to remove the symlink created by `jupyter labextension develop` |
70 |
| -command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions` |
71 |
| -folder is located. Then you can remove the symlink named `neural_compressor_ext_lab` within that folder. |
| 26 | +### Or let us help you auto-select the best feature |
| 27 | +The last option automatically enables each quantization feature on your Deep Learning script and automatically evaluates for the best performance among all features on your Deep Learning model. Since it will automatically run the Python script for benchmark, it requires you to enter additional parameters needed to run your Python script. If there is no additional parameter needed, you can just leave it blank: |
| 28 | + |
| 29 | +<img src="../screenshots/3.png" alt="Architecture" width="35%" height="35%"> |
| 30 | + |
| 31 | +In the new cell box appeared below your Code cell boxes, you can see the execution progress, and at the end you can see which one turns out to be the best optimization and how much performance gain can it bring to your Deep Learning model: |
72 | 32 |
|
73 |
| -### Packaging the extension |
| 33 | +<img src="../screenshots/4.png" alt="Architecture" width="55%" height="55%"> |
| 34 | + |
| 35 | +When it is finished, you can also see that the code changes for the best optimization are automatically enabled into your script: |
74 | 36 |
|
75 |
| -See [RELEASE](RELEASE.md) |
| 37 | +<img src="../screenshots/5.png" alt="Architecture" width="55%" height="55%"> |
0 commit comments