Skip to content

Commit

Permalink
revert format of AI_HW_Summit_2022.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
libinta committed Jul 28, 2023
1 parent d0888cd commit cfc426e
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions notebooks/AI_HW_Summit_2022.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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)"
Expand All @@ -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)\")"
]
},
{
Expand Down

0 comments on commit cfc426e

Please sign in to comment.