From 919e1b728aaff9d15f7edee980a238f085e75fe5 Mon Sep 17 00:00:00 2001 From: Jihyeong Lee Date: Tue, 6 Sep 2022 10:58:31 -0400 Subject: [PATCH 1/8] Updated CNN class activation example for PT 1.12 ZCC deprecation --- .../cnn_class_activation_maps.ipynb | 17 +++++++++++------ .../entry_point/custom_hook.py | 2 +- .../entry_point/train.py | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb b/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb index 0bd3a5f04f..63f1caab59 100644 --- a/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb +++ b/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb @@ -80,7 +80,7 @@ " image.register_hook(self.backward_hook(\"image\"))\n", " \n", " def forward_hook(self, module, inputs, outputs):\n", - " module_name = self.module_maps[module] \n", + " module_name = module._module_name\n", " self._write_inputs(module_name, inputs)\n", " \n", " #register outputs for backward pass. this is expensive, so we will only do it during EVAL mode\n", @@ -570,8 +570,8 @@ " role=role,\n", " train_instance_type=\"ml.p3.2xlarge\",\n", " train_instance_count=1,\n", - " framework_version=\"1.3.1\",\n", - " py_version=\"py3\",\n", + " framework_version=\"1.12.0\",\n", + " py_version=\"py38\",\n", " hyperparameters={\n", " \"epochs\": 5,\n", " \"batch_size_train\": 64,\n", @@ -1325,9 +1325,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Environment (conda_pytorch_p36)", + "display_name": "Python 3.8.11 64-bit ('3.8.11')", "language": "python", - "name": "conda_pytorch_p36" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -1339,7 +1339,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.10" + "version": "3.8.11" }, "papermill": { "default_parameters": {}, @@ -1354,6 +1354,11 @@ }, "start_time": "2021-05-27T00:13:13.881398", "version": "2.3.3" + }, + "vscode": { + "interpreter": { + "hash": "7dc0c77d699a6b3ef5666acd9c55af31cd945013d6c45fb4570db128e5a0b8db" + } } }, "nbformat": 4, diff --git a/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/entry_point/custom_hook.py b/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/entry_point/custom_hook.py index 1c445eb15f..8e94b15a88 100644 --- a/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/entry_point/custom_hook.py +++ b/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/entry_point/custom_hook.py @@ -10,7 +10,7 @@ def image_gradients(self, image): image.register_hook(self.backward_hook("image")) def forward_hook(self, module, inputs, outputs): - module_name = self.module_maps[module] + module_name = module._module_name self._write_inputs(module_name, inputs) # register outputs for backward pass. this is expensive, so we will only do it during EVAL mode diff --git a/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/entry_point/train.py b/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/entry_point/train.py index c5e57b9429..d45ab2a3a0 100644 --- a/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/entry_point/train.py +++ b/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/entry_point/train.py @@ -81,6 +81,7 @@ def train_model(epochs, batch_size_train, batch_size_val): # create custom hook that has a customized forward function, so that we can get gradients of outputs hook = custom_hook.CustomHook.create_from_json_file() hook.register_module(model) + hook.register_loss(loss_function) # get the dataloaders for train and test data train_loader, val_loader = get_dataloaders(batch_size_train, batch_size_val) From 77ffe367765a875215692c1292afeb2426f9d175 Mon Sep 17 00:00:00 2001 From: Jihyeong Lee Date: Tue, 6 Sep 2022 13:21:01 -0400 Subject: [PATCH 2/8] Updated PyTorch MNIST script change example --- .../pytorch_script_change_smdebug.ipynb | 24 ++++++++++++------- .../scripts/pytorch_mnist.py | 16 +++++++------ 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb b/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb index 46cfd0be7b..b8e99ef391 100644 --- a/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb +++ b/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb @@ -98,13 +98,13 @@ "\n", "Tensors that debug hook captures are stored in S3 location specified by you. There are two ways you can configure Amazon SageMaker Debugger for storage:\n", "\n", - " 1. **Zero code change**: If you use any of SageMaker provided [Deep Learning containers](https://docs.aws.amazon.com/sagemaker/latest/dg/pre-built-containers-frameworks-deep-learning.html) then you don't need to make any changes to your training script for tensors to be stored. Amazon SageMaker Debugger will use the configuration you provide in the framework `Estimator` to save tensors in the fashion you specify.\n", + " 1. **Zero code change (DEPRECATED for PyTorch versions >= 1.12)**: If you use any of SageMaker provided [Deep Learning containers](https://docs.aws.amazon.com/sagemaker/latest/dg/pre-built-containers-frameworks-deep-learning.html) then you don't need to make any changes to your training script for tensors to be stored. Amazon SageMaker Debugger will use the configuration you provide in the framework `Estimator` to save tensors in the fashion you specify.\n", " \n", " **Note**: In case of PyTorch training, Debugger collects output tensors in GLOBAL mode by default. In other words, this option does not distinguish output tensors from different phases within an epoch, such as training phase and validation phase.\n", " \n", " 2. **Script change**: Use the SageMaker Debugger client library, SMDebug, and customize training scripts to save the specific tensors you want at different frequencies and configurations. Refer to the [DeveloperGuide](https://github.com/awslabs/sagemaker-debugger/tree/master/docs) for details on how to use SageMaker Debugger with your choice of framework in your training script.\n", " \n", - "In this notebook, we choose the second option to properly save the output tensors from different training phases.\n", + "In this notebook, we choose the second option to properly save the output tensors from different training phases since we're using PyTorch=1.12\n", "\n", "### Analysis of tensors\n", "\n", @@ -289,19 +289,20 @@ " ```\n", "\n", "\n", - "- **Step 4**: In the `main()` function, create the SMDebug hook and register to the model.\n", + "- **Step 4**: In the `main()` function, create the SMDebug hook and register to the model and loss function.\n", "\n", " ```python\n", " hook = smd.Hook.create_from_json_file()\n", " hook.register_hook(model)\n", + " hook.register_loss(loss_fn)\n", " ```\n", "\n", "\n", "- **Step 4**: In the `main()` function, pass the SMDebug hook to the `train()` and `test()` functions in the epoch loop.\n", "\n", " ```python\n", - " train(args, model, device, train_loader, optimizer, epoch, hook)\n", - " test(model, device, test_loader, hook)\n", + " train(args, model, loss_fn, device, train_loader, optimizer, epoch, hook)\n", + " test(model, device, loss_fn, test_loader, hook)\n", " ```" ] }, @@ -1277,9 +1278,9 @@ "metadata": { "instance_type": "ml.g4dn.xlarge", "kernelspec": { - "display_name": "Environment (conda_pytorch_p36)", + "display_name": "Python 3.8.11 64-bit ('3.8.11')", "language": "python", - "name": "conda_pytorch_p36" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -1291,7 +1292,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.10" + "version": "3.8.11" }, "papermill": { "default_parameters": {}, @@ -1306,8 +1307,13 @@ }, "start_time": "2021-06-01T00:12:49.274027", "version": "2.3.3" + }, + "vscode": { + "interpreter": { + "hash": "7dc0c77d699a6b3ef5666acd9c55af31cd945013d6c45fb4570db128e5a0b8db" + } } }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/sagemaker-debugger/pytorch_model_debugging/scripts/pytorch_mnist.py b/sagemaker-debugger/pytorch_model_debugging/scripts/pytorch_mnist.py index d4342e3566..e9e43ffd08 100644 --- a/sagemaker-debugger/pytorch_model_debugging/scripts/pytorch_mnist.py +++ b/sagemaker-debugger/pytorch_model_debugging/scripts/pytorch_mnist.py @@ -74,7 +74,7 @@ def forward(self, x): return output -def train(args, model, device, train_loader, optimizer, epoch, hook): +def train(args, model, loss_fn, device, train_loader, optimizer, epoch, hook): model.train() # =================================================# # 2. Set the SMDebug hook for the training phase. # @@ -84,12 +84,12 @@ def train(args, model, device, train_loader, optimizer, epoch, hook): data, target = data.to(device), target.to(device) optimizer.zero_grad() output = model(data) - loss = F.nll_loss(output, target) + loss = loss_fn(output, target) loss.backward() optimizer.step() if batch_idx % args.log_interval == 0: print( - "Train Epoch: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}".format( + "Train Epoch: {} [{}/{} ({:.0f}%)]\t Loss: {:.6f}".format( epoch, batch_idx * len(data), len(train_loader.dataset), @@ -101,7 +101,7 @@ def train(args, model, device, train_loader, optimizer, epoch, hook): break -def test(model, device, test_loader, hook): +def test(model, loss_fn, device, test_loader, hook): model.eval() # ===================================================# # 3. Set the SMDebug hook for the validation phase. # @@ -113,7 +113,7 @@ def test(model, device, test_loader, hook): for data, target in test_loader: data, target = data.to(device), target.to(device) output = model(data) - test_loss += F.nll_loss(output, target, reduction="sum").item() # sum up batch loss + test_loss += loss_fn(output, target).item() # sum up batch loss pred = output.argmax(dim=1, keepdim=True) # get the index of the max log-probability correct += pred.eq(target.view_as(pred)).sum().item() @@ -201,12 +201,14 @@ def main(): test_loader = torch.utils.data.DataLoader(dataset2, **test_kwargs) model = Net().to(device) + loss_fn = nn.NLLLoss() # ======================================================# # 4. Register the SMDebug hook to save output tensors. # # ======================================================# hook = smd.Hook.create_from_json_file() hook.register_hook(model) + hook.register_loss(loss_fn) optimizer = optim.Adadelta(model.parameters(), lr=args.lr) @@ -215,8 +217,8 @@ def main(): # ===========================================================# # 5. Pass the SMDebug hook to the train and test functions. # # ===========================================================# - train(args, model, device, train_loader, optimizer, epoch, hook) - test(model, device, test_loader, hook) + train(args, model, loss_fn, device, train_loader, optimizer, epoch, hook) + test(model, loss_fn, device, test_loader, hook) scheduler.step() if args.save_model: From fef2253737b71088f236f36043b9eeae1f3f7d82 Mon Sep 17 00:00:00 2001 From: Jihyeong Lee Date: Wed, 7 Sep 2022 13:16:28 -0400 Subject: [PATCH 3/8] updated iterative model pruning examples to PT 1.12 --- .../iterative_model_pruning_alexnet.ipynb | 4 ++-- .../iterative_model_pruning_resnet.ipynb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb index 37b1970e2c..4e3a9e610d 100644 --- a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb +++ b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb @@ -372,11 +372,11 @@ "estimator = PyTorch(\n", " role=sagemaker.get_execution_role(),\n", " instance_count=1,\n", - " instance_type=\"ml.p2.xlarge\",\n", + " instance_type=\"ml.p3.2xlarge\",\n", " volume_size=400,\n", " source_dir=\"src\",\n", " entry_point=\"train.py\",\n", - " framework_version=\"1.6\",\n", + " framework_version=\"1.12\",\n", " py_version=\"py3\",\n", " metric_definitions=[\n", " {\"Name\": \"train:loss\", \"Regex\": \"loss:(.*?)\"},\n", diff --git a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb index 9d4049371b..257a47da46 100644 --- a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb +++ b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb @@ -340,7 +340,7 @@ " volume_size=400,\n", " source_dir=\"src\",\n", " entry_point=\"train.py\",\n", - " framework_version=\"1.6\",\n", + " framework_version=\"1.12\",\n", " py_version=\"py3\",\n", " metric_definitions=[\n", " {\"Name\": \"train:loss\", \"Regex\": \"loss:(.*?)\"},\n", From bb64f33b9aac6aea84005b6c1897bbd866a02e76 Mon Sep 17 00:00:00 2001 From: Jihyeong Lee Date: Wed, 7 Sep 2022 14:19:01 -0400 Subject: [PATCH 4/8] Updated profiler examples to be nonzcc --- .../entry_point/pt_res50_cifar10_distributed.py | 1 + .../entry_point/pt_res50_cifar10_horovod_dataloader.py | 1 + .../entry_point/pytorch_res50_cifar10_dataloader.py | 1 + 3 files changed, 3 insertions(+) diff --git a/sagemaker-debugger/pytorch_profiling/entry_point/pt_res50_cifar10_distributed.py b/sagemaker-debugger/pytorch_profiling/entry_point/pt_res50_cifar10_distributed.py index 384333ce45..cc2e60f047 100644 --- a/sagemaker-debugger/pytorch_profiling/entry_point/pt_res50_cifar10_distributed.py +++ b/sagemaker-debugger/pytorch_profiling/entry_point/pt_res50_cifar10_distributed.py @@ -53,6 +53,7 @@ def train(batch_size, epoch, net, hook, device, local_rank): epoch_times = [] if hook: + hook.register_module(net) hook.register_loss(loss_optim) # train the model diff --git a/sagemaker-debugger/pytorch_profiling/entry_point/pt_res50_cifar10_horovod_dataloader.py b/sagemaker-debugger/pytorch_profiling/entry_point/pt_res50_cifar10_horovod_dataloader.py index 0a46a6dabd..290baf6738 100644 --- a/sagemaker-debugger/pytorch_profiling/entry_point/pt_res50_cifar10_horovod_dataloader.py +++ b/sagemaker-debugger/pytorch_profiling/entry_point/pt_res50_cifar10_horovod_dataloader.py @@ -101,6 +101,7 @@ def train(batch_size, epoch, net, hook, args, local_rank): print("START VALIDATING") if hook: + hook.register_module(net) hook.set_mode(modes.EVAL) test_sampler.set_epoch(i) net.eval() diff --git a/sagemaker-debugger/pytorch_profiling/entry_point/pytorch_res50_cifar10_dataloader.py b/sagemaker-debugger/pytorch_profiling/entry_point/pytorch_res50_cifar10_dataloader.py index 095cd57032..6636b67979 100644 --- a/sagemaker-debugger/pytorch_profiling/entry_point/pytorch_res50_cifar10_dataloader.py +++ b/sagemaker-debugger/pytorch_profiling/entry_point/pytorch_res50_cifar10_dataloader.py @@ -75,6 +75,7 @@ def train(args, net, device): epoch_times = [] if hook: + hook.register_module(net) hook.register_loss(loss_optim) # train the model From 791ce36c6b9d4fd8532676f079fbd31a06b72569 Mon Sep 17 00:00:00 2001 From: Jihyeong Lee Date: Fri, 9 Sep 2022 12:40:53 -0400 Subject: [PATCH 5/8] Changed nll_loss to NLLLoss --- .../pytorch_script_change_smdebug.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb b/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb index b8e99ef391..67af24649f 100644 --- a/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb +++ b/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb @@ -984,7 +984,7 @@ }, "outputs": [], "source": [ - "len(trial.tensor(\"nll_loss_output_0\").steps(mode=ModeKeys.TRAIN))" + "len(trial.tensor(\"NLLLoss_output_0\").steps(mode=ModeKeys.TRAIN))" ] }, { @@ -1003,7 +1003,7 @@ }, "outputs": [], "source": [ - "len(trial.tensor(\"nll_loss_output_0\").steps(mode=ModeKeys.EVAL))" + "len(trial.tensor(\"NLLLoss_output_0\").steps(mode=ModeKeys.EVAL))" ] }, { @@ -1117,7 +1117,7 @@ }, "outputs": [], "source": [ - "plot_tensor(trial, \"nll_loss_output_0\")" + "plot_tensor(trial, \"NLLLoss_output_0\")" ] }, { @@ -1143,7 +1143,7 @@ "RuleEvaluationConditionMet: Evaluation of the rule Overfit at step 4000 resulted in the condition being met\n", "```\n", "\n", - "Based on this rule evaluation and the plot above, we can conclude that the training job has an overfit issue. While the `nll_loss_output_0` line is decreasing, the `val_nll_loss_output_0` line is fluctuating and not decreasing. \n", + "Based on this rule evaluation and the plot above, we can conclude that the training job has an overfit issue. While the `NLLLoss_output_0` line is decreasing, the `val_NLLLoss_output_0` line is fluctuating and not decreasing. \n", "\n", "To resolve the overfit problem, you need to consider using or double-checking the following techniques:\n", "\n", From 38a90b428f245961733e10de03031b6e3b6dad44 Mon Sep 17 00:00:00 2001 From: Jihyeong Lee Date: Fri, 9 Sep 2022 12:48:35 -0400 Subject: [PATCH 6/8] Fixed build issues --- .../cnn_class_activation_maps.ipynb | 10 ++++++++++ .../iterative_model_pruning_alexnet.ipynb | 13 +++++++++---- .../iterative_model_pruning_resnet.ipynb | 13 +++++++++---- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb b/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb index 63f1caab59..6eedf2e790 100644 --- a/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb +++ b/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb @@ -326,6 +326,16 @@ "Before starting the SageMaker training job, we need to install some libraries. We will use `smdebug` library to read, filter and analyze raw tensors that are stored in Amazon S3. We will use `opencv-python` library to plot saliency maps as heatmap." ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "fab25828", + "metadata": {}, + "outputs": [], + "source": [ + "!apt-get update && apt-get install -y python3-opencv" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb index 4e3a9e610d..7c11423fdf 100644 --- a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb +++ b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb @@ -377,7 +377,7 @@ " source_dir=\"src\",\n", " entry_point=\"train.py\",\n", " framework_version=\"1.12\",\n", - " py_version=\"py3\",\n", + " py_version=\"py38\",\n", " metric_definitions=[\n", " {\"Name\": \"train:loss\", \"Regex\": \"loss:(.*?)\"},\n", " {\"Name\": \"eval:acc\", \"Regex\": \"acc:(.*?)\"},\n", @@ -785,9 +785,9 @@ "metadata": { "instance_type": "ml.t3.medium", "kernelspec": { - "display_name": "Python 3 (PyTorch 1.6 Python 3.6 CPU Optimized)", + "display_name": "Python 3.8.11 64-bit ('3.8.11')", "language": "python", - "name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/pytorch-1.6-cpu-py36-ubuntu16.04-v1" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -799,7 +799,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.13" + "version": "3.8.11" + }, + "vscode": { + "interpreter": { + "hash": "7dc0c77d699a6b3ef5666acd9c55af31cd945013d6c45fb4570db128e5a0b8db" + } } }, "nbformat": 4, diff --git a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb index 257a47da46..b747c7cd71 100644 --- a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb +++ b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb @@ -341,7 +341,7 @@ " source_dir=\"src\",\n", " entry_point=\"train.py\",\n", " framework_version=\"1.12\",\n", - " py_version=\"py3\",\n", + " py_version=\"py38\",\n", " metric_definitions=[\n", " {\"Name\": \"train:loss\", \"Regex\": \"loss:(.*?)\"},\n", " {\"Name\": \"eval:acc\", \"Regex\": \"acc:(.*?)\"},\n", @@ -721,9 +721,9 @@ "metadata": { "instance_type": "ml.t3.medium", "kernelspec": { - "display_name": "Python 3 (PyTorch 1.6 Python 3.6 CPU Optimized)", + "display_name": "Python 3.8.11 64-bit ('3.8.11')", "language": "python", - "name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/pytorch-1.6-cpu-py36-ubuntu16.04-v1" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -735,7 +735,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.13" + "version": "3.8.11" + }, + "vscode": { + "interpreter": { + "hash": "7dc0c77d699a6b3ef5666acd9c55af31cd945013d6c45fb4570db128e5a0b8db" + } } }, "nbformat": 4, From 310d75e210fe7a9b5982e820c7dfdf35a799fc10 Mon Sep 17 00:00:00 2001 From: Jihyeong Lee Date: Tue, 13 Sep 2022 15:08:48 -0400 Subject: [PATCH 7/8] Removed vscode metadata from notebooks --- .../cnn_class_activation_maps.ipynb | 5 ----- .../iterative_model_pruning_alexnet.ipynb | 11 +++-------- .../iterative_model_pruning_resnet.ipynb | 11 +++-------- .../pytorch_script_change_smdebug.ipynb | 5 ----- 4 files changed, 6 insertions(+), 26 deletions(-) diff --git a/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb b/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb index 6eedf2e790..653b95e4e4 100644 --- a/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb +++ b/sagemaker-debugger/model_specific_realtime_analysis/cnn_class_activation_maps/cnn_class_activation_maps.ipynb @@ -1364,11 +1364,6 @@ }, "start_time": "2021-05-27T00:13:13.881398", "version": "2.3.3" - }, - "vscode": { - "interpreter": { - "hash": "7dc0c77d699a6b3ef5666acd9c55af31cd945013d6c45fb4570db128e5a0b8db" - } } }, "nbformat": 4, diff --git a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb index 7c11423fdf..f18b0b040d 100644 --- a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb +++ b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb @@ -785,9 +785,9 @@ "metadata": { "instance_type": "ml.t3.medium", "kernelspec": { - "display_name": "Python 3.8.11 64-bit ('3.8.11')", + "display_name": "Python 3 (PyTorch 1.6 Python 3.6 CPU Optimized)", "language": "python", - "name": "python3" + "name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/pytorch-1.6-cpu-py36-ubuntu16.04-v1" }, "language_info": { "codemirror_mode": { @@ -799,12 +799,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.11" - }, - "vscode": { - "interpreter": { - "hash": "7dc0c77d699a6b3ef5666acd9c55af31cd945013d6c45fb4570db128e5a0b8db" - } + "version": "3.6.13" } }, "nbformat": 4, diff --git a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb index b747c7cd71..a079e6f860 100644 --- a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb +++ b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb @@ -721,9 +721,9 @@ "metadata": { "instance_type": "ml.t3.medium", "kernelspec": { - "display_name": "Python 3.8.11 64-bit ('3.8.11')", + "display_name": "Python 3 (PyTorch 1.6 Python 3.6 CPU Optimized)", "language": "python", - "name": "python3" + "name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/pytorch-1.6-cpu-py36-ubuntu16.04-v1" }, "language_info": { "codemirror_mode": { @@ -735,12 +735,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.11" - }, - "vscode": { - "interpreter": { - "hash": "7dc0c77d699a6b3ef5666acd9c55af31cd945013d6c45fb4570db128e5a0b8db" - } + "version": "3.6.13" } }, "nbformat": 4, diff --git a/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb b/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb index 67af24649f..8ae6dcc438 100644 --- a/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb +++ b/sagemaker-debugger/pytorch_model_debugging/pytorch_script_change_smdebug.ipynb @@ -1307,11 +1307,6 @@ }, "start_time": "2021-06-01T00:12:49.274027", "version": "2.3.3" - }, - "vscode": { - "interpreter": { - "hash": "7dc0c77d699a6b3ef5666acd9c55af31cd945013d6c45fb4570db128e5a0b8db" - } } }, "nbformat": 4, From 6d19d8fd8b9016a789457af73615e3389416bc2e Mon Sep 17 00:00:00 2001 From: Jihyeong Lee Date: Tue, 13 Sep 2022 16:20:26 -0400 Subject: [PATCH 8/8] renamed experiments to be model specific --- .../iterative_model_pruning_alexnet.ipynb | 2 +- .../iterative_model_pruning_resnet.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb index f18b0b040d..ff5ab416fd 100644 --- a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb +++ b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_alexnet.ipynb @@ -251,7 +251,7 @@ "# name of experiment\n", "timestep = datetime.now()\n", "timestep = timestep.strftime(\"%d-%m-%Y-%H-%M-%S\")\n", - "experiment_name = timestep + \"-model-pruning-experiment\"\n", + "experiment_name = timestep + \"-alexnet-model-pruning-experiment\"\n", "\n", "# create experiment\n", "Experiment.create(\n", diff --git a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb index a079e6f860..2c08e08870 100644 --- a/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb +++ b/sagemaker-debugger/pytorch_iterative_model_pruning/iterative_model_pruning_resnet.ipynb @@ -216,7 +216,7 @@ "# name of experiment\n", "timestep = datetime.now()\n", "timestep = timestep.strftime(\"%d-%m-%Y-%H-%M-%S\")\n", - "experiment_name = timestep + \"-model-pruning-experiment\"\n", + "experiment_name = timestep + \"resnet-model-pruning-experiment\"\n", "\n", "# create experiment\n", "Experiment.create(\n",