run_squad.py stuck on batch size greater than 1
Thanks a lot for the code! I need help figuring out why the script is not working so long the batch_size is set to be above 1. Specifically, it seems to be stuck at Line 908: loss = model(input_ids, segment_ids, input_mask, start_positions, end_positions). I am using 4 k80. Thanks!
Please copy paste the command you are using to run this example.<|||||>Here you go

```
python ./run_squad.py 
  --bert_model bert-base-uncased \
  --do_train \
  --do_predict \
  --train_file $SQUAD_DIR/train-v1.1.json \
  --predict_file $SQUAD_DIR/dev-v1.1.json \
  --learning_rate 3e-5 \
  --num_train_epochs 2 \
  --max_seq_length 384 \
  --doc_stride 128 \
  --train_batch_size 32 \
  --output_dir /tmp/debug_squad/ \
  --gradient_accumulation_steps 2 \
```<|||||>I don't see why this wouldn't work.
Maybe update the repo & module to the latest version?
You should also add `--do_lower_case` to the arguments if you are using an uncased model.
Maybe post a full log of your output?<|||||>Updated to the latest version but it still does not work. When I terminate the script after it is stuck for some time, I get the message  '../python3.7/threading.py", line 1072, in _wait_for_tstate_lock    elif lock.acquire(block, timeout)'. Perhaps it is running into some deadlock condition?

I'm not sure how to obtain a full log, would you be able to explain how can I do so? Thanks!<|||||>Hi, you can try with the new release 0.4.0.<|||||>Is the problem resolved? I am having the same issue, using 2 gtx1080ti. 
it stuck when running on multiple gpus. I have to comment out `torch.nn.DataParallel(model)`, to make it work. <|||||>If you are using a multi-GPU setting, pytorch splits the batch dynamically between the 2 GPUs.
Example - batch_size =5
GPU 0 may get 3,max_sequence_len
GPU 1 may get 2,max_sequence_len

This could be a cuda splitting issue, I recommend you try a single GPU setting to debug this.

Thanks,
Ankit 