mmdetection icon indicating copy to clipboard operation
mmdetection copied to clipboard

Multi-GPU and CPU support

Open druzhkov-paul opened this issue 3 years ago • 0 comments

To run sample several envvars should be defined:

MASTER_PORT - required; has to be a free port on machine with rank 0 MASTER_ADDR - required (except for rank 0); address of rank 0 node WORLD_SIZE - required; can be set either here, or in a call to init function RANK - required; can be set either here, or in a call to init function

Single GPU example:

$ MASTER_ADDR=localhost MASTER_PORT=2000 WORLD_SIZE=1 RANK=0 CUDA_VISIBLE_DEVICES=0 python mmdet/apis/ote/sample/sample.py configs/ote/custom-object-detection/mobilenetV2_ATSS/template.yaml

Two GPUs example:

$ MASTER_ADDR=localhost MASTER_PORT=2000 WORLD_SIZE=2 RANK=1 CUDA_VISIBLE_DEVICES=0,1 python mmdet/apis/ote/sample/sample.py configs/ote/custom-object-detection/mobilenetV2_ATSS/template.yaml & $ MASTER_ADDR=localhost MASTER_PORT=2000 WORLD_SIZE=2 RANK=0 CUDA_VISIBLE_DEVICES=0,1 python mmdet/apis/ote/sample/sample.py configs/ote/custom-object-detection/mobilenetV2_ATSS/template.yaml

druzhkov-paul avatar Jul 30 '21 16:07 druzhkov-paul