Very slow initialisation of GPU distributed training

Dear all,

I am facing extreme delays in mxnet initialization on distributed GPU training using horovod. Once I launch my code (for debugging, just 2 gpus), it populates the GPUs up to some memory level, and then it does not start training until after 30 minutes (yes, that is minutes, and am using 12 cpu cores per rank). The truth is that the computation graph of these latest models is very complicated, but I cannot believe that this can be the issue. I hybridize the gluon models (net and loss function) prior to training with net.hybridize(static_alloc=True,static_shape=True). The problem is not resolved by defining the cache as described in issue 3239.

Any pointers/help mostly appreciated.

Can you give more insight into your infrastructure?
Just to be sure it’s not an issue with your infra.
Which version mxnet?
What instance type? How many GPUs? etc

Is this a model specific issue?
Have you tried basic mnist/resnet/other popular models with Horovod? Has it worked well for those models?

Hi @ChaiBapchya, thank you very much for your reply.

The model is a building change detection model (like a siamese UNet) with semantic segmentation as the output. The building blocks are unfortunately complicated (in the sense complicated computation graph - and complication is bad :frowning: - I apologize for that). I am few weeks before submitting for publication and doing some last tests, I will be able to share code afterwards.

The problem is model dependent, everything works fine with standard models. Also, it seems the problem is not horovod dependent, because even a standard classification model (outside horovod), takes few minutes to launch - in contrast an identical network in backbone, with resnet building blocks launches almost immediately. I did this test yesterday.

I just exported the model into a json file (115733 lines), I don’t know if it gives more insight, but says in last 3 lines:

  ],                                                                     
  "heads": [[15266, 0, 0], [15231, 0, 0], [15203, 0, 0], [15270, 0, 0]], 
  "attrs": {"mxnet_version": ["int", 10600]}                             
}                                                                        

The environment is HPC local environment, I do my debugging tests by requesting 2 GPUs (P100), 12 processors (Xeon) per process, and 128GB of memory. It seems these models require a lot of CPU memory as well. mxnet version: cu101-1.6.0.dist-info, cuda 10.1.168

I can provide full system info, but I think the question is: can I load from a file/in memory to avoid going through this operation every time? I think it’s a GPU issue. When I load the models on cpu they fire up almost instantly.

I also get this warning, that I don’t know if it is relative:

In [9]: outs = config['net'](xx,xx)                                                                                                                                                  
[17:40:48] src/imperative/cached_op.cc:192: Disabling fusion due to altered topological order of inputs.                                                                                            

Again, thank you very much for your time.
Regards

1 Like

Thanks for the details.

As mentioned, this issue of slow GPU initialization and large CPU memory footprint both seem to be to specific to this model…
So as a result, it would be tough to make more claims before getting details about the implementation.
I’d defer to someone else experienced in model building / GPU on the discuss forum to help out.

1 Like

Thank you very much for your reply @ChaiBapchya. I will post code once I submit the paper to get help/gain a deeper understanding.

Sure. Looking forward to your paper being published! Good luck.

1 Like

Dear Feevos, sorry I can’t help out of this issue. But I am interested in your paper, how can I find it when it’s published?