Skip to content

Commit

Permalink
update to use aihwkit wheel 0.9.1 (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkvtran authored May 19, 2024
1 parent 69c09db commit 69e524f
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 42 deletions.
8 changes: 4 additions & 4 deletions notebooks/LeNet5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
"# !pip install aihwkit\n",
"\n",
"# To install the gpu enabled wheel, use the commands below\n",
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
]
},
{
Expand Down Expand Up @@ -568,7 +568,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.10.14"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down Expand Up @@ -1944,5 +1944,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
6 changes: 3 additions & 3 deletions notebooks/analog_fusion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"#if torch.cuda.is_available():\n",
"if return_code == 0:\n",
" DEVICE = 'cuda'\n",
" !wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -P data\n",
" !pip install data/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
" !wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -P data\n",
" !pip install data/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
" USE_CUDA = 1\n",
"else:\n",
" DEVICE = 'cpu'\n",
Expand Down Expand Up @@ -666,7 +666,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.0"
"version": "3.10.14"
}
},
"nbformat": 4,
Expand Down
7 changes: 3 additions & 4 deletions notebooks/analog_sensitivity_LeNet5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"# !pip install aihwkit\n",
"\n",
"# To install the gpu enabled wheel, use the commands below\n",
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
]
},
{
Expand Down Expand Up @@ -500,7 +500,6 @@
"execution_count": null,
"id": "adeab806",
"metadata": {
"scrolled": false,
"slideshow": {
"slide_type": "fragment"
}
Expand Down Expand Up @@ -949,7 +948,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.10.14"
},
"rise": {
"scroll": true,
Expand Down
8 changes: 4 additions & 4 deletions notebooks/analog_training_LeNet5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"#pip install aihwkit\n",
"\n",
"# To install the gpu enabled wheel, use the commands below\n",
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
]
},
{
Expand Down Expand Up @@ -617,9 +617,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.10.14"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
8 changes: 4 additions & 4 deletions notebooks/analog_training_LeNet5_TT.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"#pip install aihwkit\n",
"\n",
"# To install the gpu enabled wheel, use the commands below\n",
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
]
},
{
Expand Down Expand Up @@ -428,9 +428,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.10.14"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
8 changes: 4 additions & 4 deletions notebooks/analog_training_LeNet5_hwa.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"#pip install aihwkit\n",
"\n",
"# To install the gpu enabled wheel, use the commands below\n",
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
]
},
{
Expand Down Expand Up @@ -494,9 +494,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.10.14"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
8 changes: 4 additions & 4 deletions notebooks/analog_training_LeNet5_plot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"#!pip install aihwkit\n",
"\n",
"# To install the gpu enabled wheel, use the commands below\n",
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n"
"#!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \n",
"#!pip install aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n"
]
},
{
Expand Down Expand Up @@ -672,9 +672,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.10.14"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
13 changes: 10 additions & 3 deletions notebooks/tutorial/analog_training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
"#!pip install aihwkit\n",
"\n",
"# To install the GPU-enabled wheel, use the commands below.\n",
"!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
"!pip install aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n"
"!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
"!pip install aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n"
]
},
{
Expand Down Expand Up @@ -1073,6 +1073,13 @@
"fit_model(trainer, model)\n",
"plot_loss(trainer, \"Partial in-memory update using mixed precision.\");"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -1097,7 +1104,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.10.14"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down
6 changes: 3 additions & 3 deletions notebooks/tutorial/extending_functionality.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"#!pip install aihwkit\n",
"\n",
"# To install the GPU-enabled wheel, un-comment the commands below.\n",
"!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
"!pip install aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
"!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
"!pip install aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
"\n",
"# Install some prerequisites\n",
"!pip install pytorch-lightning\n",
Expand Down Expand Up @@ -707,7 +707,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.10.14"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down
12 changes: 6 additions & 6 deletions notebooks/tutorial/hw_aware_training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"#!pip install aihwkit\n",
"\n",
"# To install the GPU-enabled wheel, use the commands below.\n",
"!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
"!pip install aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
"!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
"!pip install aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
]
},
{
Expand Down Expand Up @@ -599,15 +599,15 @@
" test_accs[epoch] = test_step(analog_model, criterion, testloader)\n",
" scheduler.step()\n",
"\n",
" torch.save(analog_model.state_dict(), \"Models/finetuned_model.th\")\n",
" torch.save(analog_model.state_dict(), \"Models/finetuned_model_0.9.1.th\")\n",
" torch.save(test_accs, \"Models/test_accs.th\")\n",
"\n",
"else:\n",
" !wget -P Models/ https://aihwkit-tutorial.s3.us-east.cloud-object-storage.appdomain.cloud/test_accs.th\n",
" !wget -P Models/ https://aihwkit-tutorial.s3.us-east.cloud-object-storage.appdomain.cloud/finetuned_model.th\n",
" !wget -P Models/ https://aihwkit-tutorial.s3.us-east.cloud-object-storage.appdomain.cloud/finetuned_model_0.9.1.th\n",
" test_accs = torch.load(\"Models/test_accs.th\")\n",
" analog_model.load_state_dict(\n",
" torch.load(\"Models/finetuned_model.th\", map_location=device)\n",
" torch.load(\"Models/finetuned_model_0.9.1.th\", map_location=device)\n",
" )\n",
" print(f\"Finetuned test acc. {test_step(analog_model, criterion, testloader)}%\")"
]
Expand Down Expand Up @@ -817,7 +817,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.10.14"
},
"vscode": {
"interpreter": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"#!pip install aihwkit\n",
"\n",
"# To install the GPU-enabled wheel, use the commands below.\n",
"!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
"!pip install aihwkit-0.9.0+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n"
"!wget https://aihwkit-gpu-demo.s3.us-east.cloud-object-storage.appdomain.cloud/aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n",
"!pip install aihwkit-0.9.1+cuda117-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n"
]
},
{
Expand Down Expand Up @@ -646,7 +646,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.10.14"
},
"vscode": {
"interpreter": {
Expand Down

0 comments on commit 69e524f

Please sign in to comment.