Added data percent as script param so test can finish in 10ish minutes
"DEBUG = True\n",
"NODE_COUNT = 4\n",
"NUM_PROCESS = 1\n",
+ "DATA_PERCENT_USED = 1.0\n",
"\n",
"config_path = (\n",
" \"./.azureml\"\n",
"from utils_nlp.common.timer import Timer\n",
"from utils_nlp.dataset.xnli_torch_dataset import XnliDataset\n",
"from utils_nlp.models.bert.common import Language\n",
- "from pytorch_pretrained_bert.optimization import BertAdam\n",
"from utils_nlp.models.bert.sequence_classification_distributed import (\n",
" BERTSequenceClassifier,\n",
")\n",
"parser.add_argument(\n",
" \"--no-cuda\", action=\"store_true\", default=False, help=\"disables CUDA training\"\n",
")\n",
+ "parser.add_argument(\n",
+ " \"--data_percent_used\",\n",
+ " type=float,\n",
+ " default=1.0,\n",
+ " metavar=\"S\",\n",
+ " help=\"data percent used (default: 1.0)\",\n",
+ ")\n",
"\n",
"args = parser.parse_args()\n",
"args.cuda = not args.no_cuda and torch.cuda.is_available()\n",
"\n",
- "\n",
"\"\"\"\n",
"Note: For example, you have 4 nodes and 4 GPUs each node, so you spawn 16 workers. \n",
"Every worker will have a rank [0, 15], and every worker will have a local_rank [0, 3]\n",
" language=LANGUAGE_ENGLISH,\n",
" to_lowercase=TO_LOWERCASE,\n",
" tok_language=PRETRAINED_BERT_LNG,\n",
+ " data_percent_used=args.data_percent_used,\n",
")\n",
"\n",
"test_dataset = XnliDataset(\n",
"mpiConfig = MpiConfiguration()\n",
"mpiConfig.process_count_per_node = NUM_PROCESS\n",
"\n",
+ "script_params = {\n",
+ " '--data_percent_used': DATA_PERCENT_USED\n",
+ "}\n",
+ "\n",
"est = PyTorch(\n",
" source_directory=project_dir,\n",
" compute_target=compute_target,\n",
" entry_script=\"train.py\",\n",
+ " script_params = script_params,\n",
" node_count=NODE_COUNT,\n",
" distributed_training=mpiConfig,\n",
" use_gpu=True,\n",
"cell_type": "markdown",
"metadata": {},
"source": [
- "Since the above cell is an async call, the below cell is a blocking call to stop the below cells to execute."
+ "Since the above cell is an async call, the below cell is a blocking call to stop the cells below it to execute."
]
},
{
