Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #267 from microsoft/hlu/Add_reference_running_time…
Browse files Browse the repository at this point in the history
…_to_more_notebooks

Hlu/add reference running time to more notebooks
  • Loading branch information
saidbleik committed Aug 13, 2019
2 parents 0642773 + 4dcd11b commit d7bc4e8
Show file tree
Hide file tree
Showing 5 changed files with 425 additions and 154 deletions.
56 changes: 26 additions & 30 deletions scenarios/entailment/entailment_multinli_bert.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"source": [
"# Before You Start\n",
"\n",
"The running time shown in this notebook is on a Standard_NC24s_v3 Azure Deep Learning Virtual Machine with 4 NVIDIA Tesla V100 GPUs. If you want to run through the notebook quickly, you can set the **`QUICK_RUN`** flag in the cell below to **`True`** to run the notebook on a small subset of the data and a smaller number of epochs. \n",
"The running time shown in this notebook is on a Standard_NC24s_v3 Azure Deep Learning Virtual Machine with 4 NVIDIA Tesla V100 GPUs. \n",
"> **Tip:** If you want to run through the notebook quickly, you can set the **`QUICK_RUN`** flag in the cell below to **`True`** to run the notebook on a small subset of the data and a smaller number of epochs. \n",
"\n",
"The table below provides some reference running time on different machine configurations. \n",
"\n",
"|QUICK_RUN|Machine Configurations|Running time|\n",
Expand All @@ -38,37 +40,11 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
"## Set QUICK_RUN = True to run the notebook on a small subset of data and a smaller number of epochs.\n",
"QUICK_RUN = False\n",
"\n",
"TRAIN_DATA_USED_PERCENT = 1\n",
"DEV_DATA_USED_PERCENT = 1\n",
"NUM_EPOCHS = 2"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if QUICK_RUN:\n",
" TRAIN_DATA_USED_PERCENT = 0.001\n",
" DEV_DATA_USED_PERCENT = 0.01\n",
" NUM_EPOCHS = 1\n",
"\n",
"import torch\n",
"if torch.cuda.is_available():\n",
" BATCH_SIZE = 32\n",
"else:\n",
" BATCH_SIZE = 16"
"## Set QUICK_RUN = True to run the notebook on a small subset of data and a smaller number of epochs.\n",
"QUICK_RUN = False"
]
},
{
Expand Down Expand Up @@ -96,6 +72,8 @@
"from sklearn.metrics import classification_report\n",
"from sklearn.preprocessing import LabelEncoder\n",
"\n",
"import torch\n",
"\n",
"nlp_path = os.path.abspath('../../')\n",
"if nlp_path not in sys.path:\n",
" sys.path.insert(0, nlp_path)\n",
Expand All @@ -116,9 +94,27 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"metadata": {
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
"TRAIN_DATA_USED_PERCENT = 1\n",
"DEV_DATA_USED_PERCENT = 1\n",
"NUM_EPOCHS = 2\n",
"\n",
"if QUICK_RUN:\n",
" TRAIN_DATA_USED_PERCENT = 0.001\n",
" DEV_DATA_USED_PERCENT = 0.01\n",
" NUM_EPOCHS = 1\n",
"\n",
"if torch.cuda.is_available():\n",
" BATCH_SIZE = 32\n",
"else:\n",
" BATCH_SIZE = 16\n",
"\n",
"# set random seeds\n",
"RANDOM_SEED = 42\n",
"random.seed(RANDOM_SEED)\n",
Expand Down

0 comments on commit d7bc4e8

Please sign in to comment.