From cfc426e02c96ea944c2863cd38f8ef6be96d1322 Mon Sep 17 00:00:00 2001 From: Libin Tang Date: Fri, 28 Jul 2023 12:00:11 -0700 Subject: [PATCH] revert format of AI_HW_Summit_2022.ipynb --- notebooks/AI_HW_Summit_2022.ipynb | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/notebooks/AI_HW_Summit_2022.ipynb b/notebooks/AI_HW_Summit_2022.ipynb index 915f6f3cf9..912970e162 100644 --- a/notebooks/AI_HW_Summit_2022.ipynb +++ b/notebooks/AI_HW_Summit_2022.ipynb @@ -178,10 +178,10 @@ "metadata": {}, "outputs": [], "source": [ - "training_args[\"use_habana\"] = True # Whether to use HPUs or not\n", - "training_args[\"use_lazy_mode\"] = True # Whether to use lazy or eager mode\n", + "training_args[\"use_habana\"] = True # Whether to use HPUs or not\n", + "training_args[\"use_lazy_mode\"] = True # Whether to use lazy or eager mode\n", "training_args[\"gaudi_config_name\"] = \"Habana/gpt2\" # Gaudi configuration to use\n", - "training_args[\"throughput_warmup_steps\"] = 3 # Remove the first N training iterations from throughput computation" + "training_args[\"throughput_warmup_steps\"] = 3 # Remove the first N training iterations from throughput computation" ] }, { @@ -306,8 +306,8 @@ "# Instantiate a distributed runner\n", "distributed_runner = DistributedRunner(\n", " command_list=[command], # The command(s) to execute\n", - " world_size=8, # The number of HPUs\n", - " use_deepspeed=True, # Enable DeepSpeed\n", + " world_size=8, # The number of HPUs\n", + " use_deepspeed=True, # Enable DeepSpeed\n", ")\n", "\n", "# Launch training\n", @@ -377,7 +377,9 @@ " text = text[: text.find(\".\")]\n", "\n", " # Add the prompt at the beginning of the sequence. Remove the excess text that was used for pre-processing\n", - " total_sequence = prompt_text + text[len(tokenizer.decode(encoded_prompt[0], clean_up_tokenization_spaces=True)) :]\n", + " total_sequence = (\n", + " prompt_text + text[len(tokenizer.decode(encoded_prompt[0], clean_up_tokenization_spaces=True)) :]\n", + " )\n", "\n", " generated_sequences.append(total_sequence)\n", " print(total_sequence)" @@ -403,12 +405,8 @@ "gaudi_price_per_hour = 13.10904\n", "v100_price_per_hour = 12.24\n", "\n", - "print(\n", - " f\"Gaudi (dl1.24xlarge): training time = 630s, cost = {np.round(630 * gaudi_price_per_hour / 3600, 2)}$ ({gaudi_price_per_hour}$/hr)\"\n", - ")\n", - "print(\n", - " f\"4 x V100 (p3.8xlarge) : training time = 858s, cost = {np.round(858 * v100_price_per_hour / 3600, 2)}$ ({v100_price_per_hour}$/hr)\"\n", - ")" + "print(f\"Gaudi (dl1.24xlarge): training time = 630s, cost = {np.round(630 * gaudi_price_per_hour / 3600, 2)}$ ({gaudi_price_per_hour}$/hr)\")\n", + "print(f\"4 x V100 (p3.8xlarge) : training time = 858s, cost = {np.round(858 * v100_price_per_hour / 3600, 2)}$ ({v100_price_per_hour}$/hr)\")" ] }, {