Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
inference without horovod
Browse files Browse the repository at this point in the history
  • Loading branch information
zheyuye committed Jul 10, 2020
1 parent 31cb953 commit 4074a26
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions scripts/question_answering/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ python run_squad.py \
--overwrite_cache \
```

We support multi-GPU training via horovod:

```bash
mpirun -np 4 -H localhost:4 python run_squad.py \
--comm_backend horovod \
...
```
As for ELECTRA model, we fine-tune it with layer-wise learning rate decay as

```bash
Expand Down
7 changes: 6 additions & 1 deletion scripts/question_answering/run_squad.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,13 @@ def predict_extended(original_feature,


def evaluate(args, last=True):
store, num_workers, rank, local_rank, is_master_node, ctx_l = init_comm(
args.comm_backend, args.gpus)
# only evaluate once
if rank != 0:
return
ctx_l = parse_ctx(args.gpus)
logging.info('Srarting inference without horovod')
logging.info('Srarting inference without horovod on the first node')

cfg, tokenizer, qa_net, use_segmentation = get_network(
args.model_name, ctx_l, args.classifier_dropout)
Expand Down

0 comments on commit 4074a26

Please sign in to comment.