Opennmt-py: How do I train on multiple GPUs? Is it supported yet?

Created on 4 Apr 2018  路  8Comments  路  Source: OpenNMT/OpenNMT-py

I see these lines in train.py

if len(opt.gpuid) > 1:
   sys.stderr.write("Sorry, multigpu isn't supported yet, coming soon!\n")

But the repo description says:

Beta Features (committed):

  • multi-GPU

So, is it supported now? If so, how do I do multi GPU training?

Most helpful comment

We're working on it now. It's top priority.

All 8 comments

We're working on it now. It's top priority.

@bezigon Do you make it works with the combination of Horovod and OpenNMT-pytorch ? Is it as simple as the usage case in Horovod's ReadME ?

Hi @srush , do you have a rough schedule that the multiple-GPU features is available ? Thx

@srush I have the same problem. Has anyone solved this issue? Does OpenNMT-py support multi-gpu processing?

Thanks,

Read the faq.md

@vince62s Thanks for the guideline. I actually used the world_size and gpu_ranks but it didn't work with the following error:

RuntimeError: the distributed NCCL backend is not available; try to recompile the THD package with CUDA and NCCL 2+ support at /opt/conda/conda-bld/pytorch_1533672544752/work/torch/lib/THD/process_group/General.cpp:17

The code I was running:
python train.py -save_model models/radModel -data data/radModel -copy_attn -layers 1 -reuse_copy_attn -world_size 2 -gpu_ranks 0 1 -batch_size 20

I also exprted CUDA_VISIBLE_DEVICES=0,1

@sajastu Did you try installing NCCL?
You can find the instructions here

Was this page helpful?
0 / 5 - 0 ratings

Related issues

1130310223 picture 1130310223  路  4Comments

caozhen-alex picture caozhen-alex  路  5Comments

memray picture memray  路  4Comments

AyaNsar picture AyaNsar  路  4Comments

nikhilweee picture nikhilweee  路  3Comments