Skip to content

Commit d13d446

Browse files
authored
update jupyterlab installation related info (#1289)
Co-authored-by: kai.yao@intel.com
1 parent fcb66f0 commit d13d446

File tree

6 files changed

+110
-131
lines changed

6 files changed

+110
-131
lines changed

neural_coder/extensions/README.md

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# neural_compressor_ext_lab
2+
3+
A JupyterLab extension.
4+
5+
## Requirements
6+
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
44+
```
45+
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.
47+
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+
```
54+
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).
56+
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:
58+
59+
```bash
60+
jupyter lab build --minimize=False
61+
```
62+
63+
### Development uninstall
64+
65+
```bash
66+
pip uninstall neural_compressor_ext_lab
67+
```
68+
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.
72+
73+
### Packaging the extension
74+
75+
See [RELEASE](RELEASE.md)
Lines changed: 25 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,37 @@
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.
24

3-
A JupyterLab extension.
5+
## Installation
6+
**By Extension Manager in JupyterLab**
47

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.
69

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
4413
```
4514

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!
4716

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.
5418

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%">
5620

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:
5823

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%">
6825

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:
7232

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:
7436

75-
See [RELEASE](RELEASE.md)
37+
<img src="../screenshots/5.png" alt="Architecture" width="55%" height="55%">

neural_coder/extensions/neural_compressor_ext_lab/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
"jupyterlab",
88
"jupyterlab-extension"
99
],
10-
"homepage": "https://github.com/Ymirsss/neural_compressor_ext_lab",
10+
"homepage": "https://github.com/intel/neural-compressor/tree/master/neural_coder/extensions/neural_compressor_ext_lab",
1111
"bugs": {
12-
"url": "https://github.com/Ymirsss/neural_compressor_ext_lab/issues"
12+
"url": "https://github.com/intel/neural-compressor/tree/master/neural_coder/extensions/neural_compressor_ext_lab"
1313
},
1414
"license": "BSD-3-Clause",
1515
"author": {
16-
"name": "neural_coder",
17-
"email": "rya.ashs@gmail.com"
16+
"name": "neural_compressor_ext_lab",
17+
"email": "inc.maintainers@intel.com"
1818
},
1919
"files": [
2020
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
@@ -25,7 +25,7 @@
2525
"style": "style/index.css",
2626
"repository": {
2727
"type": "git",
28-
"url": "https://github.com/Ymirsss/neural_compressor_ext_lab.git"
28+
"url": "https://github.com/intel/neural-compressor.git"
2929
},
3030
"scripts": {
3131
"build": "jlpm build:lib && jlpm build:labextension:dev",

neural_coder/extensions/neural_compressor_ext_lab_alibaba/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
"jupyterlab",
88
"jupyterlab-extension"
99
],
10-
"homepage": "https://github.com/intel-sandbox/neural-coder/tree/lab_ext_ts/neural_coder/extensions",
10+
"homepage": "https://github.com/intel/neural-compressor/tree/master/neural_coder/extensions/neural_compressor_ext_lab",
1111
"bugs": {
12-
"url": "https://github.com/intel-sandbox/neural-coder/tree/lab_ext_ts/neural_coder/extensions/issues"
12+
"url": "https://github.com/intel/neural-compressor/tree/master/neural_coder/extensions/neural_compressor_ext_lab"
1313
},
1414
"license": "BSD-3-Clause",
1515
"author": {
16-
"name": "Neural_Coder",
17-
"email": "rya.ashs@gmail.com"
16+
"name": "neural_compressor_ext_lab",
17+
"email": "inc.maintainers@intel.com"
1818
},
1919
"files": [
2020
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
@@ -25,7 +25,7 @@
2525
"style": "style/index.css",
2626
"repository": {
2727
"type": "git",
28-
"url": "https://github.com/intel-sandbox/neural-coder/tree/lab_ext_ts/neural_coder/extensions.git"
28+
"url": "https://github.com/intel/neural-compressor.git"
2929
},
3030
"scripts": {
3131
"build": "jlpm build:lib && jlpm build:labextension:dev",

0 commit comments

Comments
 (0)