Skip to content

Commit 08221e1

Browse files
authored
Update example notebooks for search with DyNAS-T (#1480)
Signed-off-by: Maciej Szankin <[email protected]>
1 parent 9600e1d commit 08221e1

4 files changed

+61
-24
lines changed

examples/notebook/dynas/BERT_SST2_Supernet_NAS.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"metadata": {},
4141
"outputs": [],
4242
"source": [
43-
"!pip -q install neural_compressor dynast==1.1.0"
43+
"!pip -q install neural_compressor dynast==1.5.2"
4444
]
4545
},
4646
{
@@ -59,7 +59,7 @@
5959
"# import sys\n",
6060
"# sys.path.insert(0,'<path to neural compressor>')\n",
6161
"# !pip install -qr <path to neural compressor>/requirements.txt\n",
62-
"# !pip install -q dynast==1.1.0"
62+
"# !pip install -q dynast==1.5.2"
6363
]
6464
},
6565
{
@@ -251,7 +251,7 @@
251251
"cm = plt.cm.get_cmap('viridis_r')\n",
252252
"count = [x for x in range(len(df_dynas))]\n",
253253
"\n",
254-
"ax.scatter(df_dynas['macs'].values, df_dynas['acc'].values, marker='^', alpha=0.8, c=count, \n",
254+
"ax.scatter(df_dynas['macs'].values, df_dynas['acc'].values, marker='^', alpha=0.8, c=count,\n",
255255
" cmap=cm, label='Discovered DNN Model', s=10)\n",
256256
"ax.set_title(f'Intel® Neural Compressor\\nDynamic NAS (DyNAS)\\nSupernet:{config.dynas.supernet}')\n",
257257
"ax.set_xlabel('MACs', fontsize=13)\n",

examples/notebook/dynas/MobileNetV3_Supernet_Distributed_NAS.ipynb

+51-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,55 @@
1717
"## Prerequisites"
1818
]
1919
},
20+
{
21+
"cell_type": "markdown",
22+
"metadata": {},
23+
"source": [
24+
"### Install Intel® MPI or OpenMPI\n",
25+
"\n",
26+
"#### Intel® MPI\n",
27+
"\n",
28+
"Please refer to [Intel® MPI Library](https://www.intel.com/content/www/us/en/developer/tools/oneapi/mpi-library.html#gs.1t0vm0) for detailed steps on how to install Intel® MPI.\n",
29+
"\n",
30+
"#### OpenMPI\n",
31+
"\n",
32+
"1. You can download OpenMPI from https://www.open-mpi.org/ or use this link to directly download version 4.1.5:\n",
33+
"\n",
34+
" ```bash\n",
35+
" wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz\n",
36+
" ```\n",
37+
"\n",
38+
"1. Unpack OpenMPI source code and go to source directory:\n",
39+
"\n",
40+
" ```bash\n",
41+
" tar -xzf openmpi-4.1.5.tar.gz\n",
42+
" cd openmpi-4.1.5\n",
43+
" ```\n",
44+
"\n",
45+
"1. Configure, compile and install by executing the following command (change directory if needed):\n",
46+
"\n",
47+
" ```bash\n",
48+
" ./configure --prefix=/opt/openmpi\n",
49+
" make -j $(($(nproc)/2)) all\n",
50+
" make install\n",
51+
" ```\n",
52+
"\n",
53+
"1. To use OpenMPI you will have to change your PATH and LD_LIBRARY_PATH environment variables (change directory if needed):\n",
54+
"\n",
55+
" ```bash\n",
56+
" echo \"export PATH=$PATH:/opt/openmpi/bin\" >> $HOME/.bashrc\n",
57+
" echo \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/openmpi/lib\" >> $HOME/.bashrc\n",
58+
" ```\n",
59+
"\n",
60+
"1. Cleanup\n",
61+
"\n",
62+
" ```bash\n",
63+
" cd ../\n",
64+
" rm openmpi-4.1.5.tar.gz\n",
65+
" rm -Rf openmpi-4.1.5\n",
66+
" ```"
67+
]
68+
},
2069
{
2170
"cell_type": "code",
2271
"execution_count": null,
@@ -91,7 +140,7 @@
91140
],
92141
"metadata": {
93142
"kernelspec": {
94-
"display_name": "dynast_inc_pip_test",
143+
"display_name": "Python 3 (ipykernel)",
95144
"language": "python",
96145
"name": "python3"
97146
},
@@ -105,7 +154,7 @@
105154
"name": "python",
106155
"nbconvert_exporter": "python",
107156
"pygments_lexer": "ipython3",
108-
"version": "3.9.16"
157+
"version": "3.10.13"
109158
},
110159
"vscode": {
111160
"interpreter": {

examples/notebook/dynas/MobileNetV3_Supernet_NAS.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"metadata": {},
3939
"outputs": [],
4040
"source": [
41-
"!pip -q install neural_compressor dynast==1.1.0"
41+
"!pip -q install neural_compressor dynast==1.5.2 gdown"
4242
]
4343
},
4444
{
@@ -57,7 +57,7 @@
5757
"# import sys\n",
5858
"# sys.path.insert(0,'<path to neural compressor>')\n",
5959
"# !pip install -qr <path to neural compressor>/requirements.txt\n",
60-
"# !pip install -q dynast==1.1.0"
60+
"# !pip install -q dynast==1.5.2 gdown"
6161
]
6262
},
6363
{
@@ -245,7 +245,7 @@
245245
"cm = plt.cm.get_cmap('viridis_r')\n",
246246
"count = [x for x in range(len(df_dynas))]\n",
247247
"\n",
248-
"ax.scatter(df_dynas['macs'].values, df_dynas['top1'].values, marker='^', alpha=0.8, c=count, \n",
248+
"ax.scatter(df_dynas['macs'].values, df_dynas['top1'].values, marker='^', alpha=0.8, c=count,\n",
249249
" cmap=cm, label='Discovered DNN Model', s=10)\n",
250250
"ax.set_title(f'Intel® Neural Compressor\\nDynamic NAS (DyNAS)\\nSupernet:{config.dynas.supernet}')\n",
251251
"ax.set_xlabel('MACs', fontsize=13)\n",

examples/notebook/dynas/ResNet50_Quantiation_Search_Supernet_NAS.ipynb

+4-16
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"metadata": {},
3939
"outputs": [],
4040
"source": [
41-
"!pip -q install neural_compressor dynast==1.5.1"
41+
"!pip -q install neural_compressor dynast==1.5.2"
4242
]
4343
},
4444
{
@@ -57,7 +57,7 @@
5757
"# import sys\n",
5858
"# sys.path.insert(0,'<path to neural compressor>')\n",
5959
"# !pip install -qr <path to neural compressor>/requirements.txt\n",
60-
"# !pip install -q dynast==1.5.1"
60+
"# !pip install -q dynast==1.5.2"
6161
]
6262
},
6363
{
@@ -247,7 +247,7 @@
247247
"cm = plt.cm.get_cmap('viridis_r')\n",
248248
"count = [x for x in range(len(df_dynas))]\n",
249249
"\n",
250-
"ax.scatter(df_dynas['lat'].values, df_dynas['top1'].values, marker='^', alpha=0.8, c=count, \n",
250+
"ax.scatter(df_dynas['lat'].values, df_dynas['top1'].values, marker='^', alpha=0.8, c=count,\n",
251251
" cmap=cm, label='Discovered DNN Model', s=10)\n",
252252
"ax.set_title(f'Intel® Neural Compressor\\nDynamic NAS (DyNAS)\\nSupernet:{config.dynas.supernet}')\n",
253253
"ax.set_xlabel('Latency (normalized)', fontsize=13)\n",
@@ -289,22 +289,10 @@
289289
],
290290
"metadata": {
291291
"kernelspec": {
292-
"display_name": "dynast_inc_pip_test",
292+
"display_name": "Python 3 (ipykernel)",
293293
"language": "python",
294294
"name": "python3"
295295
},
296-
"language_info": {
297-
"codemirror_mode": {
298-
"name": "ipython",
299-
"version": 3
300-
},
301-
"file_extension": ".py",
302-
"mimetype": "text/x-python",
303-
"name": "python",
304-
"nbconvert_exporter": "python",
305-
"pygments_lexer": "ipython3",
306-
"version": "3.10.12"
307-
},
308296
"vscode": {
309297
"interpreter": {
310298
"hash": "034f8a08a724a63543abaa4596714d81bf71b36e8b4dd0d5bf824a9fea1bc071"

0 commit comments

Comments
 (0)