From 69e524fbc2c5462cbe1a12ee1662879c001c30c0 Mon Sep 17 00:00:00 2001 From: kkvtran Date: Sun, 19 May 2024 12:26:32 -0500 Subject: [PATCH] update to use aihwkit wheel 0.9.1 (#658) --- notebooks/LeNet5.ipynb | 8 ++++---- notebooks/analog_fusion.ipynb | 6 +++--- notebooks/analog_sensitivity_LeNet5.ipynb | 7 +++---- notebooks/analog_training_LeNet5.ipynb | 8 ++++---- notebooks/analog_training_LeNet5_TT.ipynb | 8 ++++---- notebooks/analog_training_LeNet5_hwa.ipynb | 8 ++++---- notebooks/analog_training_LeNet5_plot.ipynb | 8 ++++---- notebooks/tutorial/analog_training.ipynb | 13 ++++++++++--- notebooks/tutorial/extending_functionality.ipynb | 6 +++--- notebooks/tutorial/hw_aware_training.ipynb | 12 ++++++------ .../post_training_input_range_calibration.ipynb | 6 +++--- 11 files changed, 48 insertions(+), 42 deletions(-) diff --git a/notebooks/LeNet5.ipynb b/notebooks/LeNet5.ipynb index 0348d956..18e1a75f 100644 --- a/notebooks/LeNet5.ipynb +++ b/notebooks/LeNet5.ipynb @@ -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" ] }, { @@ -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": { @@ -1944,5 +1944,5 @@ } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 } diff --git a/notebooks/analog_fusion.ipynb b/notebooks/analog_fusion.ipynb index db17b5f1..08ffd7be 100644 --- a/notebooks/analog_fusion.ipynb +++ b/notebooks/analog_fusion.ipynb @@ -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", @@ -666,7 +666,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.0" + "version": "3.10.14" } }, "nbformat": 4, diff --git a/notebooks/analog_sensitivity_LeNet5.ipynb b/notebooks/analog_sensitivity_LeNet5.ipynb index 5d2acac5..0332bc8e 100644 --- a/notebooks/analog_sensitivity_LeNet5.ipynb +++ b/notebooks/analog_sensitivity_LeNet5.ipynb @@ -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" ] }, { @@ -500,7 +500,6 @@ "execution_count": null, "id": "adeab806", "metadata": { - "scrolled": false, "slideshow": { "slide_type": "fragment" } @@ -949,7 +948,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.10.14" }, "rise": { "scroll": true, diff --git a/notebooks/analog_training_LeNet5.ipynb b/notebooks/analog_training_LeNet5.ipynb index 953a2029..c77ec122 100644 --- a/notebooks/analog_training_LeNet5.ipynb +++ b/notebooks/analog_training_LeNet5.ipynb @@ -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" ] }, { @@ -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 } diff --git a/notebooks/analog_training_LeNet5_TT.ipynb b/notebooks/analog_training_LeNet5_TT.ipynb index 1613210e..3aa67ce3 100644 --- a/notebooks/analog_training_LeNet5_TT.ipynb +++ b/notebooks/analog_training_LeNet5_TT.ipynb @@ -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" ] }, { @@ -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 } diff --git a/notebooks/analog_training_LeNet5_hwa.ipynb b/notebooks/analog_training_LeNet5_hwa.ipynb index 7a3a486e..12cc3f90 100644 --- a/notebooks/analog_training_LeNet5_hwa.ipynb +++ b/notebooks/analog_training_LeNet5_hwa.ipynb @@ -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" ] }, { @@ -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 } diff --git a/notebooks/analog_training_LeNet5_plot.ipynb b/notebooks/analog_training_LeNet5_plot.ipynb index 4f24f6a4..9dde6dc9 100644 --- a/notebooks/analog_training_LeNet5_plot.ipynb +++ b/notebooks/analog_training_LeNet5_plot.ipynb @@ -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" ] }, { @@ -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 } diff --git a/notebooks/tutorial/analog_training.ipynb b/notebooks/tutorial/analog_training.ipynb index 45d70ccb..1e0f54a4 100644 --- a/notebooks/tutorial/analog_training.ipynb +++ b/notebooks/tutorial/analog_training.ipynb @@ -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" ] }, { @@ -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": { @@ -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": { diff --git a/notebooks/tutorial/extending_functionality.ipynb b/notebooks/tutorial/extending_functionality.ipynb index 284d844c..8214b368 100644 --- a/notebooks/tutorial/extending_functionality.ipynb +++ b/notebooks/tutorial/extending_functionality.ipynb @@ -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", @@ -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": { diff --git a/notebooks/tutorial/hw_aware_training.ipynb b/notebooks/tutorial/hw_aware_training.ipynb index 667329da..fb5b9f75 100644 --- a/notebooks/tutorial/hw_aware_training.ipynb +++ b/notebooks/tutorial/hw_aware_training.ipynb @@ -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" ] }, { @@ -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)}%\")" ] @@ -817,7 +817,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.10.14" }, "vscode": { "interpreter": { diff --git a/notebooks/tutorial/post_training_input_range_calibration.ipynb b/notebooks/tutorial/post_training_input_range_calibration.ipynb index 34f3a3a8..a1b45002 100644 --- a/notebooks/tutorial/post_training_input_range_calibration.ipynb +++ b/notebooks/tutorial/post_training_input_range_calibration.ipynb @@ -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" ] }, { @@ -646,7 +646,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.10.14" }, "vscode": { "interpreter": {